Rudiments
stringbuffer.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#ifndef RUDIMENTS_STRINGBUFFER_H
5#define RUDIMENTS_STRINGBUFFER_H
6
7#include <rudiments/private/stringbufferincludes.h>
8
13class RUDIMENTS_DLLSPEC stringbuffer : public bytebuffer {
14 public:
15
19
23
30
34
38
41
47 off64_t setPositionRelativeToBeginning(off64_t pos);
48
54 off64_t setPositionRelativeToCurrent(off64_t pos);
55
62 off64_t setPositionRelativeToEnd(off64_t pos);
63
66 off64_t getPosition();
67
75 ssize_t write(const byte_t *string);
76
85 ssize_t write(const byte_t *string, size_t size);
86
94 ssize_t write(const char *string);
95
104 ssize_t write(const char *string, size_t length);
105
113 ssize_t write(char character);
114
123 ssize_t write(int16_t number);
124
133 ssize_t write(int32_t number);
134
143 ssize_t write(int64_t number);
144
152 ssize_t write(byte_t character);
153
162 ssize_t write(uint16_t number);
163
172 ssize_t write(uint32_t number);
173
182 ssize_t write(uint64_t number);
183
192 ssize_t write(float number);
193
202 ssize_t write(float number, uint16_t scale);
203
213 ssize_t write(float number, uint16_t precision,
214 uint16_t scale);
215
224 ssize_t write(double number);
225
234 ssize_t write(double number, uint16_t scale);
235
245 ssize_t write(double number, uint16_t precision,
246 uint16_t scale);
247
248
254 stringbuffer *append(const byte_t *string);
255
262 stringbuffer *append(const byte_t *string, size_t size);
263
269 stringbuffer *append(const char *string);
270
277 stringbuffer *append(const char *string, size_t length);
278
285
292 stringbuffer *append(int16_t number);
293
300 stringbuffer *append(int32_t number);
301
308 stringbuffer *append(int64_t number);
309
316
323 stringbuffer *append(uint16_t number);
324
331 stringbuffer *append(uint32_t number);
332
339 stringbuffer *append(uint64_t number);
340
347 stringbuffer *append(int16_t number, uint16_t zeropadding);
348
355 stringbuffer *append(int32_t number, uint16_t zeropadding);
356
363 stringbuffer *append(int64_t number, uint16_t zeropadding);
364
371 stringbuffer *append(uint16_t number, uint16_t zeropadding);
372
379 stringbuffer *append(uint32_t number, uint16_t zeropadding);
380
387 stringbuffer *append(uint64_t number, uint16_t zeropadding);
388
395 stringbuffer *append(float number);
396
403 stringbuffer *append(float number, uint16_t scale);
404
412 stringbuffer *append(float number, uint16_t precision,
413 uint16_t scale);
414
421 stringbuffer *append(double number);
422
429 stringbuffer *append(double number, uint16_t scale);
430
438 stringbuffer *append(double number, uint16_t precision,
439 uint16_t scale);
440
442 void truncate(size_t pos);
443
445 void truncate();
446
450 bool clear();
451
456 bool clear(size_t initialsize);
457
464 bool clear(char *initialcontents, size_t initialsize);
465
467 const char *getString();
468
475 char *detachString();
476
479 size_t getStringLength();
480};
481
482#include <rudiments/private/stringbufferinlines.h>
483
484#endif
Definition avltree.h:11
Definition bytebuffer.h:13
bytebuffer & operator=(bytebuffer &v)
bool clear()
off64_t setPositionRelativeToCurrent(off64_t offset)
ssize_t write(const byte_t *data, size_t size)
off64_t getPosition()
virtual void truncate()
off64_t setPositionRelativeToBeginning(off64_t offset)
off64_t setPositionRelativeToEnd(off64_t offset)
bytebuffer * append(const byte_t *data, size_t size)
Definition character.h:11
Definition stringbuffer.h:13