101 const unsigned char *p = s;
164 typename std::enable_if<std::is_same<T,size_t>::value,T>::type* =
nullptr
204 void write(
const char *buf,
size_t len)
240 void str(
const std::string &s)
273 n =
static_cast<uint32_t
>(-
static_cast<int32_t
>(n));
275 do { *--p = (
static_cast<char>(n%10)) +
'0'; n /= 10; }
while ( n );
276 if ( neg ) *--p =
'-';
282 snprintf(buf,64,
"%f",d);
286 std::ostream *
m_s =
nullptr;
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
const std::string & str() const
Text streaming class that buffers data.
bool empty() const
Returns true iff the buffer is empty.
void operator+=(unsigned short i)
void operator+=(const DString &s)
void setStream(std::ostream *s)
Sets or changes the std::ostream to write to.
void operator+=(const char *s)
TextStream & operator<<(const std::string &s)
Adds a std::string to the stream.
void output_double(double d)
TextStream & operator<<(float f)
Adds a float to the stream.
TextStream & operator<<(unsigned short i)
Adds a unsigned short integer to the stream.
void output_int32(uint32_t n, bool neg)
Writes a string representation of an integer to the buffer.
TextStream & operator<<(signed int i)
Adds a signed integer to the stream.
TextStream & operator<<(double d)
Adds a double to the stream.
TextStream & operator<<(const DString &s)
Adds a DString to the stream.
void operator+=(double d)
TextStream & operator<<(T i)
Adds a size_t integer to the stream.
TextStream & operator<<(const unsigned char *s)
Adds an unsigned character string to the stream.
TextStream(const std::string &s)
Create a text stream, initializing the buffer with string s.
void str(const std::string &s)
Sets the buffer's contents to string s.
TextStream & operator<<(signed short i)
Adds a signed short integer to the stream.
TextStream & operator<<(const char *s)
Adds a C-style string to the stream.
void flush()
Flushes the buffer.
TextStream(std::ostream *s)
Create a text stream object for writing to a std::ostream.
void write(const char *buf, size_t len)
Adds a array of character to the stream.
void operator+=(unsigned char c)
void operator+=(signed int i)
void operator+=(signed short i)
void operator+=(const unsigned char *s)
~TextStream()
Writes any data that is buffered to the attached std::ostream.
std::string str() const
Return the contents of the buffer as a std::string object.
void operator+=(unsigned int i)
void str(const char *s)
Sets the buffer's contents to string s Any data already in the buffer will be flushed.
TextStream(size_t capacity=INITIAL_CAPACITY)
Creates an empty stream object.
void operator+=(const std::string &s)
static const int INITIAL_CAPACITY
TextStream & operator<<(unsigned char c)
Adds an unsigned character to the stream.
TextStream & operator<<(char c)
Adds a character to the stream.
void clear()
Clears any buffered data.
TextStream & operator<<(unsigned int i)
Adds a unsigned integer to the stream.
#define ONLY_DEFAULT_MOVABLE(cls)
Macro to help implementing the rule of 5 for a class that can be moved but not copied.