This is Unofficial EPICS BASE Doxygen Site
json.h
Go to the documentation of this file.
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 
41 struct epicsShareClass JSONPrintOptions
43 {
44  bool multiLine;
46  unsigned indent;
48 };
49 
56 void printJSON(std::ostream& strm,
57  const PVStructure& val,
58  const BitSet& mask,
59  const JSONPrintOptions& opts = JSONPrintOptions());
60 
65 void printJSON(std::ostream& strm,
66  const PVField& val,
67  const JSONPrintOptions& opts = JSONPrintOptions());
68 
69 // To be deprecated in favor of previous form
71 void printJSON(std::ostream& strm,
72  const PVField::const_shared_pointer& val,
73  const JSONPrintOptions& opts = JSONPrintOptions())
74 {
75  printJSON(strm, *val, opts);
76 }
77 
87 PVStructure::shared_pointer parseJSON(std::istream& strm);
88 
103 void parseJSON(std::istream& strm,
104  PVField& dest,
105  BitSet *assigned=0);
106 
107 // To be deprecated in favor of previous form
109 void parseJSON(std::istream& strm,
110  const PVField::shared_pointer& dest,
111  BitSet *assigned=0)
112 {
113  parseJSON(strm, *dest, assigned);
114 }
115 
116 
130 bool yajl_parse_helper(std::istream& src,
131  yajl_handle handle);
132 
133 namespace yajl {
134 // undef implies API version 0
135 #ifndef EPICS_YAJL_VERSION
136 typedef long integer_arg;
137 typedef unsigned size_arg;
138 #else
139 typedef long long integer_arg;
140 typedef size_t size_arg;
141 #endif
142 } // namespace epics::pvData::yajl
143 
146 }} // namespace epics::pvData
147 
148 #endif // PV_JSON_H
bool ignoreUnprintable
ignore union/union array when encountered
Definition: json.h:45
#define epicsShareFunc
Definition: shareLib.h:209
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
Options used during printing.
Definition: json.h:42
A vector of bits.
Definition: bitSet.h:56
Mark external symbols and entry points for shared libraries.
PVField is the base class for each PVData field.
Definition: pvData.h:152
unsigned size_arg
Definition: json.h:137
unsigned indent
Initial indentation (# of spaces)
Definition: json.h:46
Interface to YAJL&#39;s JSON stream parsing facilities.
#define epicsShareClass
Definition: shareLib.h:206
epics::pvData::PVStructure::shared_pointer parseJSON(std::istream &strm)
Definition: parseany.cpp:255
void printJSON(std::ostream &strm, const PVStructure &val, const BitSet &mask, const JSONPrintOptions &opts)
Definition: print.cpp:211
Data interface for a structure,.
Definition: pvData.h:712
long integer_arg
Definition: json.h:136
bool yajl_parse_helper(std::istream &src, yajl_handle handle)
Definition: parsehelper.cpp:29
#define FORCE_INLINE
Definition: templateMeta.h:20
bool multiLine
include new lines
Definition: json.h:44