Free Electron
JsonWriter.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __json_JsonWriter_h__
8 #define __json_JsonWriter_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 namespace data
15 {
16 
17 /**************************************************************************//**
18  @brief Stream generator for writing JSON files
19 
20  @ingroup json
21 *//***************************************************************************/
22 class FE_DL_EXPORT JsonWriter : public fe::data::AsciiWriter
23 {
24  public:
25  JsonWriter(sp<Scope> spScope);
26 virtual ~JsonWriter(void);
27 virtual void output(std::ostream &a_ostrm, sp<RecordGroup> spRG);
28 
29  private:
30 
31 virtual void write(std::ostream &a_ostrm, Record r_out, int a_sb_id);
32 virtual void write(std::ostream &a_ostrm, sp<RecordGroup> spRG, int a_id);
33 virtual void write(std::ostream &a_ostrm, sp<RecordArray> spRA, int a_id);
34 virtual void write(std::ostream &a_ostrm, sp<Layout> spLayout, int a_id);
35 virtual void write(std::ostream &a_ostrm, sp<Attribute> spAttribute);
36 
37  sp<JsonValue> m_spJsonRoot;
38 
39  Json::Value m_jsonAttributes;
40  Json::Value m_jsonLayouts;
41  Json::Value m_jsonRecords;
42  Json::Value m_jsonRecordGroups;
43  Json::Value m_jsonRecordArrays;
44 };
45 
46 } /* namespace ext */
47 } /* namespace fe */
48 
49 } /* namespace */
50 
51 #endif /* __json_JsonWriter_h__ */
52 
kernel
Definition: namespace.dox:3
Represents a JSON value.
Definition: value.h:194
Stream generator for writing JSON files.
Definition: JsonWriter.h:22
Reference to an instance of a Layout.
Definition: RecordSB.h:35