Rudiments
scalarcollectioninlines.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4template <class valuetype>
5inline
7 return "scalar";
8}
9template <class valuetype>
10inline
14
15template <class valuetype>
16inline
18 return write(&stdoutput);
19}
20
21template <class valuetype>
22inline
24 return writeJson(out,true);
25}
26
27template< class valuetype >
28inline
30 return writeJson(&stdoutput,true);
31}
32
33template< class valuetype >
34inline
36 return writeJson(&stdoutput,indent);
37}
38
39template< class valuetype >
40inline
42 return writeJson(out,true);
43}
44
45template< class valuetype >
46inline
48 ssize_t retval=0;
49 incOrErr(&retval,out->write('{'),1) &&
50 ((indent)?incOrErr(&retval,out->write("\n ",2),2):true) &&
51 incOrErr(&retval,out->write("\"v\":",4),4) &&
52 ((indent)?incOrErr(&retval,out->write(' '),1):true) &&
53 incOrErr(&retval,this->writeJsonValue(out,getValue())) &&
54 ((indent)?incOrErr(&retval,out->write('\n'),1):true) &&
55 incOrErr(&retval,out->write('}'),1) &&
56 ((indent)?incOrErr(&retval,out->write('\n'),1):true);
57 return retval;
58}
Definition avltree.h:11
avltreenode(valuetype value)
Definition avltreeinlines.h:555
valuetype getValue()
Definition avltreeinlines.h:578
Definition output.h:11
virtual ssize_t write(const byte_t *string, size_t size)=0
virtual ssize_t write()
Definition scalarcollectioninlines.h:17
virtual uint64_t getCount()
Definition scalarcollectioninlines.h:11
virtual const char * getType()
Definition scalarcollectioninlines.h:6
virtual ssize_t writeJson()
Definition scalarcollectioninlines.h:29