g4tools  5.4.0
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
tools::xml::loader Class Reference
Inheritance diagram for tools::xml::loader:
Inheritance graph
[legend]
Collaboration diagram for tools::xml::loader:
Collaboration graph
[legend]

Public Member Functions

 loader (tools::xml::factory &a_factory, std::ostream &a_out, bool a_verbose=false)
 
virtual ~loader ()
 
virtual bool visit_end_element (tools::xml::tree &, bool &a_keep)
 
void set_take_cntrl_chars (bool a_value)
 
std::ostream & out () const
 
void set_compressed_reader (tools::file::reader *aReader)
 
unsigned int errors () const
 
void set_tags (const std::vector< std::string > &a_tags)
 
void add_tag (const std::string &a_tag)
 
bool load_file (const std::string &a_file, bool a_compressed)
 
bool load_string (const std::string &a_string)
 
bool load_buffer (size_t aSize, const char *aBuffer)
 
const tools::xml::treetop_item () const
 
tools::xml::treetop_item ()
 
void empty ()
 
bool is_tag (const std::string &a_string) const
 

Protected Member Functions

 loader (const loader &a_from)
 
loaderoperator= (const loader &a_from)
 
void clear ()
 
bool parse_buffer (size_t aSize, const char *aBuffer, XML_StartElementHandler a_start, XML_EndElementHandler a_end, void *a_tag)
 
bool parse_file (const std::string &a_file, XML_StartElementHandler a_start, XML_EndElementHandler a_end, void *a_tag, bool a_compressed)
 

Static Protected Member Functions

static void character_data_handler (void *aUserData, const XML_Char *a_string, int aLength)
 
static void start_element (void *aUserData, const XML_Char *a_name, const XML_Char **a_atbs)
 
static void end_element (void *aUserData, const XML_Char *a_name)
 

Protected Attributes

tools::xml::factorym_factory
 
std::ostream & m_out
 
bool m_verbose
 
bool m_take_cntrl
 
unsigned int m_errors
 
std::vector< std::string > m_tags
 
tools::xml::treem_top
 
tools::xml::treem_current
 
std::vector< std::pair< std::string, std::string > > m_atbs
 
std::string m_value
 
tools::file::readerm_compressed_reader
 
unsigned int m_depth
 
bool m_abort
 

Detailed Description

Definition at line 42 of file loader.

Constructor & Destructor Documentation

◆ loader() [1/2]

tools::xml::loader::loader ( tools::xml::factory a_factory,
std::ostream &  a_out,
bool  a_verbose = false 
)
inline

Definition at line 47 of file loader.

49  :m_factory(a_factory)
50  ,m_out(a_out)
51  ,m_verbose(a_verbose)
52  ,m_take_cntrl(false)
53 
54  ,m_errors(0)
55  ,m_top(0) // Used to cleanup in case XML parsing failed.
56  ,m_current(0)
58  ,m_depth(0)
59  ,m_abort(false)
60  {
61 #ifdef TOOLS_MEM
62  tools::mem::increment(s_class().c_str());
63 #endif
64  }

◆ ~loader()

virtual tools::xml::loader::~loader ( )
inlinevirtual

Definition at line 66 of file loader.

66  {
67  delete m_compressed_reader;
68  clear();
69 #ifdef TOOLS_MEM
70  tools::mem::decrement(s_class().c_str());
71 #endif
72  }

◆ loader() [2/2]

tools::xml::loader::loader ( const loader a_from)
inlineprotected

Definition at line 75 of file loader.

76  :m_factory(a_from.m_factory)
77  ,m_out(a_from.m_out)
78  ,m_verbose(a_from.m_verbose)
79  ,m_take_cntrl(a_from.m_take_cntrl)
80 
81  ,m_errors(0)
82  ,m_top(0) // Used to cleanup in case XML parsing failed.
83  ,m_current(0)
85  ,m_depth(0)
86  ,m_abort(false)
87  {
88 #ifdef TOOLS_MEM
89  tools::mem::increment(s_class().c_str());
90 #endif
91  }

Member Function Documentation

◆ add_tag()

void tools::xml::loader::add_tag ( const std::string &  a_tag)
inline

Definition at line 126 of file loader.

126 {m_tags.push_back(a_tag);}

◆ character_data_handler()

static void tools::xml::loader::character_data_handler ( void *  aUserData,
const XML_Char *  a_string,
int  aLength 
)
inlinestaticprotected

