dbi.util.StringWriter
- class
SqlStringWriter_
(bool AllowCustomAlloc = false);
- Utility class for writing sql statement to a string buffer
- size_t
growSize
;
- The string grow size
- char[]
reserve
(size_t sz);
- Ensures that the buffer has space to write sz elements and
does appropriate allocation as necessary.
Params:
size_t sz |
the buffer length to
reserve
|
Returns:
- TypeOfThis
backup
(size_t n = 1);
- Decrements the buffer index essentially erasing data that was written
Params:
size_t n |
the number of characters to
backup
|
Returns:
- TypeOfThis
correct
(char c);
- Replaces the previously written character with the
provided character c
- size_t
length
();
- Returns:
The current
length
of the array that has been written to (not the size of
the buffer).
- alias
opCall
;
- Alias for write
- TypeOfThis
write
(char[][] strs...);
- TypeOfThis
write
(size_t delegate(void[] buf) writeDg);
- Exposes raw buffer for writing
Params:
size_t delegate(void[] buf) writeDg |
the delegate which will
write
to the exposed buffer. this
delegate must return the number of bytes written. |
- TypeOfThis
write
(size_t reserveSize, size_t delegate(void[] buf) writeDg);
- Reserves a certain amount of space in the
write
buffer
and exposes that raw buffer to writing
Params:
size_t delegate(void[] buf) writeDg |
the delegate which will
write
to the exposed buffer. this
delegate must return the number of bytes written. |
- void
opCatAssign
(char ch);
- Appends to the string
- void
opCatAssign
(char[] str);
- Appends to the string
- char[]
get
();
- Returns:
The string that has been written. (Essentially returns a
slice of the string buffer up to the last character that has been written.)
- void
reset
();
- Resets buffer for reuse
- void
free
();
- Frees memory that has been allocated
|