Namespaces | Typedefs | Functions

String.h File Reference

#include <string>
#include <sstream>
Include dependency graph for String.h:

Go to the source code of this file.

Namespaces

namespace  Hypertable
 

Copyright (C) 2009 Doug Judd (Zvents, Inc.)


Typedefs

typedef std::string Hypertable::String
 We might want to use something better later, as std::string always causes a heap allocation, and is lacking in functionalities cf.
typedef long unsigned int Hypertable::Lu
typedef long long unsigned int Hypertable::Llu
typedef long long int Hypertable::Lld

Functions

String Hypertable::format (const char *fmt,...) __attribute__((format(printf
 Return a String using printf like format facilities vanilla snprintf is about 1.5x faster than this, which is about: 10x faster than boost::format; 1.5x faster than std::string append (operator+=); 3.5x faster than std::string operator+;.
String Hypertable::format_number (int64_t n, int sep= ',')
 Return decimal number string separated by a separator (default: comma) for every 3 digits.
String Hypertable::format_bytes (size_t n, const void *buf, size_t len, const char *trailer="...")
 Return first n bytes of buffer with an optinal trailer if the size of the buffer exceeds n.
template<class SequenceT >
String Hypertable::format_list (const SequenceT &seq, const char *sep=", ")
 Return a string presentation of a sequence.