Version: 9.15.0
YACS::ENGINE::attrParser Class Reference

#include <LoadState.hxx>

Inheritance diagram for YACS::ENGINE::attrParser:
Collaboration diagram for YACS::ENGINE::attrParser:

Public Member Functions

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

Public Attributes

std::string _attrValue
 
- Public Attributes inherited from xmlParserBase
std::map< std::string, int > counts
 

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)
 
- 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 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 129 of file LoadState.hxx.

Member Function Documentation

◆ charData()

void attrParser::charData ( std::string  data)
virtual

to be specialized following the kind of xml tag

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 507 of file LoadState.cxx.

508 {
509  _attrValue = data;
510 }

◆ init()

void attrParser::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 489 of file LoadState.cxx.

490 {
491  DEBTRACE("attrParser::init()");
492  //_state = XMLINNODE;
493  _father = father;
494  _stackState.push(_state); // keep current state
495  if (p) getAttributes(p);
496 }
#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, and p.

◆ onEnd()

void attrParser::onEnd ( const XML_Char name)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 512 of file LoadState.cxx.

513 {
514  // cerr << "end attrParser " << name << " " << _stackParser.size() << endl;
515  YASSERT(_father);
516  _father->setAttribute((char*)name, _attrValue);
517  stateParser::onEnd(name);
518 }
#define YASSERT(val)
YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort.
Definition: YacsTrace.hxx:59
virtual void onEnd(const XML_Char *name)
Definition: LoadState.cxx:111
void setAttribute(std::string key, std::string value)

References YACS::ENGINE::stateParser::onEnd(), and YASSERT.

◆ onStart()

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

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 499 of file LoadState.cxx.

500 {
501  string element(elem);
502  _what = "expected nothing, got <" + element + ">";
504  stopParse(_what);
505 }
static std::string _what
Definition: LoadState.hxx:84
virtual void stopParse(std::string what)

References YACS::ENGINE::XMLFATALERROR.

Member Data Documentation

◆ _attrValue

std::string YACS::ENGINE::attrParser::_attrValue

Definition at line 136 of file LoadState.hxx.


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