Rudiments
bytebuffer.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#ifndef RUDIMENTS_BYTEBUFFER_H
5#define RUDIMENTS_BYTEBUFFER_H
6
7#include <rudiments/private/bytebufferincludes.h>
8
13class RUDIMENTS_DLLSPEC bytebuffer : public output {
14 public:
15
19
22 bytebuffer(size_t initialsize);
23
28 bytebuffer(byte_t *initialcontents, size_t initialsize);
29
33
37
39 virtual ~bytebuffer();
40
46 off64_t setPositionRelativeToBeginning(off64_t offset);
47
53 off64_t setPositionRelativeToCurrent(off64_t offset);
54
61 off64_t setPositionRelativeToEnd(off64_t offset);
62
65 off64_t getPosition();
66
74 ssize_t write(const byte_t *data, size_t size);
75
83 ssize_t write(const char *string, size_t length);
84
91 ssize_t write(const char *string);
92
100 ssize_t write(const wchar_t *string, size_t length);
101
108 ssize_t write(const wchar_t *string);
109
117 ssize_t writeUcs2(const ucs2_t *string, size_t length);
118
125 ssize_t writeUcs2(const ucs2_t *string);
126
133 ssize_t write(char character);
134
141 ssize_t write(wchar_t character);
142
149 ssize_t writeUcs2(ucs2_t character);
150
157 ssize_t write(int16_t number);
158
165 ssize_t write(int32_t number);
166
173 ssize_t write(int64_t number);
174
181 ssize_t write(byte_t character);
182
189 ssize_t write(uint16_t number);
190
197 ssize_t write(uint32_t number);
198
205 ssize_t write(uint64_t number);
206
213 ssize_t write(float number);
214
221 ssize_t write(double number);
222
229 bytebuffer *append(const byte_t *data, size_t size);
230
237 bytebuffer *append(const char *string, size_t length);
238
244 bytebuffer *append(const char *string);
245
252 bytebuffer *append(const wchar_t *string, size_t length);
253
259 bytebuffer *append(const wchar_t *string);
260
267 bytebuffer *appendUcs2(const ucs2_t *string,
268 size_t length);
269
275 bytebuffer *appendUcs2(const ucs2_t *string);
276
283
290
297
303 bytebuffer *append(int16_t number);
304
310 bytebuffer *append(int32_t number);
311
317 bytebuffer *append(int64_t number);
318
325
331 bytebuffer *append(uint16_t number);
332
338 bytebuffer *append(uint32_t number);
339
345 bytebuffer *append(uint64_t number);
346
352 bytebuffer *append(float number);
353
359 bytebuffer *append(double number);
360
361
363 virtual void truncate(size_t pos);
364
366 virtual void truncate();
367
368
373 ssize_t read(byte_t *data, size_t size);
374
378 bool clear();
379
384 bool clear(size_t initialsize);
385
392 bool clear(byte_t *initialcontents, size_t initialsize);
393
395 const byte_t *getBuffer();
396
399 size_t getSize();
400
405
409
417 byte_t *detachBuffer();
418
419 #include <rudiments/private/bytebuffer.h>
420};
421
422#endif
Definition bytebuffer.h:13
ssize_t write(uint16_t number)
bytebuffer & operator=(bytebuffer &v)
ssize_t write(const wchar_t *string, size_t length)
bytebuffer * append(int16_t number)
bytebuffer * append(int64_t number)
bool clear()
virtual ~bytebuffer()
ssize_t write(const char *string)
bytebuffer * append(const char *string, size_t length)
ssize_t writeUcs2(const ucs2_t *string, size_t length)
ssize_t write(int64_t number)
ssize_t write(byte_t character)
ssize_t write(int16_t number)
bool clear(size_t initialsize)
off64_t setPositionRelativeToCurrent(off64_t offset)
ssize_t write(float number)
ssize_t writeUcs2(const ucs2_t *string)
ssize_t write(double number)
bytebuffer(byte_t *initialcontents, size_t initialsize)
ssize_t write(const byte_t *data, size_t size)
off64_t getPosition()
bytebuffer * append(const wchar_t *string, size_t length)
virtual void truncate()
bytebuffer * appendUcs2(ucs2_t character)
bool clear(byte_t *initialcontents, size_t initialsize)
bytebuffer * append(wchar_t character)
byte_t * detachBuffer()
ssize_t write(char character)
off64_t setPositionRelativeToBeginning(off64_t offset)
bytebuffer * append(const wchar_t *string)
ssize_t write(const wchar_t *string)
virtual void truncate(size_t pos)
size_t getInitialSize()
bytebuffer(size_t initialsize)
ssize_t writeUcs2(ucs2_t character)
ssize_t write(const char *string, size_t length)
ssize_t write(uint32_t number)
bytebuffer(bytebuffer &v)
ssize_t write(uint64_t number)
bytebuffer * append(uint16_t number)
bytebuffer * appendUcs2(const ucs2_t *string, size_t length)
ssize_t write(int32_t number)
ssize_t read(byte_t *data, size_t size)
ssize_t write(wchar_t character)
bytebuffer * append(int32_t number)
bytebuffer * append(double number)
bytebuffer * append(byte_t character)
size_t getActualSize()
bytebuffer * append(uint64_t number)
bytebuffer * appendUcs2(const ucs2_t *string)
bytebuffer * append(uint32_t number)
bytebuffer * append(const char *string)
off64_t setPositionRelativeToEnd(off64_t offset)
bytebuffer * append(char character)
size_t getSize()
bytebuffer * append(float number)
bytebuffer * append(const byte_t *data, size_t size)
const byte_t * getBuffer()
Definition character.h:11
Definition output.h:11