10 #ifndef __SERIALIZABLE_XML_FILE_H__
11 #define __SERIALIZABLE_XML_FILE_H__
19 #include <libxml/parser.h>
20 #include <libxml/tree.h>
22 #define STR_TRUE "true"
23 #define STR_FALSE "false"
26 #define STR_STRING "s"
27 #define STR_SPARSE "r"
29 #define STR_PROP_TYPE "type"
30 #define STR_PROP_IS_NULL "is_null"
31 #define STR_PROP_INSTANCE_NAME "instance_name"
32 #define STR_PROP_GENERIC_NAME "generic_name"
33 #define STR_PROP_VECINDEX "vec_index"
34 #define STR_PROP_FEATINDEX "feat_index"
38 class CSerializableXmlFile
39 :
public CSerializableFile
41 friend class SerializableXmlReader00;
43 DynArray<xmlNode*> m_stack_stream;
47 void init(
bool format);
48 bool push_node(
const xmlChar* name);
49 bool join_node(
const xmlChar* name);
50 bool next_node(
const xmlChar* name);
54 virtual TSerializableReader* new_reader(
55 char* dest_version,
size_t n);
57 virtual bool write_scalar_wrapped(
58 const TSGDataType* type,
const void* param);
60 virtual bool write_cont_begin_wrapped(
61 const TSGDataType* type,
index_t len_real_y,
63 virtual bool write_cont_end_wrapped(
64 const TSGDataType* type,
index_t len_real_y,
67 virtual bool write_string_begin_wrapped(
68 const TSGDataType* type,
index_t length);
69 virtual bool write_string_end_wrapped(
70 const TSGDataType* type,
index_t length);
72 virtual bool write_stringentry_begin_wrapped(
73 const TSGDataType* type,
index_t y);
74 virtual bool write_stringentry_end_wrapped(
75 const TSGDataType* type,
index_t y);
77 virtual bool write_sparse_begin_wrapped(
78 const TSGDataType* type,
index_t vec_index,
80 virtual bool write_sparse_end_wrapped(
81 const TSGDataType* type,
index_t vec_index,
84 virtual bool write_sparseentry_begin_wrapped(
85 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
87 virtual bool write_sparseentry_end_wrapped(
88 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
91 virtual bool write_item_begin_wrapped(
93 virtual bool write_item_end_wrapped(
96 virtual bool write_sgserializable_begin_wrapped(
97 const TSGDataType* type,
const char* sgserializable_name,
98 EPrimitiveType
generic);
99 virtual bool write_sgserializable_end_wrapped(
100 const TSGDataType* type,
const char* sgserializable_name,
101 EPrimitiveType
generic);
103 virtual bool write_type_begin_wrapped(
104 const TSGDataType* type,
const char* name,
106 virtual bool write_type_end_wrapped(
107 const TSGDataType* type,
const char* name,
112 explicit CSerializableXmlFile();
120 explicit CSerializableXmlFile(
const char* fname,
char rw=
'r',
124 virtual ~CSerializableXmlFile();
127 inline virtual const char* get_name()
const {
128 return "SerializableXmlFile";
131 virtual void close();
132 virtual bool is_opened();