1
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file. See the AUTHORS file for names of contributors.
5
// Must not be included from any .h files to avoid polluting the namespace
8
#ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_
9
#define STORAGE_LEVELDB_UTIL_LOGGING_H_
14
#include "port/port.h"
21
// Append a human-readable printout of "num" to *str
22
extern void AppendNumberTo(std::string* str, uint64_t num);
24
// Append a human-readable printout of "value" to *str.
25
// Escapes any non-printable characters found in "value".
26
extern void AppendEscapedStringTo(std::string* str, const Slice& value);
28
// Return a human-readable printout of "num"
29
extern std::string NumberToString(uint64_t num);
31
// Return a human-readable version of "value".
32
// Escapes any non-printable characters found in "value".
33
extern std::string EscapeString(const Slice& value);
35
// If *in starts with "c", advances *in past the first character and
36
// returns true. Otherwise, returns false.
37
extern bool ConsumeChar(Slice* in, char c);
39
// Parse a human-readable number from "*in" into *value. On success,
40
// advances "*in" past the consumed number and sets "*val" to the
41
// numeric value. Otherwise, returns false and leaves *in in an
43
extern bool ConsumeDecimalNumber(Slice* in, uint64_t* val);
45
} // namespace leveldb
47
#endif // STORAGE_LEVELDB_UTIL_LOGGING_H_