blocxx
|
#include <StringBuffer.hpp>
Public Member Functions | |
StringBuffer (size_t allocSize=BLOCXX_DEFAULT_ALLOCATION_UNIT) | |
StringBuffer (const char *arg) | |
StringBuffer (const String &arg) | |
StringBuffer (const StringBuffer &arg) | |
~StringBuffer () | |
StringBuffer & | operator= (const StringBuffer &arg) |
StringBuffer & | operator= (const String &arg) |
StringBuffer & | operator= (const char *str) |
void | swap (StringBuffer &x) |
StringBuffer & | append (char c) |
StringBuffer & | append (const char *str) |
StringBuffer & | append (const char *str, const size_t len) |
StringBuffer & | append (const String &arg) |
StringBuffer & | append (const StringBuffer &arg) |
StringBuffer & | operator+= (char c) |
StringBuffer & | operator+= (Char16 c) |
StringBuffer & | operator+= (const char *str) |
StringBuffer & | operator+= (const String &arg) |
StringBuffer & | operator+= (Bool v) |
StringBuffer & | operator+= (UInt8 v) |
StringBuffer & | operator+= (Int8 v) |
StringBuffer & | operator+= (UInt16 v) |
StringBuffer & | operator+= (Int16 v) |
StringBuffer & | operator+= (UInt32 v) |
StringBuffer & | operator+= (Int32 v) |
StringBuffer & | operator+= (UInt64 v) |
StringBuffer & | operator+= (Int64 v) |
StringBuffer & | operator+= (Real32 v) |
StringBuffer & | operator+= (Real64 v) |
StringBuffer & | operator+= (const StringBuffer &arg) |
char | operator[] (size_t ndx) const |
String | toString () const |
String | releaseString () |
size_t | length () const |
void | truncate (size_t index) |
Truncate the string at the given index. | |
const char * | getLine (std::istream &is, bool resetBuffer=true) |
Fill this StringBuffer object with the next line from the given input stream. | |
bool | endsWith (char ch) const |
bool | startsWith (char ch) const |
void | chop () |
void | trim () |
size_t | allocated () const |
void | reset () |
const char * | c_str () const |
bool | equals (const char *arg) const |
bool | equals (const StringBuffer &arg) const |
Static Public Attributes | |
static const size_t | BLOCXX_DEFAULT_ALLOCATION_UNIT = 128 |
Private Member Functions | |
void | checkAvail (size_t len=1) |
Private Attributes | |
size_t | m_len |
size_t | m_allocated |
char * | m_bfr |
Friends | |
BLOCXX_COMMON_API std::ostream & | operator<< (std::ostream &ostr, const StringBuffer &b) |
Definition at line 51 of file StringBuffer.hpp.
BLOCXX_NAMESPACE::StringBuffer::StringBuffer | ( | size_t | allocSize = BLOCXX_DEFAULT_ALLOCATION_UNIT | ) |
Definition at line 62 of file StringBuffer.cpp.
References BLOCXX_DEFAULT_ALLOCATION_UNIT, m_allocated, m_bfr, and m_len.
Referenced by append(), append(), append(), append(), equals(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator<<, operator=(), operator=(), operator=(), StringBuffer(), and swap().
BLOCXX_NAMESPACE::StringBuffer::StringBuffer | ( | const char * | arg | ) |
Definition at line 70 of file StringBuffer.cpp.
References BLOCXX_DEFAULT_ALLOCATION_UNIT, m_allocated, m_bfr, and m_len.
BLOCXX_NAMESPACE::StringBuffer::StringBuffer | ( | const String & | arg | ) |
Definition at line 78 of file StringBuffer.cpp.
References BLOCXX_DEFAULT_ALLOCATION_UNIT, BLOCXX_NAMESPACE::String::c_str(), length(), m_allocated, m_bfr, and m_len.
BLOCXX_NAMESPACE::StringBuffer::StringBuffer | ( | const StringBuffer & | arg | ) |
Definition at line 86 of file StringBuffer.cpp.
References m_allocated, m_bfr, m_len, and StringBuffer().
|
inline |
Definition at line 63 of file StringBuffer.hpp.
References m_bfr.
|
inline |
Definition at line 152 of file StringBuffer.hpp.
References m_allocated.
|
inline |
Definition at line 68 of file StringBuffer.hpp.
References checkAvail(), m_bfr, m_len, and StringBuffer().
Referenced by append(), append(), BLOCXX_NAMESPACE::SafeCString::fget_string(), BLOCXX_NAMESPACE::LogMessagePatternFormatter::Converter::formatMessage(), getLine(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), operator+=(), and operator+=().
|
inline |
Definition at line 75 of file StringBuffer.hpp.
References checkAvail(), m_bfr, m_len, and StringBuffer().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::append | ( | const char * | str, |
const size_t | len ) |
Definition at line 284 of file StringBuffer.cpp.
References checkAvail(), m_bfr, and m_len.
|
inline |
Definition at line 84 of file StringBuffer.hpp.
References append(), BLOCXX_NAMESPACE::String::c_str(), BLOCXX_NAMESPACE::String::length(), and StringBuffer().
|
inline |
Definition at line 86 of file StringBuffer.hpp.
References append(), c_str(), length(), and StringBuffer().
|
inline |
Definition at line 154 of file StringBuffer.hpp.
References m_bfr.
Referenced by append(), operator<<, and BLOCXX_NAMESPACE::operator==().
|
inlineprivate |
Definition at line 159 of file StringBuffer.hpp.
References m_allocated, m_bfr, and m_len.
void BLOCXX_NAMESPACE::StringBuffer::chop | ( | ) |
Definition at line 322 of file StringBuffer.cpp.
References m_len, and truncate().
bool BLOCXX_NAMESPACE::StringBuffer::endsWith | ( | char | ch | ) | const |
Definition at line 308 of file StringBuffer.cpp.
Referenced by BLOCXX_NAMESPACE::SafeCString::fget_string().
bool BLOCXX_NAMESPACE::StringBuffer::equals | ( | const char * | arg | ) | const |
Definition at line 294 of file StringBuffer.cpp.
References m_bfr.
Referenced by BLOCXX_NAMESPACE::operator==(), and BLOCXX_NAMESPACE::operator==().
bool BLOCXX_NAMESPACE::StringBuffer::equals | ( | const StringBuffer & | arg | ) | const |
Definition at line 301 of file StringBuffer.cpp.
References m_bfr, and StringBuffer().
const char * BLOCXX_NAMESPACE::StringBuffer::getLine | ( | std::istream & | is, |
bool | resetBuffer = true ) |
Fill this StringBuffer object with the next line from the given input stream.
is | The input stream to retrieve the next line from |
Definition at line 362 of file StringBuffer.cpp.
References append(), m_bfr, reset(), and truncate().
Referenced by BLOCXX_NAMESPACE::String::getLine().
|
inline |
Definition at line 128 of file StringBuffer.hpp.
References m_len.
Referenced by append(), BLOCXX_NAMESPACE::SafeCString::fget_string(), BLOCXX_NAMESPACE::LogMessagePatternFormatter::Converter::formatMessage(), BLOCXX_NAMESPACE::CmdLineParser::getUsage(), operator<<, and StringBuffer().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | Bool | v | ) |
Definition at line 149 of file StringBuffer.cpp.
References append(), and BLOCXX_NAMESPACE::Bool::toString().
|
inline |
Definition at line 90 of file StringBuffer.hpp.
References append(), and StringBuffer().
|
inline |
Definition at line 92 of file StringBuffer.hpp.
References append(), StringBuffer(), and BLOCXX_NAMESPACE::Char16::toString().
|
inline |
Definition at line 94 of file StringBuffer.hpp.
References append(), and StringBuffer().
|
inline |
Definition at line 96 of file StringBuffer.hpp.
References append(), and StringBuffer().
|
inline |
Definition at line 114 of file StringBuffer.hpp.
References append(), and StringBuffer().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | Int16 | v | ) |
Definition at line 182 of file StringBuffer.cpp.
References append().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | Int32 | v | ) |
Definition at line 198 of file StringBuffer.cpp.
References append().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | Int64 | v | ) |
Definition at line 236 of file StringBuffer.cpp.
References append().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | Int8 | v | ) |
Definition at line 166 of file StringBuffer.cpp.
References append().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | Real32 | v | ) |
Definition at line 249 of file StringBuffer.cpp.
References append().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | Real64 | v | ) |
Definition at line 265 of file StringBuffer.cpp.
References append().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | UInt16 | v | ) |
Definition at line 174 of file StringBuffer.cpp.
References append().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | UInt32 | v | ) |
Definition at line 190 of file StringBuffer.cpp.
References append().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | UInt64 | v | ) |
Definition at line 224 of file StringBuffer.cpp.
References append().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator+= | ( | UInt8 | v | ) |
Definition at line 158 of file StringBuffer.cpp.
References append().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator= | ( | const char * | str | ) |
Definition at line 101 of file StringBuffer.cpp.
References StringBuffer(), and swap().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator= | ( | const String & | arg | ) |
Definition at line 94 of file StringBuffer.cpp.
References StringBuffer(), and swap().
StringBuffer & BLOCXX_NAMESPACE::StringBuffer::operator= | ( | const StringBuffer & | arg | ) |
Definition at line 108 of file StringBuffer.cpp.
References StringBuffer(), and swap().
char BLOCXX_NAMESPACE::StringBuffer::operator[] | ( | size_t | ndx | ) | const |
Definition at line 142 of file StringBuffer.cpp.
|
inline |
Definition at line 122 of file StringBuffer.hpp.
References BLOCXX_NAMESPACE::String::E_TAKE_OWNERSHIP, m_bfr, and m_len.
Referenced by BLOCXX_NAMESPACE::SafeCString::fget_string(), BLOCXX_NAMESPACE::LogMessagePatternFormatter::Converter::formatMessage(), BLOCXX_NAMESPACE::String::getLine(), BLOCXX_NAMESPACE::StackTrace::getStackTrace(), BLOCXX_NAMESPACE::CmdLineParser::getUsage(), BLOCXX_NAMESPACE::LogAppender::logMessage(), BLOCXX_NAMESPACE::UnnamedPipe::readAll(), BLOCXX_NAMESPACE::String::String(), BLOCXX_NAMESPACE::UTF8Utils::UCS2ToString(), and BLOCXX_NAMESPACE::UTF8Utils::UCS4toUTF8().
void BLOCXX_NAMESPACE::StringBuffer::reset | ( | ) |
Definition at line 123 of file StringBuffer.cpp.
Referenced by getLine().
bool BLOCXX_NAMESPACE::StringBuffer::startsWith | ( | char | ch | ) | const |
Definition at line 315 of file StringBuffer.cpp.
void BLOCXX_NAMESPACE::StringBuffer::swap | ( | StringBuffer & | x | ) |
Definition at line 115 of file StringBuffer.cpp.
References m_allocated, m_bfr, m_len, and StringBuffer().
Referenced by operator=(), operator=(), and operator=().
|
inline |
Definition at line 119 of file StringBuffer.hpp.
References m_bfr.
Referenced by BLOCXX_NAMESPACE::CmdLineParser::getUsage().
void BLOCXX_NAMESPACE::StringBuffer::trim | ( | ) |
Definition at line 332 of file StringBuffer.cpp.
void BLOCXX_NAMESPACE::StringBuffer::truncate | ( | size_t | index | ) |
Truncate the string at the given index.
This doesn't change anything before the given index and does not free up any memory.
index | The index to truncate the string buffer at. If this value is greater than the current length of the StringBuffer, then nothing is done. |
Definition at line 131 of file StringBuffer.cpp.
Referenced by chop(), BLOCXX_NAMESPACE::LogMessagePatternFormatter::Converter::formatMessage(), and getLine().
|
friend |
Definition at line 405 of file StringBuffer.cpp.
References c_str(), length(), and StringBuffer().
|
static |
Definition at line 57 of file StringBuffer.hpp.
Referenced by StringBuffer(), StringBuffer(), and StringBuffer().
|
private |
Definition at line 174 of file StringBuffer.hpp.
Referenced by allocated(), checkAvail(), StringBuffer(), StringBuffer(), StringBuffer(), StringBuffer(), and swap().
|
private |
Definition at line 175 of file StringBuffer.hpp.
Referenced by append(), append(), append(), c_str(), checkAvail(), endsWith(), equals(), equals(), getLine(), operator[](), releaseString(), reset(), startsWith(), StringBuffer(), StringBuffer(), StringBuffer(), StringBuffer(), swap(), toString(), trim(), truncate(), and ~StringBuffer().
|
private |
Definition at line 173 of file StringBuffer.hpp.
Referenced by append(), append(), append(), checkAvail(), chop(), endsWith(), length(), operator[](), releaseString(), reset(), startsWith(), StringBuffer(), StringBuffer(), StringBuffer(), StringBuffer(), swap(), trim(), and truncate().