Definition at line 355 of file loader.

355  {
356  loader* This = (loader*)aUserData;
357  std::string s;
358  s.resize(aLength);
359  size_t count = 0;
360  char* p = (char*)a_string;
361  for (int i = 0; i < aLength; i++, p++) {
362  if(This->m_take_cntrl || (!iscntrl(*p))) {
363  s[count] = *p;
364  count++;
365  }
366  }
367  if(count) {
368  s.resize(count);
369  This->m_value += s;
370  }
371  }

◆ clear()

void tools::xml::loader::clear ( )
inlineprotected

Definition at line 180 of file loader.

180  {
181  // In case of problem, deleting m_current is not sufficient.
182  delete m_top;
183  m_top = 0;
184  m_current = 0;
185  }

◆ empty()

void tools::xml::loader::empty ( )
inline

Definition at line 169 of file loader.

169 {m_top = 0;m_current = 0;}

◆ end_element()

static void tools::xml::loader::end_element ( void *  aUserData,
const XML_Char *  a_name 
)
inlinestaticprotected

Definition at line 490 of file loader.

490  {
491  loader* This = (loader*)aUserData;
492  if(This->m_abort) return; //Do nothing.
493 
494  if(This->m_current) {
495 
496  tools::xml::tree* tr = This->m_current;
497  int delta = This->m_depth - tr->depth();
498  if(delta==0) { //Back to a tag :
499 
500  tools::xml::tree* parent = tr->parent();
501 
502  bool keep = false;
503  bool cont = This->visit_end_element(*tr,keep);
504  if(keep) {
505  if(parent) {
506 /*
507  if(!This->m_current->parent()) {
508  This->m_out << "end_element :"
509  << " warning : current tree without parent (1)."
510  << " Potential mem leak."
511  << std::endl;
512  }
513 */
514  This->m_current = parent;
515  }
516  } else {
517  //FIXME : the top could be recreated !
518  if(This->m_top==tr) This->m_top = 0;
519 
520  if(parent) {
521  parent->remove_child(tr); //delete the tr
522  } else {
523  delete tr;
524  }
525 
526 /*
527  if(!This->m_current->parent()) {
528  This->m_out << "end_element :"
529  << " warning : current tree without parent (2)."
530  << " Potential mem leak."
531  << std::endl;
532  }
533 */
534 
535  This->m_current = parent; //parent could be 0 : ok.
536  }
537 
538  if(!cont) This->m_abort = true;
539 
540  } else if(delta==1) { //Back to a child of tag :
541 
542  //FIXME : correct m_value ? (Can we pick the one of a sub item ?)
543  tr->add_element(std::string(a_name),This->m_atbs,This->m_value);
544  //This->m_value = "";
545 
546  } else {
547 
548  This->m_out << "end_element :"
549  << " problem for element " << tools::sout(std::string(a_name))
550  << " : delta depth of " << delta
551  << std::endl;
552  This->m_abort = true;
553 
554  }
555 
556  }
557 
558 
559  This->m_depth--;
560  }

◆ errors()

unsigned int tools::xml::loader::errors ( ) const
inline

Definition at line 123 of file loader.

123 {return m_errors;}

◆ is_tag()

bool tools::xml::loader::is_tag ( const std::string &  a_string) const
inline

Definition at line 171 of file loader.

171  {
172  size_t number = m_tags.size();
173  for(size_t index=0;index<number;index++) {
174  if(a_string==m_tags[index]) return true;
175  }
176  return false;
177  }

◆ load_buffer()

bool tools::xml::loader::load_buffer ( size_t  aSize,
const char *  aBuffer 
)
inline

Definition at line 153 of file loader.

153  {
154  clear();
155  if(!parse_buffer(aSize,aBuffer,
156  (XML_StartElementHandler)start_element,
157  (XML_EndElementHandler)end_element,
158  this)) {
159  clear();
160  return false;
161  }
162  return true;
163  }

◆ load_file()

bool tools::xml::loader::load_file ( const std::string &  a_file,
bool  a_compressed 
)
inline

Definition at line 128 of file loader.

128  {
129  clear();
130  if(!parse_file(a_file,
131  (XML_StartElementHandler)start_element,
132  (XML_EndElementHandler)end_element,
133  this,a_compressed)) {
134  clear();
135  return false;
136  }
137  if(m_current) m_current->set_file(a_file);
138  return true;
139  }

◆ load_string()

