Version: 8.3.0
YACS::ENGINE::valueParser Class Reference

#include <LoadState.hxx>

Inheritance diagram for YACS::ENGINE::valueParser:
Collaboration diagram for YACS::ENGINE::valueParser:

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)
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::stateParser
static void setProc (Proc *p)
 
static void setRuntime (Runtime *runtime)
 
- 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
 
- Protected Member Functions inherited from YACS::ENGINE::stateParser
virtual void charData (std::string data)
 
- 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
 

Detailed Description

Definition at line 149 of file LoadState.hxx.

Member Function Documentation

void valueParser::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 637 of file LoadState.cxx.

638 {
639  _data = "<value>" + value + "</value>";
640 }
void valueParser::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 611 of file LoadState.cxx.

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

612 {
613  DEBTRACE("valueParser::init()");
614  _state = XMLINVALUE;
615  _father = father;
616  _stackState.push(_state);
617  if (p) getAttributes(p);
618 }
void valueParser::onEnd ( const XML_Char name)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 642 of file LoadState.cxx.

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

643 {
644  DEBTRACE( _data );
646  string elem = (char *) name;
647  //if (elem == "value" || elem == "data" || elem == "array")
648  stateParser::onEnd(name);
649  //else YASSERT(0); //DEBTRACE("valueParser::onEnd " << elem);
650 }
void valueParser::onStart ( const XML_Char elem,
const xmlChar **  p 
)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 621 of file LoadState.cxx.

References DEBTRACE, and YACS::ENGINE::stateParser::init().

622 {
623  string element(elem);
624  DEBTRACE("value type " << element );
625  stateParser *parser = 0;
626  if (element == "data") parser = new dataParser();
627  else if (element == "array") parser = new arrayParser();
628  else parser = new simpleTypeParser();
629  if (parser)
630  {
631  _stackParser.push(parser);
632  XML_SetUserData(_xmlParser, parser);
633  parser->init(p, this);
634  }
635 }

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