dillo
3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
![]() ![]() |
A class for fast concatenation of a large number of strings. More...
#include <misc.hh>
Classes | |
struct | Node |
Public Member Functions | |
StringBuffer () | |
~StringBuffer () | |
void | append (const char *str) |
Append a NUL-terminated string to the buffer, with copying. More... | |
void | appendNoCopy (char *str) |
Append a NUL-terminated string to the buffer, without copying. More... | |
const char * | getChars () |
Return a NUL-terminated strings containing all appended strings. More... | |
void | clear () |
Remove all strings appended to the string buffer. More... | |
Private Attributes | |
Node * | firstNode |
Node * | lastNode |
int | numChars |
char * | str |
bool | strValid |
A class for fast concatenation of a large number of strings.
lout::misc::StringBuffer::StringBuffer | ( | ) |
lout::misc::StringBuffer::~StringBuffer | ( | ) |
|
inline |
Append a NUL-terminated string to the buffer, with copying.
A copy is kept in the buffer, so the caller does not have to care about memory management.
Definition at line 517 of file misc.hh.
References appendNoCopy(), and str.
Referenced by dw::core::SelectionState::copy(), lout::object::Object::intoStringBuffer(), lout::object::Pointer::intoStringBuffer(), lout::container::untyped::Collection::intoStringBuffer(), lout::object::Integer::intoStringBuffer(), lout::object::ConstString::intoStringBuffer(), lout::identity::IdentifiableObject::intoStringBuffer(), lout::object::PairBase::intoStringBuffer(), lout::signal::Emitter::intoStringBuffer(), lout::signal::Receiver::intoStringBuffer(), lout::container::untyped::HashTable::intoStringBuffer(), and lout::misc::BitSet::intoStringBuffer().
void lout::misc::StringBuffer::appendNoCopy | ( | char * | str | ) |
Append a NUL-terminated string to the buffer, without copying.
No copy is made, so this method should only be used in cases, where the string would otherwise be freed again. (This method may then save some CPU cycles.)
Definition at line 68 of file misc.cc.
References lout::misc::StringBuffer::Node::data, firstNode, lastNode, lout::misc::StringBuffer::Node::next, numChars, str, and strValid.
Referenced by append(), and dw::core::SelectionState::copy().
void lout::misc::StringBuffer::clear | ( | ) |
Remove all strings appended to the string buffer.
Definition at line 116 of file misc.cc.
References lout::misc::StringBuffer::Node::data, firstNode, lastNode, lout::misc::StringBuffer::Node::next, numChars, and strValid.
Referenced by ~StringBuffer().
const char * lout::misc::StringBuffer::getChars | ( | ) |
Return a NUL-terminated strings containing all appended strings.
The caller does not have to free the string, this is done in misc::StringBuffer::~StringBuffer.
Definition at line 92 of file misc.cc.
References firstNode, lout::misc::StringBuffer::Node::next, numChars, str, and strValid.
Referenced by dw::core::SelectionState::copy(), and lout::object::Object::toString().
|
private |
Definition at line 502 of file misc.hh.
Referenced by appendNoCopy(), clear(), getChars(), and StringBuffer().
|
private |
Definition at line 502 of file misc.hh.
Referenced by appendNoCopy(), clear(), and StringBuffer().
|
private |
Definition at line 503 of file misc.hh.
Referenced by appendNoCopy(), clear(), getChars(), and StringBuffer().
|
private |
Definition at line 504 of file misc.hh.
Referenced by append(), appendNoCopy(), getChars(), StringBuffer(), and ~StringBuffer().
|
private |
Definition at line 505 of file misc.hh.
Referenced by appendNoCopy(), clear(), getChars(), and StringBuffer().