bool tools::xml::loader::load_string ( const std::string &  a_string)
inline

Definition at line 141 of file loader.

141  {
142  clear();
143  if(!parse_buffer(a_string.size(),a_string.c_str(),
144  (XML_StartElementHandler)start_element,
145  (XML_EndElementHandler)end_element,
146  this)) {
147  clear();
148  return false;
149  }
150  return true;
151  }

◆ operator=()

loader& tools::xml::loader::operator= ( const loader a_from)
inlineprotected

Definition at line 92 of file loader.

92  {
93  if(&a_from==this) return *this;
94 
95  m_verbose = a_from.m_verbose;
96  m_take_cntrl = a_from.m_take_cntrl;
97 
98  m_errors = 0;
99  m_top = 0;
100  m_current = 0;
102  m_depth = 0;
103  m_abort = false;
104 
105  return *this;
106  }

◆ out()

std::ostream& tools::xml::loader::out ( ) const
inline

Definition at line 117 of file loader.

117 {return m_out;}

◆ parse_buffer()

bool tools::xml::loader::parse_buffer ( size_t  aSize,
const char *  aBuffer,
XML_StartElementHandler  a_start,
XML_EndElementHandler  a_end,
void *  a_tag 
)
inlineprotected

Definition at line 187 of file loader.

189  {
190  m_errors = 0;
191  if(!aSize) return true; //nothing to do.
192  m_depth = 0;
193  m_abort = false;
194 
195 #ifdef TOOLS_MEM
196  XML_Memory_Handling_Suite mem;
197  mem.malloc_fcn = xml_malloc;
198  mem.realloc_fcn = xml_realloc;
199  mem.free_fcn = xml_free;
200  XML_Parser _parser = XML_ParserCreate_MM(NULL,&mem,NULL);
201 #else
202  XML_Parser _parser = XML_ParserCreate(NULL);
203 #endif
204 
205  XML_SetUserData(_parser,a_tag);
206  XML_SetElementHandler(_parser,a_start,a_end);
207  XML_SetCharacterDataHandler(_parser,(XML_CharacterDataHandler)character_data_handler);
208  //XML_SetProcessingInstructionHandler(_parser,processingInstructionHandler);
209  char* buf = (char*)aBuffer;
210  size_t l = aSize;
211  int done = 0;
212  do {
213  size_t len = tools::mn<size_t>(l,BUFSIZ); //BUFSIZ in cstdio
214  done = len < BUFSIZ ? 1 : 0;
215  if(XML_Parse(_parser, buf, (int)len, done)==XML_STATUS_ERROR) {
216  m_out << "parse_buffer :"
217  << " " << XML_ErrorString(XML_GetErrorCode(_parser))
218  << " at line " << (int)XML_GetCurrentLineNumber(_parser)
219  << " at byte index " << (int)XML_GetCurrentByteIndex(_parser)
220  << std::endl;
221  {XML_Index pos = XML_GetCurrentByteIndex(_parser);
222  XML_Index pmn = tools::mx<XML_Index>(pos-10,0);
223  XML_Index pmx = tools::mn<XML_Index>(pos+10,XML_Index(aSize)-1);
224  std::string c = " ";
225  {for(XML_Index p=pmn;p<=pmx;p++) {c[0] = *(aBuffer+p);m_out << c;}
226  m_out << std::endl;}
227  {for(XML_Index p=pmn;p<pos;p++) m_out << " ";
228  m_out << "^" << std::endl;}}
229  XML_ParserFree(_parser);
230  return false;
231  }
232  if(m_abort) {
233  XML_ParserFree(_parser);
234  return false;
235  }
236  buf += len;
237  l -= len;
238  } while (!done);
239  XML_ParserFree(_parser);
240  return true;
241  }

◆ parse_file()

bool tools::xml::loader::parse_file ( const std::string &  a_file,
XML_StartElementHandler  a_start,
XML_EndElementHandler  a_end,
void *  a_tag,
bool  a_compressed 
)
inlineprotected

Definition at line 243 of file loader.

