PVData C++
8.0.9
Toggle main menu visibility
Loading...
Searching...
No Matches
json
pv
json.h
1
/*
2
* Copyright information and license terms for this software can be
3
* found in the file LICENSE that is included with the distribution
4
*/
5
#ifndef PV_JSON_H
6
#define PV_JSON_H
7
8
#include <
istream
>
9
#include <
ostream
>
10
#include <
string
>
11
#include <
map
>
12
13
#include <pv/pvdVersion.h>
14
#include <pv/pvData.h>
15
16
#ifdef epicsExportSharedSymbols
17
# define pvjson_epicsExportSharedSymbols
18
# undef epicsExportSharedSymbols
19
#endif
20
21
#include <yajl_parse.h>
22
23
#ifdef pvjson_epicsExportSharedSymbols
24
# define epicsExportSharedSymbols
25
# include "shareLib.h"
26
#endif
27
28
#include <shareLib.h>
29
30
namespace
epics
{
namespace
pvData
{
31
32
class
BitSet
;
33
40
42
struct
epicsShareClass JSONPrintOptions
43
{
44
bool
multiLine
;
45
bool
ignoreUnprintable
;
46
unsigned
indent
;
47
bool
json5
;
48
JSONPrintOptions();
49
};
50
56
epicsShareFunc
57
void
printJSON
(
std::ostream
& strm,
58
const
PVStructure
& val,
59
const
BitSet
& mask,
60
const
JSONPrintOptions
& opts =
JSONPrintOptions
());
61
65
epicsShareFunc
66
void
printJSON
(
std::ostream
& strm,
67
const
PVField
& val,
68
const
JSONPrintOptions
& opts =
JSONPrintOptions
());
69
70
// To be deprecated in favor of previous form
71
FORCE_INLINE
72
void
printJSON
(
std::ostream
& strm,
73
const
PVField::const_shared_pointer& val,
74
const
JSONPrintOptions
& opts =
JSONPrintOptions
())
75
{
76
printJSON
(strm, *val, opts);
77
}
78
87
epicsShareFunc
88
PVStructure::shared_pointer
parseJSON
(
std::istream
& strm);
89
103
epicsShareFunc
104
void
parseJSON
(
std::istream
& strm,
105
PVField
& dest,
106
BitSet
*assigned=0);
107
108
// To be deprecated in favor of previous form
109
FORCE_INLINE
110
void
parseJSON
(
std::istream
& strm,
111
const
PVField::shared_pointer& dest,
112
BitSet
*assigned=0)
113
{
114
parseJSON
(strm, *dest, assigned);
115
}
116
117
130
epicsShareFunc
131
bool
yajl_parse_helper
(
std::istream
& src,
132
yajl_handle handle);
133
134
namespace
yajl {
135
// undef implies API version 0
136
#ifndef EPICS_YAJL_VERSION
137
typedef
long
integer_arg;
138
typedef
unsigned
size_arg;
139
#else
140
typedef
long
long
integer_arg;
141
typedef
size_t
size_arg;
142
#endif
143
}
// namespace epics::pvData::yajl
144
146
147
}}
// namespace epics::pvData
148
149
#endif
// PV_JSON_H
istream
map
ostream
string
std::ostream
basic_ostream< char > ostream
std::istream
basic_istream< char > istream
epics::pvData::BitSet
A vector of bits.
Definition
bitSet.h:56
epics::pvData::PVField
PVField is the base class for each PVData field.
Definition
pvData.h:155
epics::pvData::PVStructure
Data interface for a structure,.
Definition
pvData.h:713
epics::pvData::printJSON
void printJSON(std::ostream &strm, const PVStructure &val, const BitSet &mask, const JSONPrintOptions &opts=JSONPrintOptions())
epics::pvData::yajl_parse_helper
bool yajl_parse_helper(std::istream &src, yajl_handle handle)
epics::pvData::parseJSON
PVStructure::shared_pointer parseJSON(std::istream &strm)
epics::pvData
pvData
Definition
convert.h:21
epics
epics
Definition
convert.h:21
epics::pvData::JSONPrintOptions
Options used during printing.
Definition
json.h:43
epics::pvData::JSONPrintOptions::indent
unsigned indent
Initial indentation (# of spaces).
Definition
json.h:46
epics::pvData::JSONPrintOptions::json5
bool json5
Output extended JSON (eg. NaN).
Definition
json.h:47
epics::pvData::JSONPrintOptions::ignoreUnprintable
bool ignoreUnprintable
ignore union/union array when encountered
Definition
json.h:45
epics::pvData::JSONPrintOptions::multiLine
bool multiLine
include new lines
Definition
json.h:44
Generated on
for PVData C++ by
1.17.0