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_VECINDEX "vec_index"
27 #define STR_KEY_SPARSE_FEATURES "features"
28 #define STR_KEY_SPARSE_FEATINDEX "feat_index"
29 #define STR_KEY_SPARSE_ENTRY "entry"
33 #define IGNORE_IN_CLASSLIST
35 :
public CSerializableFile
37 friend class SerializableJsonReader00;
39 DynArray<json_object*> m_stack_stream;
41 void init(
const char* fname);
42 void push_object(json_object* o);
45 static bool get_object_any(json_object** dest, json_object* src,
47 static bool get_object(json_object** dest, json_object* src,
48 const char* key, json_type t);
51 virtual TSerializableReader* new_reader(
52 char* dest_version,
size_t n);
54 virtual bool write_scalar_wrapped(
55 const TSGDataType* type,
const void* param);
57 virtual bool write_cont_begin_wrapped(
58 const TSGDataType* type,
index_t len_real_y,
60 virtual bool write_cont_end_wrapped(
61 const TSGDataType* type,
index_t len_real_y,
64 virtual bool write_string_begin_wrapped(
65 const TSGDataType* type,
index_t length);
66 virtual bool write_string_end_wrapped(
67 const TSGDataType* type,
index_t length);
69 virtual bool write_stringentry_begin_wrapped(
70 const TSGDataType* type,
index_t y);
71 virtual bool write_stringentry_end_wrapped(
72 const TSGDataType* type,
index_t y);
74 virtual bool write_sparse_begin_wrapped(
75 const TSGDataType* type,
index_t vec_index,
77 virtual bool write_sparse_end_wrapped(
78 const TSGDataType* type,
index_t vec_index,
81 virtual bool write_sparseentry_begin_wrapped(
82 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
84 virtual bool write_sparseentry_end_wrapped(
85 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
88 virtual bool write_item_begin_wrapped(
90 virtual bool write_item_end_wrapped(
93 virtual bool write_sgserializable_begin_wrapped(
94 const TSGDataType* type,
const char* sgserializable_name,
95 EPrimitiveType
generic);
96 virtual bool write_sgserializable_end_wrapped(
97 const TSGDataType* type,
const char* sgserializable_name,
98 EPrimitiveType
generic);
100 virtual bool write_type_begin_wrapped(
101 const TSGDataType* type,
const char* name,
103 virtual bool write_type_end_wrapped(
104 const TSGDataType* type,
const char* name,
109 explicit CSerializableJsonFile();
116 explicit CSerializableJsonFile(
const char* fname,
char rw=
'r');
119 virtual ~CSerializableJsonFile();
122 inline virtual const char* get_name()
const {
123 return "SerializableJsonFile";
126 virtual void close();
127 virtual bool is_opened();