Rudiments
ucs2stringbufferinlines.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information
3
4#include <rudiments/ucs2charstring.h>
5#include <rudiments/ucs2character.h>
6
7inline
10
11inline
15
16inline
20
21inline
24
25inline
27 if (this!=&s) {
29 }
30 return *this;
31}
32
33inline
36
37inline
42
43inline
48
49inline
54
55inline
57 bytebuffer::append((ucs2_t)0);
58 const ucs2_t *retval=(const ucs2_t *)getBuffer();
59 _position(_position()-1);
60 _size(_size()-1);
61 return retval;
62}
63
64inline
68
69inline
71 bytebuffer::append((ucs2_t)0);
72 return (ucs2_t *)detachBuffer();
73}
74
75inline
79
80inline
84
85inline
89
90inline
94
95inline
97 return (ucs2stringbuffer *)bytebuffer::append(string,
98 ucs2charstring::getLength((const ucs2_t *)string));
99}
100
101inline
102ucs2stringbuffer *ucs2stringbuffer::append(const byte_t *string, size_t size) {
103 return (ucs2stringbuffer *)bytebuffer::append(string,size);
104}
105
106inline
108 return appendUcs2(string,ucs2charstring::getLength(string));
109}
110
111inline
113 size_t length) {
115}
116
117inline
121
122inline
126
127inline
131
132inline
136
137inline
139 uint16_t zeropadding) {
140 return append((int64_t)number,zeropadding);
141}
142
143inline
145 uint16_t zeropadding) {
146 return append((int64_t)number,zeropadding);
147}
148
149inline
151 uint16_t zeropadding) {
154 delete[] num;
155 return this;
156}
157
158inline
162
163inline
167
168inline
172
173inline
177
178inline
180 uint16_t zeropadding) {
181 return append((uint64_t)number,zeropadding);
182}
183
184inline
186 uint16_t zeropadding) {
187 return append((uint64_t)number,zeropadding);
188}
189
190inline
192 uint16_t zeropadding) {
195 delete[] num;
196 return this;
197}
198
199inline
203
204inline
206 printf("%.*f",scale,number);
207 return this;
208}
209
210inline
212 uint16_t scale) {
213 printf("%*.*f",precision,scale,number);
214 return this;
215}
216
217inline
221
222inline
224 printf("%.*f",scale,number);
225 return this;
226}
227
228inline
230 uint16_t scale) {
231 printf("%*.*f",precision,scale,number);
232 return this;
233}
234
235inline
236ssize_t ucs2stringbuffer::write(const byte_t *string) {
237 return bytebuffer::write(string,
238 ucs2charstring::getLength((const ucs2_t *)string));
239}
240
241inline
242ssize_t ucs2stringbuffer::write(const byte_t *string, size_t size) {
243 return bytebuffer::write(string,size);
244}
245
246inline
247ssize_t ucs2stringbuffer::writeUcs2(const ucs2_t *string) {
249}
250
251inline
252ssize_t ucs2stringbuffer::writeUcs2(const ucs2_t *string, size_t length) {
253 return bytebuffer::writeUcs2(string,length);
254}
255
256inline
260
261inline
263 return printf("%hd",number);
264}
265
266inline
268 return printf("%d",number);
269}
270
271inline
273 return printf("%lld",number);
274}
275
276inline
280
281inline
283 return printf("%hd",number);
284}
285
286inline
288 return printf("%d",number);
289}
290
291inline
293 return bytebuffer::printf("%lld",number);
294}
295
296inline
298 return write(number,4);
299}
300
301inline
302ssize_t ucs2stringbuffer::write(float number, uint16_t scale) {
303 return printf("%.*f",scale,number);
304}
305
306inline
308 uint16_t precision, uint16_t scale) {
309 return printf("%*.*f",precision,scale,number);
310}
311
312inline
314 return write(number,4);
315}
316
317inline
318ssize_t ucs2stringbuffer::write(double number, uint16_t scale) {
319 return printf("%.*f",scale,number);
320}
321
322inline
324 uint16_t precision, uint16_t scale) {
325 return printf("%*.*f",precision,scale,number);
326}
327
328inline
332
333inline
Definition avltree.h:11
Definition bytebuffer.h:13
bytebuffer & operator=(bytebuffer &v)
bool clear()
ssize_t writeUcs2(const ucs2_t *string, size_t length)
off64_t setPositionRelativeToCurrent(off64_t offset)
ssize_t write(const byte_t *data, size_t size)
off64_t getPosition()
virtual void truncate()
byte_t * detachBuffer()
off64_t setPositionRelativeToBeginning(off64_t offset)
bytebuffer * appendUcs2(const ucs2_t *string, size_t length)
off64_t setPositionRelativeToEnd(off64_t offset)
bytebuffer * append(const byte_t *data, size_t size)
const byte_t * getBuffer()
Definition character.h:11
virtual ssize_t printf(const char *format,...)
Definition outputinlines.h:25
static size_t getLength(const ucs2_t *string)
static ucs2_t * parseNumber(int16_t number)
Definition ucs2stringbuffer.h:13
off64_t setPositionRelativeToBeginning(off64_t pos)
Definition ucs2stringbufferinlines.h:38
ucs2stringbuffer * append(const byte_t *string)
Definition ucs2stringbufferinlines.h:96
bool clear()
Definition ucs2stringbufferinlines.h:81
ssize_t write(const byte_t *string)
Definition ucs2stringbufferinlines.h:236
off64_t setPositionRelativeToEnd(off64_t pos)
Definition ucs2stringbufferinlines.h:50
ucs2stringbuffer()
Definition ucs2stringbufferinlines.h:8
ssize_t writeUcs2(const ucs2_t *string)
Definition ucs2stringbufferinlines.h:247
void truncate()
Definition ucs2stringbufferinlines.h:334
ucs2_t * detachString()
Definition ucs2stringbufferinlines.h:70
off64_t setPositionRelativeToCurrent(off64_t pos)
Definition ucs2stringbufferinlines.h:44
off64_t getPosition()
Definition ucs2stringbufferinlines.h:76
~ucs2stringbuffer()
Definition ucs2stringbufferinlines.h:34
const ucs2_t * getString()
Definition ucs2stringbufferinlines.h:56
ucs2stringbuffer * appendUcs2(const ucs2_t *string)
Definition ucs2stringbufferinlines.h:107
size_t getStringLength()
Definition ucs2stringbufferinlines.h:65
ucs2stringbuffer & operator=(ucs2stringbuffer &s)
Definition ucs2stringbufferinlines.h:26