10 #ifndef __SERIALIZABLE_JSON_FILE_H__
11 #define __SERIALIZABLE_JSON_FILE_H__
22 #define STR_KEY_TYPE "type"
23 #define STR_KEY_DATA "data"
24 #define STR_KEY_INSTANCE_NAME "instance_name"
25 #define STR_KEY_INSTANCE "instance"
26 #define STR_KEY_GENERIC_NAME "generic_name"
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 length);
76 virtual bool write_sparse_end_wrapped(
77 const TSGDataType* type,
index_t length);
79 virtual bool write_sparseentry_begin_wrapped(
80 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
82 virtual bool write_sparseentry_end_wrapped(
83 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
86 virtual bool write_item_begin_wrapped(
88 virtual bool write_item_end_wrapped(
91 virtual bool write_sgserializable_begin_wrapped(
92 const TSGDataType* type,
const char* sgserializable_name,
93 EPrimitiveType
generic);
94 virtual bool write_sgserializable_end_wrapped(
95 const TSGDataType* type,
const char* sgserializable_name,
96 EPrimitiveType
generic);
98 virtual bool write_type_begin_wrapped(
99 const TSGDataType* type,
const char* name,
101 virtual bool write_type_end_wrapped(
102 const TSGDataType* type,
const char* name,
107 explicit CSerializableJsonFile();
114 explicit CSerializableJsonFile(
const char* fname,
char rw=
'r');
117 virtual ~CSerializableJsonFile();
120 virtual const char* get_name()
const {
121 return "SerializableJsonFile";
124 virtual void close();
125 virtual bool is_opened();
all of classes and functions are contained in the shogun namespace
#define IGNORE_IN_CLASSLIST