|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
7 #ifndef ELM_STRING_STRING_BUFFER_H
8 #define ELM_STRING_STRING_BUFFER_H
10 #include <elm/string/CString.h>
11 #include <elm/string/String.h>
12 #include <elm/io/BlockOutStream.h>
13 #include <elm/io/Output.h>
22 : io::
Output(_stream), _stream(capacity, increment)
27 return String((String::buffer_t *)_stream.
detach(),
sizeof(
short), len); }
29 { _stream.
write(
'\0');
return _stream.
block() +
sizeof(short); }
32 {
return String( _stream.
block() +
sizeof(
short), _stream.
size() -
sizeof(
short)); }
33 inline int length(
void)
const {
return _stream.
size() -
sizeof(short); }
38 inline void init(
void) { String::buffer_t
str = { 0 }; _stream.
write((
char *)&
str,
sizeof(
short)); }
39 io::BlockOutStream _stream;
44 #endif // ELM_STRING_STRING_BUFFER_H
int size(void) const
Definition: BlockOutStream.h:22
virtual int write(const char *buffer, int size)
Definition: io_BlockOutStream.cpp:85
Definition: StringBuffer.h:18
char * detach(void)
Definition: BlockOutStream.h:23
void reset(void)
Definition: StringBuffer.h:34
String copyString()
Definition: StringBuffer.h:31
io::OutStream & stream(void)
Definition: StringBuffer.h:35
int length(void) const
Definition: StringBuffer.h:33
CString toCString()
Definition: StringBuffer.h:28
Definition: OutStream.h:30
String toString()
Definition: StringBuffer.h:25
void clear(void)
Definition: BlockOutStream.h:24
const char * block(void) const
Definition: BlockOutStream.h:21
StringBuffer(int capacity=64, int increment=32)
Definition: StringBuffer.h:21
string str(const char *s)
Definition: String.h:150