245  {
246  if(m_verbose) {
247  m_out << "parse_file :"
248  << " parse file " << tools::sout(a_file) << "..." << std::endl;
249  }
250  m_errors = 0;
251 
252  bool use_zlib = false;
253  if(a_compressed) {
254  if(m_verbose) {
255  m_out << "parse_file :"
256  << " uncompress requested for file "
257  << tools::sout(a_file) << "."
258  << std::endl;
259  }
260  use_zlib = true;
261  } else {
262  // may be compressed anyway :
263  bool compressed;
264  if(!tools::file::is_gzip(a_file,compressed)) {
265  m_out << "parse_file :"
266  << " tools::file::is_gzip() failed for " << a_file << "."
267  << std::endl;
268  return false;
269  }
270  if(compressed) use_zlib = true;
271  }
272 
273  tools::file::reader* freader = 0;
274  bool delete_freader = false;
275  if(use_zlib) {
276  if(!m_compressed_reader) {
277  m_out << "parse_file :"
278  << " no compressed reader given."
279  << std::endl;
280  return false;
281  }
282  freader = m_compressed_reader;
283  } else {
284  freader = new tools::FILE_reader();
285  delete_freader = true;
286  }
287  if(!freader->open(a_file)) {
288  m_out << "parse_file :"
289  << " can't open file " << a_file << std::endl;
290  if(delete_freader) delete freader;
291  return false;
292  }
293 
294  m_depth = 0;
295  m_abort = false;
296 
297 #ifdef TOOLS_MEM
298  XML_Memory_Handling_Suite mem;
299  mem.malloc_fcn = xml_malloc;
300  mem.realloc_fcn = xml_realloc;
301  mem.free_fcn = xml_free;
302  XML_Parser _parser = XML_ParserCreate_MM(NULL,&mem,NULL);
303 #else
304  XML_Parser _parser = XML_ParserCreate(NULL);
305 #endif
306 
307  XML_SetUserData(_parser,a_tag);
308  XML_SetElementHandler(_parser,a_start,a_end);
309  XML_SetCharacterDataHandler(_parser,(XML_CharacterDataHandler)character_data_handler);
310  //XML_SetProcessingInstructionHandler(_parser,
311  // processingInstructionHandler);
312 
313 
314  //char buf[1024 * BUFSIZ];
315  char buf[BUFSIZ];
316  int done = 0;
317  do {
318  size_t len;
319  if(!freader->read(buf,sizeof(buf),len)) {
320  XML_ParserFree(_parser);
321  freader->close();
322  if(delete_freader) delete freader;
323  return false;
324  }
325  done = len < sizeof(buf) ? 1 : 0;
326  if(XML_Parse(_parser, buf, (int)len, done)==XML_STATUS_ERROR) {
327  m_out << "parse_file :"
328  << " in file " << tools::sout(a_file)
329  << " " << XML_ErrorString(XML_GetErrorCode(_parser))
330  << " at line " << (int)XML_GetCurrentLineNumber(_parser)
331  << std::endl;
332  XML_ParserFree(_parser);
333  freader->close();
334  if(delete_freader) delete freader;
335  return false;
336  }
337  if(m_abort) {
338  XML_ParserFree(_parser);
339  freader->close();
340  if(delete_freader) delete freader;
341  return false;
342  }
343  } while (!done);
344  XML_ParserFree(_parser);
345  freader->close();
346  if(m_verbose) {
347  m_out << "parse_file :"
348  << " parse file " << tools::sout(a_file) << " done." << std::endl;
349  }
350  if(delete_freader) delete freader;
351  return true;
352  }

◆ set_compressed_reader()

void tools::xml::loader::set_compressed_reader ( tools::file::reader aReader)
inline

Definition at line 118 of file loader.

118  {
119  delete m_compressed_reader;
120  m_compressed_reader = aReader; //take ownership.
121  }

◆ set_tags()

void tools::xml::loader::set_tags ( const std::vector< std::string > &  a_tags)
inline

Definition at line 125 of file loader.

125 {m_tags=a_tags;}

◆ set_take_cntrl_chars()

void tools::xml::loader::set_take_cntrl_chars ( bool  a_value)
inline

Definition at line 115 of file loader.

115 {m_take_cntrl = a_value;}

◆ start_element()

static void tools::xml::loader::start_element ( void *  aUserData,
const XML_Char *  a_name,
const XML_Char **  a_atbs 
)
inlinestaticprotected

Definition at line 373 of file loader.

