00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _terimber_xmlaccess_h_
00029 #define _terimber_xmlaccess_h_
00030
00031 #include "xmltypes.h"
00032
00035 class xml_designer
00036 {
00037 public:
00039 virtual
00040 ~xml_designer()
00041 {
00042 }
00051
00052 virtual
00053 bool
00054 load( const char* name,
00055 const char* grammar
00056 ) = 0;
00059 virtual
00060 bool
00061 load( const void* buffer,
00062 size_t length,
00063 const char* grammar
00064 ) = 0;
00067 virtual
00068 bool
00069 load( const char* name,
00070 const void* grammar,
00071 size_t grammar_length
00072 ) = 0;
00075 virtual
00076 bool
00077 load( const void* buffer,
00078 size_t length,
00079 const void* grammar,
00080 size_t grammar_length
00081 ) = 0;
00083 virtual
00084 const char*
00085 error() const = 0;
00087 virtual
00088 void
00089 select_document() const = 0;
00091 virtual
00092 bool
00093 select_root() const = 0;
00095 virtual
00096 bool
00097 has_children() const = 0;
00099 virtual
00100 bool
00101 select_first_child() const = 0;
00103 virtual
00104 bool
00105 select_last_child() const = 0;
00107 virtual
00108 bool
00109 select_parent() const = 0;
00112 virtual
00113 bool
00114 has_attributes() const = 0;
00116 virtual
00117 bool
00118 select_first_attribute() const = 0;
00120 virtual
00121 bool
00122 select_last_attribute() const = 0;
00124 virtual
00125 bool
00126 select_attribute_by_name(const char* name
00127 ) const = 0;
00130 virtual
00131 bool
00132 select_next_sibling() const = 0;
00135 virtual
00136 bool
00137 select_prev_sibling() const = 0;
00140 virtual
00141 xmlNodeType
00142 get_type() const = 0;
00148 virtual
00149 const char*
00150 get_name() const = 0;
00158 virtual
00159 const char*
00160 get_value() const = 0;
00164 virtual
00165 const char*
00166 get_xpath() const = 0;
00168 virtual
00169 bool
00170 select_xpath( const char* path
00171 ) const = 0;
00174 virtual
00175 bool
00176 save( const char* name,
00177 bool add_doc_type
00178 ) const = 0;
00182 virtual
00183 bool
00184 save( void* buffer,
00185 size_t& length,
00186 bool add_doc_type
00187 ) const = 0;
00193 virtual
00194 bool
00195 add_child( xmlNodeType type,
00196 const char* name,
00197 const char* value,
00198 bool dont_move
00199 ) = 0;
00201 virtual
00202 bool
00203 insert_sibling( xmlNodeType type,
00204 const char* name,
00205 const char* value,
00206 bool dont_move
00207 ) = 0;
00209 virtual
00210 bool
00211 append_sibling( xmlNodeType type,
00212 const char* name,
00213 const char* value,
00214 bool dont_move
00215 ) = 0;
00217 virtual
00218 bool
00219 remove_node() = 0;
00224 virtual
00225 bool
00226 update_value( const char* value
00227 ) = 0;
00228
00230
00231 virtual
00232 bool merge( const xml_designer* x,
00233 bool recursive
00234 ) = 0;
00236 virtual
00237 bool
00238 validate( bool recursive
00239 ) = 0;
00240 };
00241
00244 class xml_factory
00245 {
00246 public:
00248 xml_factory();
00250 virtual
00251 ~xml_factory();
00253 virtual
00254 xml_designer*
00255 get_xml_designer(size_t xml_size = 1024
00256 );
00257 };
00258
00259 #endif // _terimber_xmlaccess_h_
00260
00261