10 #ifndef __SERIALIZABLE_JSON_FILE_H__
11 #define __SERIALIZABLE_JSON_FILE_H__
21 #define STR_KEY_TYPE "type"
22 #define STR_KEY_DATA "data"
23 #define STR_KEY_INSTANCE_NAME "instance_name"
24 #define STR_KEY_INSTANCE "instance"
25 #define STR_KEY_GENERIC_NAME "generic_name"
26 #define STR_KEY_SPARSE_FEATURES "features"
27 #define STR_KEY_SPARSE_FEATINDEX "feat_index"
28 #define STR_KEY_SPARSE_ENTRY "entry"
32 #define IGNORE_IN_CLASSLIST
34 :
public CSerializableFile
36 friend class SerializableJsonReader00;
38 DynArray<json_object*> m_stack_stream;
40 void init(
const char* fname);
41 void push_object(json_object* o);
44 static bool get_object_any(json_object** dest, json_object* src,
46 static bool get_object(json_object** dest, json_object* src,
47 const char* key, json_type t);
50 virtual TSerializableReader* new_reader(
51 char* dest_version,
size_t n);
53 virtual bool write_scalar_wrapped(
54 const TSGDataType* type,
const void* param);
56 virtual bool write_cont_begin_wrapped(
57 const TSGDataType* type,
index_t len_real_y,
59 virtual bool write_cont_end_wrapped(
60 const TSGDataType* type,
index_t len_real_y,
63 virtual bool write_string_begin_wrapped(
64 const TSGDataType* type,
index_t length);
65 virtual bool write_string_end_wrapped(
66 const TSGDataType* type,
index_t length);
68 virtual bool write_stringentry_begin_wrapped(
69 const TSGDataType* type,
index_t y);
70 virtual bool write_stringentry_end_wrapped(
71 const TSGDataType* type,
index_t y);
73 virtual bool write_sparse_begin_wrapped(
74 const TSGDataType* type,
index_t length);
75 virtual bool write_sparse_end_wrapped(
76 const TSGDataType* type,
index_t length);
78 virtual bool write_sparseentry_begin_wrapped(
79 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
81 virtual bool write_sparseentry_end_wrapped(
82 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
85 virtual bool write_item_begin_wrapped(
87 virtual bool write_item_end_wrapped(
90 virtual bool write_sgserializable_begin_wrapped(
91 const TSGDataType* type,
const char* sgserializable_name,
92 EPrimitiveType
generic);
93 virtual bool write_sgserializable_end_wrapped(
94 const TSGDataType* type,
const char* sgserializable_name,
95 EPrimitiveType
generic);
97 virtual bool write_type_begin_wrapped(
98 const TSGDataType* type,
const char* name,
100 virtual bool write_type_end_wrapped(
101 const TSGDataType* type,
const char* name,
106 explicit CSerializableJsonFile();
113 explicit CSerializableJsonFile(
const char* fname,
char rw=
'r');
116 virtual ~CSerializableJsonFile();
119 virtual const char* get_name()
const {
120 return "SerializableJsonFile";
123 virtual void close();
124 virtual bool is_opened();