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_FEATINDEX "feat_index"
37 class CSerializableXmlFile
38 :
public CSerializableFile
40 friend class SerializableXmlReader00;
42 DynArray<xmlNode*> m_stack_stream;
46 void init(
bool format);
47 bool push_node(
const xmlChar* name);
48 bool join_node(
const xmlChar* name);
49 bool next_node(
const xmlChar* name);
53 virtual TSerializableReader* new_reader(
54 char* dest_version,
size_t n);
56 virtual bool write_scalar_wrapped(
57 const TSGDataType* type,
const void* param);
59 virtual bool write_cont_begin_wrapped(
60 const TSGDataType* type,
index_t len_real_y,
62 virtual bool write_cont_end_wrapped(
63 const TSGDataType* type,
index_t len_real_y,
66 virtual bool write_string_begin_wrapped(
67 const TSGDataType* type,
index_t length);
68 virtual bool write_string_end_wrapped(
69 const TSGDataType* type,
index_t length);
71 virtual bool write_stringentry_begin_wrapped(
72 const TSGDataType* type,
index_t y);
73 virtual bool write_stringentry_end_wrapped(
74 const TSGDataType* type,
index_t y);
76 virtual bool write_sparse_begin_wrapped(
77 const TSGDataType* type,
index_t length);
78 virtual bool write_sparse_end_wrapped(
79 const TSGDataType* type,
index_t length);
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 CSerializableXmlFile();
117 explicit CSerializableXmlFile(
const char* fname,
char rw=
'r',
121 virtual ~CSerializableXmlFile();
124 inline virtual const char* get_name()
const {
125 return "SerializableXmlFile";
128 virtual void close();
129 virtual bool is_opened();