373  {
374  loader* This = (loader*)aUserData;
375  if(This->m_abort) return; //Do nothing.
376 
377  This->m_depth++;
378  This->m_value = "";
379 
380  std::string name = a_name; //Can't be empty
381  if(This->is_tag(name)) {
382 
383  if(!This->m_current) {
384  if(This->m_depth==1) {
385  // Ok. Head.
386  } else {
387  This->m_out << "start_element :"
388  << " no tag with a depth of " << This->m_depth
389  << std::endl;
390  This->m_abort = true;
391  return;
392  }
393  } else {
394  int delta = This->m_current->depth() - This->m_depth;
395  if(delta>=1) {
396  This->m_out << "start_element :"
397  << " for element " << tools::sout(name)
398  << " tag with a delta depth of " << delta
399  << std::endl;
400  This->m_abort = true;
401  return;
402  }
403  }
404 
405  std::vector<tools::xml::tree::atb> atbs;
406  {const XML_Char** a_atts = a_atbs;
407  while((*a_atts)&&(*(a_atts+1))) {
408  atbs.push_back(tools::xml::tree::atb(*a_atts,*(a_atts+1)));
409  a_atts+=2;
410  }}
411 
412  tools::xml::tree* parent = This->m_current;
413  tools::xml::tree* _tree = This->m_factory.create(name,atbs,parent);
414  if(!_tree) {
415  This->m_out << "start_element :"
416  << " can't create a tree for tag " << tools::sout(name)
417  << std::endl;
418  This->m_abort = true;
419  return;
420  }
421 
422  //out << "start_element :" << std::endl;
423  //_tree->print_xml(*(This->m_printer),"debug : ");
424 
425  if(parent) parent->add_child(_tree);
426 
427 /*
428  if(This->m_current && !This->m_current->parent()) {
429  This->m_out << "start_element :"
430  << " warning : current tree without parent."
431  << " Potential mem leak."
432  << std::endl;
433  }
434 */
435 
436  This->m_current = _tree;
437  _tree->set_depth(This->m_depth); // Internal only.
438 
439  if(!This->m_top) This->m_top = _tree;
440 
441  } else {
442 
443  if(!This->m_current) {
444 
445  // Can't be in a non-tag without a tag !
446  This->m_out << "start_element :"
447  << " for element " << tools::sout(name)
448  << " non-tag without some parent tag."
449  << std::endl;
450  This->m_abort = true;
451  return;
452 
453  } else {
454 
455  int delta = This->m_depth - This->m_current->depth();
456  if(delta>1) {
457 
458  This->m_out << "start_element :"
459  << " for element " << tools::sout(name)
460  << " grand child of a tag."
461  << std::endl;
462  This->m_abort = true;
463  return;
464 
465  } else if(delta==1) { //ok
466 
467  This->m_atbs.clear();
468  {const XML_Char** a_atts = a_atbs;
469  while((*a_atts)&&(*(a_atts+1))) {
470  This->m_atbs.push_back(tools::xml::tree::atb(*a_atts,*(a_atts+1)));
471  a_atts+=2;
472  }}
473 
474  } else {
475 
476  This->m_out << "start_element :"
477  << " for element " << tools::sout(name)
478  << " non-tag with a delta depth of " << delta
479  << std::endl;
480  This->m_abort = true;
481  return;
482 
483  }
484  }
485 
486  }
487  }

◆ top_item() [1/2]

tools::xml::tree* tools::xml::loader::top_item ( )
inline

Definition at line 167 of file loader.

167 {return m_current;}

◆ top_item() [2/2]

const tools::xml::tree* tools::xml::loader::top_item ( ) const
inline

Definition at line 165 of file loader.

165 {return m_current;}

◆ visit_end_element()

virtual bool tools::xml::loader::visit_end_element ( tools::xml::tree ,
bool &  a_keep 
)
inlinevirtual

Definition at line 109 of file loader.

109  {
110  a_keep = true;
111  return true;
112  }

Member Data Documentation

◆ m_abort

bool tools::xml::loader::m_abort
protected

Definition at line 577 of file loader.

◆ m_atbs

std::vector< std::pair<std::string,std::string> > tools::xml::loader::m_atbs
protected

Definition at line 573 of file loader.

◆ m_compressed_reader

tools::file::reader* tools::xml::loader::m_compressed_reader
protected

Definition at line 575 of file loader.

◆ m_current

tools::xml::tree* tools::xml::loader::m_current
protected

Definition at line 571 of file loader.

◆ m_depth

unsigned int tools::xml::loader::m_depth
protected

Definition at line 576 of file loader.

◆ m_errors

unsigned int tools::xml::loader::m_errors
protected

Definition at line 568 of file loader.

◆ m_factory

tools::xml::factory& tools::xml::loader::m_factory
protected

