11 #include "wvbufbase.h"
33 void putstr(WvStringParm str);
34 void putstr(WVSTRING_FORMAT_DECL)
35 { putstr(
WvString(WVSTRING_FORMAT_CALL)); }
67 {
return int(
get()); }
77 { put((
unsigned char)ch); }
88 {
return int(peek(offset)); }
97 size_t strchr(
int ch);
106 size_t match(
const void *bytelist,
size_t numbytes)
107 {
return _match(bytelist, numbytes,
false); }
116 {
return match(chlist, strlen(chlist)); }
125 size_t notmatch(
const void *bytelist,
size_t numbytes)
126 {
return _match(bytelist, numbytes,
true); }
135 {
return notmatch(chlist, strlen(chlist)); }
139 void put(
unsigned char value)
141 void put(
const void *data,
size_t count)
143 (
const unsigned char*)data, count); }
144 void move(
void *data,
size_t count)
146 (
unsigned char*)data, count); }
147 void poke(
void *data,
int offset,
size_t count)
149 (
unsigned char*)data, offset, count); }
153 size_t _match(
const void *bytelist,
size_t numbytes,
bool reverse);
168 bool _autofree =
false) :
170 _avail, _size, _autofree) { }
175 void reset(
void *_data,
size_t _avail,
size_t _size,
176 bool _autofree =
false)
179 (
unsigned char*)_data, _avail, _size, _autofree);
192 (
const unsigned char*)_data, _avail) { }
195 void reset(
const void *_data,
size_t _avail)
198 (
const unsigned char*)_data, _avail);
210 bool _autofree =
false) :
212 _avail, _size, _autofree) { }
217 void reset(
void *_data,
size_t _avail,
size_t _size,
218 bool _autofree =
false)
221 (
unsigned char*)_data, _avail, _size, _autofree);
261 void reset(WvStringParm _str);
272 #endif // __WVBUFFER_H
void poke(const T *data, int offset, size_t count)
Efficiently copies the specified number of elements from the specified storage location into the buff...
The generic buffer base type.
void putch(int ch)
Puts a single character into the buffer as an int.
WvString str()
Returns the string that backs the array.
void move(T *buf, size_t count)
Efficiently copies the specified number of elements from the buffer to the specified UNINITIALIZED st...
A raw memory read-only buffer backed by a constant WvString.
int getch()
Returns a single character from the buffer as an int.
A buffer that wraps a pre-allocated array and provides read-only access to its elements.
A buffer that provides a read-write view over another buffer with a different datatype.
WvString is an implementation of a simple and efficient printable-string class.
A buffer that wraps a pre-allocated array and provides read-write access to its elements.
void reset(const T *_data, size_t _avail)
Resets the underlying buffer pointer and properties.
Interface * get(IObject *aObj)
XPLC equivalent to dynamic_cast.
A buffer that wraps a pre-allocated array and provides read-write access to its elements using a circ...
The in place raw memory buffer type.
void reset(T *_data, size_t _avail, size_t _size, bool _autofree=false)
Resets the underlying buffer pointer and properties.
Specialization of WvBufBase for unsigned char type buffers intended for use with raw memory buffers.
int peekch(int offset=0)
Peeks a single character from the buffer as an int.
void put(const T *data, size_t count)
Writes the specified number of elements from the specified storage location into the buffer at its ta...
The abstract buffer storage base class.
size_t notmatch(const void *bytelist, size_t numbytes)
Returns the number of leading buffer elements that do not match any of those in the list.
The const in place raw memory buffer type.
WvConstStringBuffer()
Creates a new empty buffer backed by a null string.
void reset(T *_data, size_t _avail, size_t _size, bool _autofree=false)
Resets the underlying buffer pointer and properties.
A buffer that is always empty.
A buffer that acts like a cursor over a portion of another buffer.
The circular in place raw memory buffer type.
size_t match(const char *chlist)
Returns the number of leading buffer elements that match any of those in the list.
An abstract generic buffer template.
size_t match(const void *bytelist, size_t numbytes)
Returns the number of leading buffer elements that match any of those in the list.
void reset(WvStringParm _str)
Resets the buffer contents to a new string.
size_t notmatch(const char *chlist)
Returns the number of leading buffer elements that do not match any of those in the list.