Version: 9.15.0
YACS::ENGINE::arrayParser Class Reference

#include <LoadState.hxx>

Inheritance diagram for YACS::ENGINE::arrayParser:
Collaboration diagram for YACS::ENGINE::arrayParser:

Public Member Functions

virtual void init (const xmlChar **p, xmlParserBase *father=0)
 
virtual void onStart (const XML_Char *elem, const xmlChar **p)
 
virtual void onEnd (const XML_Char *name)
 
virtual void addData (std::string value)
 
- Public Member Functions inherited from xmlParserBase
void setAttribute (std::string key, std::string value)
 
std::string getAttribute (std::string key)
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::stateParser
static void setProc (Proc *p)
 
static void setRuntime (Runtime *runtime)
 
- Static Public Member Functions inherited from xmlParserBase
static void XMLCALL start_document (void *userData)
 
static void XMLCALL end_document (void *userData)
 
static void XMLCALL start_element (void *userData, const xmlChar *name, const xmlChar **p)
 
static void XMLCALL end_element (void *userData, const xmlChar *name)
 
static void XMLCALL characters (void *userData, const xmlChar *ch, int len)
 
static void XMLCALL comment (void *userData, const xmlChar *value)
 
static void XMLCALL warning (void *userData, const char *fmt,...)
 
static void XMLCALL error (void *userData, const char *fmt,...)
 
static void XMLCALL fatal_error (void *userData, const char *fmt,...)
 
static void XMLCALL cdata_block (void *userData, const xmlChar *value, int len)
 
static void cleanGarbage ()
 
static int getGarbageSize ()
 
static void XML_SetUserData (_xmlParserCtxt *ctxt, xmlParserBase *parser)
 
- Public Attributes inherited from xmlParserBase
std::map< std::string, int > counts
 
- Static Public Attributes inherited from YACS::ENGINE::stateParser
static XMLReadState _state
 
static std::string _what
 
- Static Public Attributes inherited from xmlParserBase
static _xmlParserCtxt * _xmlParser
 
static std::stack< xmlParserBase * > _stackParser
 
- Protected Member Functions inherited from YACS::ENGINE::stateParser
virtual void charData (std::string data)
 
- Protected Member Functions inherited from xmlParserBase
void getAttributes (const xmlChar **p)
 
virtual void onStart (const XML_Char *elem, const xmlChar **p)
 
virtual void onEnd (const XML_Char *name)
 
virtual void incrCount (const XML_Char *elem)
 
virtual void end ()
 
virtual void stopParse (std::string what)
 
- Protected Attributes inherited from xmlParserBase
std::map< std::string, std::string > _mapAttrib
 
std::string _data
 
xmlParserBase_father
 
- Static Protected Attributes inherited from YACS::ENGINE::stateParser
static std::stack< XMLReadState_stackState
 
static Proc_p
 
static Runtime_runtime
 
static std::map< std::string, YACS::StatesForNode_nodeStateValue
 
static std::map< std::string, YACS::StatesForNode_nodeStates
 
- Static Protected Attributes inherited from xmlParserBase
static std::list< xmlParserBase * > _garbage
 

Detailed Description

Definition at line 158 of file LoadState.hxx.

Member Function Documentation

◆ addData()

void arrayParser::addData ( std::string  value)
virtual

Add data on the data attribute of the parser object dedicated to an xml tag

Reimplemented from xmlParserBase.

Definition at line 684 of file LoadState.cxx.

685 {
686  string val = "<array>" + value + "</array>";
687  _data = val;
688 }
std::string _data

◆ init()

void arrayParser::init ( const xmlChar **  p,
xmlParserBase father = 0 
)
virtual

all parsers must know their father parser (father tag), in order to set values or attributes in father.

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 654 of file LoadState.cxx.

655 {
656  DEBTRACE("arrayParser::init()");
657  _state = XMLINVALUE;
658  _father = father;
659  _stackState.push(_state);
660  if (p) getAttributes(p);
661 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
static std::stack< XMLReadState > _stackState
Definition: LoadState.hxx:98
static XMLReadState _state
Definition: LoadState.hxx:83
xmlParserBase * _father
void getAttributes(const xmlChar **p)
Proc * p
Definition: driver.cxx:216

References DEBTRACE, p, and YACS::ENGINE::XMLINVALUE.

◆ onEnd()

void arrayParser::onEnd ( const XML_Char name)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 691 of file LoadState.cxx.

692 {
693  // cerr << "arrayParser::onEnd " << name << endl;
694  // cerr << _data << endl;
696  stateParser::onEnd(name);
697 }
virtual void onEnd(const XML_Char *name)
Definition: LoadState.cxx:111
virtual void addData(std::string value)

References YACS::ENGINE::stateParser::onEnd().

◆ onStart()

void arrayParser::onStart ( const XML_Char elem,
const xmlChar **  p 
)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 664 of file LoadState.cxx.

665 {
666  string element(elem);
667  DEBTRACE("array type " << element);
668  stateParser *parser = 0;
669  if (element == "data") parser = new dataParser();
670  else
671  {
672  _what = "expected data, got <" + element + ">";
674  stopParse(_what);
675  }
676  if (parser)
677  {
678  _stackParser.push(parser);
679  XML_SetUserData(_xmlParser, parser);
680  parser->init(p, this);
681  }
682 }
specialized parser to load SALOME execution saved states.
Definition: LoadState.hxx:81
virtual void init(const xmlChar **p, xmlParserBase *father=0)
Definition: LoadState.cxx:65
static std::string _what
Definition: LoadState.hxx:84
static void XML_SetUserData(_xmlParserCtxt *ctxt, xmlParserBase *parser)
virtual void stopParse(std::string what)
static _xmlParserCtxt * _xmlParser
static std::stack< xmlParserBase * > _stackParser

References DEBTRACE, YACS::parser::init(), p, and YACS::ENGINE::XMLFATALERROR.


The documentation for this class was generated from the following files: