4#include <rudiments/charstring.h>
5#include <rudiments/wcharstring.h>
6#include <rudiments/character.h>
12 managearrayvalues(false),
14 managearraykeys(false),
21 managevalues(
c.managevalues),
22 managearrayvalues(
c.managearrayvalues),
23 managekeys(
c.managekeys),
24 managearraykeys(
c.managearraykeys),
33 managevalues=
c.managevalues;
34 managearrayvalues=
c.managearrayvalues;
35 managekeys=
c.managekeys;
36 managearraykeys=
c.managearraykeys;
64 managearrayvalues=
false;
100 return managearrayvalues;
106 managearraykeys=
false;
122 return managearraykeys;
126ssize_t collection::writeValue(
output *out,
const char *value) {
127 return out->
printf(
"%s",value);
131ssize_t collection::writeValue(
output *out,
char *value) {
132 return out->
printf(
"%s",value);
136ssize_t collection::writeValue(
output *out,
const wchar_t *value) {
137 return out->
printf(
L"%s",value);
141ssize_t collection::writeValue(
output *out,
wchar_t *value) {
142 return out->
printf(
L"%s",value);
146ssize_t collection::writeValue(
output *out,
char value) {
147 return out->
printf(
"%c",value);
151ssize_t collection::writeValue(
output *out,
wchar_t value) {
152 return out->
printf(
L"%c",value);
156ssize_t collection::writeValue(
output *out,
bool value) {
157 return out->
printf(
"%s",(value)?
"true":
"false");
161ssize_t collection::writeValue(
output *out, int16_t value) {
162 return out->
printf(
"%hd",value);
166ssize_t collection::writeValue(
output *out, int32_t value) {
167 return out->
printf(
"%d",value);
171ssize_t collection::writeValue(
output *out, int64_t value) {
172 #ifdef RUDIMENTS_HAVE_LONG_LONG
173 return out->
printf(
"%lld",(
long long)value);
175 return out->
printf(
"%ld",(
long)value);
180ssize_t collection::writeValue(
output *out,
const byte_t *value) {
181 return out->
printf(
"%s",value);
185ssize_t collection::writeValue(
output *out, byte_t *value) {
186 return out->
printf(
"%s",value);
190ssize_t collection::writeValue(
output *out, byte_t value) {
191 return out->
printf(
"%c",value);
195ssize_t collection::writeValue(
output *out, uint16_t value) {
196 return out->
printf(
"%hd",value);
200ssize_t collection::writeValue(
output *out, uint32_t value) {
201 return out->
printf(
"%d",value);
205ssize_t collection::writeValue(
output *out, uint64_t value) {
206 #ifdef RUDIMENTS_HAVE_LONG_LONG
207 return out->
printf(
"%lld",(
long long)value);
209 return out->
printf(
"%ld",(
long)value);
214ssize_t collection::writeValue(
output *out,
float value) {
215 return out->
printf(
"%f",value);
219ssize_t collection::writeValue(
output *out,
double value) {
220 return out->
printf(
"%f",value);
224ssize_t collection::writeValue(
output *out,
long double value) {
225 return out->
printf(
"%Lf",value);
229ssize_t collection::writeValue(
output *out,
const void *value) {
230 return out->
printf(
"%08x",value);
234ssize_t collection::writeValue(
output *out,
void *value) {
235 return out->
printf(
"%08x",value);
239ssize_t collection::writeValue(
output *out,
const object *value) {
242 return out->
printf(
"%08x",(
const void *)value);
246ssize_t collection::writeValue(
output *out,
object *value) {
249 return out->
printf(
"%08x",(
const void *)value);
252template <
class valuetype>
257 return out->
printf(
"%08x",(
const void *)&value);
261ssize_t collection::writeJsonValue(
output *out,
const char *value) {
263 return out->
write(
"null");
265 return out->
printf(
"%s",value);
267 return out->
printf(
"\"%s\"",value);
271ssize_t collection::writeJsonValue(
output *out,
char *value) {
273 return out->
write(
"null");
275 return out->
printf(
"%s",value);
277 return out->
printf(
"\"%s\"",value);
281ssize_t collection::writeJsonValue(
output *out,
const wchar_t *value) {
283 return out->
write(
"null");
285 return out->
printf(
L"%s",value);
287 return out->
printf(
L"\"%s\"",value);
291ssize_t collection::writeJsonValue(
output *out,
wchar_t *value) {
293 return out->
write(
"null");
295 return out->
printf(
L"%s",value);
297 return out->
printf(
L"\"%s\"",value);
301ssize_t collection::writeJsonValue(
output *out,
char value) {
303 return out->
printf(
"%c",value);
305 return out->
printf(
"\"%c\"",value);
309ssize_t collection::writeJsonValue(
output *out,
wchar_t value) {
311 return out->
printf(
L"%c",value);
313 return out->
printf(
L"\"%c\"",value);
317ssize_t collection::writeJsonValue(
output *out,
bool value) {
318 return out->
printf(
"%s",(value)?
"true":
"false");
322ssize_t collection::writeJsonValue(
output *out, int16_t value) {
323 return out->
printf(
"%hd",value);
327ssize_t collection::writeJsonValue(
output *out, int32_t value) {
328 return out->
printf(
"%d",value);
332ssize_t collection::writeJsonValue(
output *out, int64_t value) {
333 #ifdef RUDIMENTS_HAVE_LONG_LONG
334 return out->
printf(
"%lld",(
long long)value);
336 return out->
printf(
"%ld",(
long)value);
341ssize_t collection::writeJsonValue(
output *out,
const byte_t *value) {
343 return out->
write(
"null");
345 return out->
printf(
"%s",value);
347 return out->
printf(
"\"%s\"",value);
351ssize_t collection::writeJsonValue(
output *out, byte_t *value) {
353 return out->
write(
"null");
355 return out->
printf(
"%s",value);
357 return out->
printf(
"\"%s\"",value);
361ssize_t collection::writeJsonValue(
output *out, byte_t value) {
363 return out->
printf(
"%c",value);
365 return out->
printf(
"\"%c\"",value);
369ssize_t collection::writeJsonValue(
output *out, uint16_t value) {
370 return out->
printf(
"%hd",value);
374ssize_t collection::writeJsonValue(
output *out, uint32_t value) {
375 return out->
printf(
"%d",value);
379ssize_t collection::writeJsonValue(
output *out, uint64_t value) {
380 #ifdef RUDIMENTS_HAVE_LONG_LONG
381 return out->
printf(
"%lld",(
long long)value);
383 return out->
printf(
"%ld",(
long)value);
388ssize_t collection::writeJsonValue(
output *out,
float value) {
389 return out->
printf(
"%f",value);
393ssize_t collection::writeJsonValue(
output *out,
double value) {
394 return out->
printf(
"%f",value);
398ssize_t collection::writeJsonValue(
output *out,
long double value) {
399 return out->
printf(
"%Lf",value);
403ssize_t collection::writeJsonValue(
output *out,
const void *value) {
405 return out->
write(
"null");
407 return out->
printf(
"\"%08x\"",value);
411ssize_t collection::writeJsonValue(
output *out,
void *value) {
413 return out->
write(
"null");
415 return out->
printf(
"\"%08x\"",value);
419ssize_t collection::writeJsonValue(
output *out,
const object *value) {
421 return out->
write(
"null");
425 return out->
printf(
"\"%08x\"",(
const void *)value);
429ssize_t collection::writeJsonValue(
output *out,
object *value) {
431 return out->
write(
"null");
435 return out->
printf(
"\"%08x\"",(
const void *)value);
438template <
class valuetype>
440ssize_t collection::writeJsonValue(
output *out,
const valuetype &value) {
443 return out->
printf(
"\"%08x\"",(
const void *)&value);
static bool isDigit(int32_t c)
static bool isNumber(const char *val)
Definition collection.h:11
virtual ~collection()
Definition collectioninlines.h:44
void setComparator(comparator *newcomp)
Definition collectioninlines.h:53
virtual bool getManageArrayValues()
Definition collectioninlines.h:99
collection & operator=(collection &c)
Definition collectioninlines.h:30
virtual bool getManageArrayKeys()
Definition collectioninlines.h:121
virtual bool isReadOnly()
Definition collectioninlines.h:68
virtual void setManageArrayValues(bool manage)
Definition collectioninlines.h:93
virtual void setManageValues(bool manage)
Definition collectioninlines.h:62
virtual void setManageKeys(bool manage)
Definition collectioninlines.h:104
virtual void setManageArrayKeys(bool manage)
Definition collectioninlines.h:115
virtual bool getManageValues()
Definition collectioninlines.h:88
virtual bool getManageKeys()
Definition collectioninlines.h:110
virtual uint64_t getBlockSize()
Definition collectioninlines.h:78
collection()
Definition collectioninlines.h:9
comparator * getComparator()
Definition collectioninlines.h:48
virtual bool isSequentialAccess()
Definition collectioninlines.h:83
virtual bool isBlockBased()
Definition collectioninlines.h:73
Definition comparator.h:11
virtual ssize_t printf(const char *format,...)
Definition outputinlines.h:25
virtual ssize_t write(const byte_t *string, size_t size)=0
static bool isNumber(const wchar_t *val)