10 #ifndef __SERIALIZABLE_XML_FILE_H__
11 #define __SERIALIZABLE_XML_FILE_H__
20 #include <libxml/parser.h>
21 #include <libxml/tree.h>
23 #define STR_TRUE "true"
24 #define STR_FALSE "false"
27 #define STR_STRING "s"
28 #define STR_SPARSE "r"
30 #define STR_PROP_TYPE "type"
31 #define STR_PROP_IS_NULL "is_null"
32 #define STR_PROP_INSTANCE_NAME "instance_name"
33 #define STR_PROP_GENERIC_NAME "generic_name"
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 length);
79 virtual bool write_sparse_end_wrapped(
80 const TSGDataType* type,
index_t length);
82 virtual bool write_sparseentry_begin_wrapped(
83 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
85 virtual bool write_sparseentry_end_wrapped(
86 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
89 virtual bool write_item_begin_wrapped(
91 virtual bool write_item_end_wrapped(
94 virtual bool write_sgserializable_begin_wrapped(
95 const TSGDataType* type,
const char* sgserializable_name,
96 EPrimitiveType
generic);
97 virtual bool write_sgserializable_end_wrapped(
98 const TSGDataType* type,
const char* sgserializable_name,
99 EPrimitiveType
generic);
101 virtual bool write_type_begin_wrapped(
102 const TSGDataType* type,
const char* name,
104 virtual bool write_type_end_wrapped(
105 const TSGDataType* type,
const char* name,
110 explicit CSerializableXmlFile();
118 explicit CSerializableXmlFile(
const char* fname,
char rw=
'r',
122 virtual ~CSerializableXmlFile();
125 virtual const char* get_name()
const {
126 return "SerializableXmlFile";
129 virtual void close();
130 virtual bool is_opened();
all of classes and functions are contained in the shogun namespace