Version: 8.3.0
YACS::ENGINE::dataParser Class Reference

#include <LoadState.hxx>

Inheritance diagram for YACS::ENGINE::dataParser:
Collaboration diagram for YACS::ENGINE::dataParser:

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 Attributes

std::list< std::string > _dataList
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::stateParser
static void setProc (Proc *p)
 
static void setRuntime (Runtime *runtime)
 
- 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 167 of file LoadState.hxx.

Member Function Documentation

void dataParser::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 731 of file LoadState.cxx.

732 {
733  _dataList.push_back(value);
734 }
void dataParser::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 701 of file LoadState.cxx.

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

702 {
703  DEBTRACE("dataParser::init()");
704  _state = XMLINVALUE;
705  _father = father;
706  _stackState.push(_state);
707  if (p) getAttributes(p);
708 }
void dataParser::onEnd ( const XML_Char name)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 736 of file LoadState.cxx.

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

737 {
738  // cerr << "dataParser::onEnd " << name << endl;
739  string val = "<data>";
740  while (!_dataList.empty())
741  {
742  val += _dataList.front();
743  _dataList.pop_front();
744  }
745  val += "</data>";
746  // cerr << val << endl;
747  _father->addData(val);
748  stateParser::onEnd(name);
749 }
void dataParser::onStart ( const XML_Char elem,
const xmlChar **  p 
)
virtual

Reimplemented from YACS::ENGINE::stateParser.

Definition at line 711 of file LoadState.cxx.

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

712 {
713  string element(elem);
714  DEBTRACE("data type " << element );
715  stateParser *parser = 0;
716  if (element == "value") parser = new valueParser();
717  else
718  {
719  _what = "expected value, got <" + element + ">";
721  stopParse(_what);
722  }
723  if (parser)
724  {
725  _stackParser.push(parser);
726  XML_SetUserData(_xmlParser, parser);
727  parser->init(p, this);
728  }
729 }

Member Data Documentation

std::list<std::string> YACS::ENGINE::dataParser::_dataList

Definition at line 174 of file LoadState.hxx.


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