Definition at line 563 of file loader.

◆ m_out

std::ostream& tools::xml::loader::m_out
protected

Definition at line 564 of file loader.

◆ m_tags

std::vector<std::string> tools::xml::loader::m_tags
protected

Definition at line 569 of file loader.

◆ m_take_cntrl

bool tools::xml::loader::m_take_cntrl
protected

Definition at line 567 of file loader.

◆ m_top

tools::xml::tree* tools::xml::loader::m_top
protected

Definition at line 570 of file loader.

◆ m_value

std::string tools::xml::loader::m_value
protected

Definition at line 574 of file loader.

◆ m_verbose

bool tools::xml::loader::m_verbose
protected

Definition at line 566 of file loader.


The documentation for this class was generated from the following file:
tools::xml::loader::character_data_handler
static void character_data_handler(void *aUserData, const XML_Char *a_string, int aLength)
Definition: loader:355
tools::xml::loader::m_errors
unsigned int m_errors
Definition: loader:568
tools::xml::tree::add_element
void add_element(const std::string &a_name, const std::vector< atb > &a_atbs, const std::string &a_value)
elements //////////////////////////////////////////
Definition: tree:176
tools::file::is_gzip
bool is_gzip(const std::string &a_file, bool &a_is)
Definition: gzip:12
tools::xml::loader::end_element
static void end_element(void *aUserData, const XML_Char *a_name)
Definition: loader:490
tools::xml::tree::parent
tree * parent() const
end osc //////////////////////////////////////
Definition: tree:828
tools::file::reader
Definition: file_reader:13
tools::xml::loader::parse_buffer
bool parse_buffer(size_t aSize, const char *aBuffer, XML_StartElementHandler a_start, XML_EndElementHandler a_end, void *a_tag)
Definition: loader:187
tools::xml::loader::m_verbose
bool m_verbose
Definition: loader:566
tools::xml::tree::m_depth
int m_depth
Definition: tree:953
tools::file::reader::open
virtual bool open(const std::string &)=0
tools::xml::loader::m_abort
bool m_abort
Definition: loader:577
tools::xml::loader::m_out
std::ostream & m_out
Definition: loader:564
tools::xml::loader::clear
void clear()
Definition: loader:180
tools::xml::tree::add_child
void add_child(tree *a_tree)
Definition: tree:448
tools::xml::loader::m_tags
std::vector< std::string > m_tags
Definition: loader:569
tools::xml::loader::m_take_cntrl
bool m_take_cntrl
Definition: loader:567
tools::file::reader::close
virtual void close()=0
tools::xml::factory::create
virtual tree * create(const std::string &a_tag_name, const std::vector< atb > &a_atbs, tree *a_parent)=0
tools::xml::loader::m_factory
tools::xml::factory & m_factory
Definition: loader:563
tools::xml::loader::m_current
tools::xml::tree * m_current
Definition: loader:571
tools::xml::tree::set_file
void set_file(const std::string &a_file)
Definition: tree:915
tools::sout
Definition: sout:17
tools::xml::tree::m_factory
factory & m_factory
Definition: tree:942
tools::xml::loader::m_compressed_reader
tools::file::reader * m_compressed_reader
Definition: loader:575
tools::xml::tree::set_depth
void set_depth(unsigned int a_depth)
Definition: tree:911
tools::xml::tree
Definition: tree:47
tools::xml::loader::m_depth
unsigned int m_depth
Definition: loader:576
tools::file::reader::read
virtual bool read(char *, unsigned int, size_t &)=0
tools::xml::loader::start_element
static void start_element(void *aUserData, const XML_Char *a_name, const XML_Char **a_atbs)
Definition: loader:373
tools::xml::tree::remove_child
void remove_child(tree *&a_tree, bool a_delete=true)
Definition: tree:840
tools::xml::loader::m_top
tools::xml::tree * m_top
Definition: loader:570
tools::xml::tree::depth
unsigned int depth() const
Definition: tree:912
tools::xml::loader::loader
loader(tools::xml::factory &a_factory, std::ostream &a_out, bool a_verbose=false)
Definition: loader:47
tools::xml::loader::parse_file
bool parse_file(const std::string &a_file, XML_StartElementHandler a_start, XML_EndElementHandler a_end, void *a_tag, bool a_compressed)
Definition: loader:243
tools::FILE_reader
Definition: file:594
tools::xml::tree::atb
std::pair< std::string, std::string > atb
Definition: tree:57