Rudiments: /home/dmuse/temp/rudiments/include/rudiments/stringbuffer.h Source File

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
13 class RUDIMENTS_DLLSPEC stringbuffer : public bytebuffer {
14 public:
15
18 stringbuffer();
19
22 stringbuffer(size_t initialsize);
23
29 stringbuffer(char *initialcontents, size_t initialsize);
30
33 stringbuffer(const stringbuffer &s);
34
37 stringbuffer &operator=(const stringbuffer &s);
38
40 ~stringbuffer();
41
47 void setPosition(size_t pos);
48
51 size_t getPosition();
52
60 ssize_t write(const unsigned char *string);
61
70 ssize_t write(const unsigned char *string, size_t size);
71
79 ssize_t write(const char *string);
80
89 ssize_t write(const char *string, size_t length);
90
98 ssize_t write(char character);
99
108 ssize_t write(int16_t number);
109
118 ssize_t write(int32_t number);
119
128 ssize_t write(int64_t number);
129
137 ssize_t write(unsigned char character);
138
147 ssize_t write(uint16_t number);
148
157 ssize_t write(uint32_t number);
158
167 ssize_t write(uint64_t number);
168
177 ssize_t write(float number);
178
187 ssize_t write(float number, uint16_t scale);
188
198 ssize_t write(float number, uint16_t precision,
199 uint16_t scale);
200
209 ssize_t write(double number);
210
219 ssize_t write(double number, uint16_t scale);
220
230 ssize_t write(double number, uint16_t precision,
231 uint16_t scale);
232
233
239 stringbuffer *append(const unsigned char *string);
240
247 stringbuffer *append(const unsigned char *string,
248 size_t size);
249
255 stringbuffer *append(const char *string);
256
263 stringbuffer *append(const char *string, size_t length);
264
270 stringbuffer *append(char character);
271
278 stringbuffer *append(int16_t number);
279
286 stringbuffer *append(int32_t number);
287
294 stringbuffer *append(int64_t number);
295
301 stringbuffer *append(unsigned char character);
302
309 stringbuffer *append(uint16_t number);
310
317 stringbuffer *append(uint32_t number);
318
325 stringbuffer *append(uint64_t number);
326
333 stringbuffer *append(int16_t number, uint16_t zeropadding);
334
341 stringbuffer *append(int32_t number, uint16_t zeropadding);
342
349 stringbuffer *append(int64_t number, uint16_t zeropadding);
350
357 stringbuffer *append(uint16_t number, uint16_t zeropadding);
358
365 stringbuffer *append(uint32_t number, uint16_t zeropadding);
366
373 stringbuffer *append(uint64_t number, uint16_t zeropadding);
374
381 stringbuffer *append(float number);
382
389 stringbuffer *append(float number, uint16_t scale);
390
398 stringbuffer *append(float number, uint16_t precision,
399 uint16_t scale);
400
407 stringbuffer *append(double number);
408
415 stringbuffer *append(double number, uint16_t scale);
416
424 stringbuffer *append(double number, uint16_t precision,
425 uint16_t scale);
426
428 void truncate(size_t pos);
429
431 void truncate();
432
434 void clear();
435
438 void clear(size_t initialsize);
439
444 void clear(char *initialcontents, size_t initialsize);
445
447 const char *getString();
448
455 char *detachString();
456
459 size_t getStringLength();
460 };
461
462 #include <rudiments/private/stringbufferinlines.h>
463
464 #endif
bytebuffer
Definition: bytebuffer.h:13
bytebuffer::append
bytebuffer * append(const unsigned char *data, size_t size)
bytebuffer::setPosition
void setPosition(size_t pos)
bytebuffer::clear
void clear()
bytebuffer::truncate
virtual void truncate()
bytebuffer::write
ssize_t write(const unsigned char *data, size_t size)
bytebuffer::operator=
bytebuffer & operator=(const bytebuffer &v)
bytebuffer::getPosition
size_t getPosition()
character
Definition: character.h:11
stringbuffer
Definition: stringbuffer.h:13