#include <StringAppender.h>
Definition at line 32 of file StringAppender.h.
Public Member Functions | |
StringAppender (char *buf, size_t size) | |
size_t | append (const char *str, size_t len=0) |
size_t | append (const std::string &str) |
size_t | append (char c) |
size_t | appendf (const char *fmt,...) |
size_t | vappendf (const char *fmt, va_list ap) |
size_t | length () |
size_t | desired_length () |
Private Attributes | |
char * | cur_ |
size_t | remaining_ |
size_t | len_ |
size_t | desired_ |
oasys::StringAppender::StringAppender | ( | char * | buf, | |
size_t | size | |||
) |
buf | Buffer to append strings to. | |
size | Size of buf. This includes room for the terminating ''. |
Definition at line 7 of file StringAppender.cc.
size_t oasys::StringAppender::append | ( | const char * | str, | |
size_t | len = 0 | |||
) |
Append the string to the tail of the buffer.
str | string data | |
len | string length (if unspecified, will call strlen()) |
Definition at line 13 of file StringAppender.cc.
References ASSERT, cur_, desired_, len_, and remaining_.
Referenced by append().
size_t oasys::StringAppender::append | ( | const std::string & | str | ) | [inline] |
Append the string to the tail of the buffer.
str | string data |
Definition at line 55 of file StringAppender.h.
References append().
size_t oasys::StringAppender::append | ( | char | c | ) |
Append the character to the tail of the buffer.
c | the character |
Definition at line 42 of file StringAppender.cc.
References ASSERT, cur_, desired_, len_, and remaining_.
size_t oasys::StringAppender::appendf | ( | const char * | fmt, | |
... | ||||
) |
Formatting append function.
fmt | the format string |
Definition at line 64 of file StringAppender.cc.
References vappendf().
size_t oasys::StringAppender::vappendf | ( | const char * | fmt, | |
va_list | ap | |||
) |
Formatting append function.
fmt | the format string | |
ap | the format argument list |
Definition at line 76 of file StringAppender.cc.
References ASSERT, cur_, desired_, len_, remaining_, and vsnprintf().
Referenced by appendf().
size_t oasys::StringAppender::length | ( | ) | [inline] |
Definition at line 88 of file StringAppender.h.
References len_.
size_t oasys::StringAppender::desired_length | ( | ) | [inline] |
Definition at line 94 of file StringAppender.h.
References desired_.
char* oasys::StringAppender::cur_ [private] |
size_t oasys::StringAppender::remaining_ [private] |
size_t oasys::StringAppender::len_ [private] |
size_t oasys::StringAppender::desired_ [private] |
Definition at line 100 of file StringAppender.h.
Referenced by append(), desired_length(), and vappendf().