Version: 9.15.0
YACS::controltypeParser< T > Struct Template Reference

#include <linkParsers.hxx>

Inheritance diagram for YACS::controltypeParser< T >:
Collaboration diagram for YACS::controltypeParser< T >:

Public Member Functions

virtual void onStart (const XML_Char *el, const XML_Char **attr)
 
virtual void onEnd (const char *el, parser *child)
 
virtual void pre ()
 
virtual void fromnode (const std::string &name)
 
virtual void tonode (const std::string &name)
 
virtual void property (const myprop &prop)
 
virtual T & post ()
 
- Public Member Functions inherited from YACS::parser
 parser ()
 
virtual ~parser ()
 
virtual void SetUserDataAndPush (parser *pp)
 
virtual void charData (const XML_Char *s, int len)
 
virtual void endParser ()
 
virtual void init ()
 
virtual void incrCount (const XML_Char *elem)
 
virtual void checkOrder (std::string &el)
 
virtual void maxcount (std::string name, int max, std::string &el)
 
virtual void mincount (std::string name, int min)
 
virtual void maxchoice (std::string *names, int max, std::string &el)
 
virtual void minchoice (std::string *names, int min)
 
virtual void required (const std::string &name, const XML_Char **attr)
 
virtual void buildAttr (const XML_Char **attr)
 
std::stack< parser * > & getStack ()
 
template<class T >
post ()
 
void logError (const std::string &reason)
 

Public Attributes

_link
 
- Public Attributes inherited from YACS::parser
std::string _file
 
std::string _content
 
std::map< std::string, int > * _counts
 
std::map< std::string, int > _orders
 
int _orderState
 
int _level
 
std::stack< std::map< std::string, int > * > _stackCount
 
std::stack< int > _stackOrder
 
std::map< std::string, parser * > * _defaultParsersMap
 

Static Public Attributes

static controltypeParser< T > controlParser
 
- Static Public Attributes inherited from YACS::parser
static parser main_parser
 
static std::stack< parser * > _stackParser
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::parser
static void XMLCALL start_document (void *data)
 
static void XMLCALL end_document (void *data)
 
static void XMLCALL start_element (void *data, const xmlChar *name, const xmlChar **p)
 
static void XMLCALL end_element (void *data, const xmlChar *name)
 
static void XMLCALL characters (void *data, const xmlChar *ch, int len)
 
static void XMLCALL comment (void *data, const xmlChar *value)
 
static void XMLCALL cdata_block (void *data, const xmlChar *value, int len)
 
static void XMLCALL warning (void *data, const char *fmt,...)
 
static void XMLCALL error (void *data, const char *fmt,...)
 
static void XMLCALL fatal_error (void *data, const char *fmt,...)
 
static void XML_SetUserData (_xmlParserCtxt *ctxt, parser *par)
 

Detailed Description

template<class T = mycontrol>
struct YACS::controltypeParser< T >

Definition at line 32 of file linkParsers.hxx.

Member Function Documentation

◆ fromnode()

template<class T = mycontrol>
virtual void YACS::controltypeParser< T >::fromnode ( const std::string &  name)
inlinevirtual

Definition at line 59 of file linkParsers.hxx.

60  {
61  _link.fromnode(name);
62  }

References YACS::controltypeParser< T >::_link.

Referenced by YACS::controltypeParser< T >::onEnd().

◆ onEnd()

template<class T = mycontrol>
virtual void YACS::controltypeParser< T >::onEnd ( const char *  el,
parser child 
)
inlinevirtual

Reimplemented from YACS::parser.

Reimplemented in YACS::linktypeParser< T >, and YACS::linktypeParser< mystream >.

Definition at line 49 of file linkParsers.hxx.

50  {
51  std::string element(el);
52  if(element == "fromnode")fromnode(((stringtypeParser*)child)->post());
53  else if(element == "tonode")tonode(((stringtypeParser*)child)->post());
54  }
virtual void tonode(const std::string &name)
Definition: linkParsers.hxx:63
virtual void fromnode(const std::string &name)
Definition: linkParsers.hxx:59

References YACS::controltypeParser< T >::fromnode(), YACS::controltypeParser< T >::post(), and YACS::controltypeParser< T >::tonode().

◆ onStart()

template<class T = mycontrol>
virtual void YACS::controltypeParser< T >::onStart ( const XML_Char el,
const XML_Char **  attr 
)
inlinevirtual

Reimplemented from YACS::parser.

Reimplemented in YACS::linktypeParser< T >, and YACS::linktypeParser< mystream >.

Definition at line 36 of file linkParsers.hxx.

37  {
38  std::string element(el);
40  this->maxcount("fromnode",1,element);
41  this->maxcount("tonode",1,element);
42  if(element == "fromnode")pp=&stringtypeParser::stringParser;
43  else if(element == "tonode")pp=&stringtypeParser::stringParser;
44  this->SetUserDataAndPush(pp);
45  pp->init();
46  pp->pre();
47  pp->buildAttr(attr);
48  }
virtual void maxcount(std::string name, int max, std::string &el)
Definition: parserBase.cxx:122
virtual void SetUserDataAndPush(parser *pp)
Definition: parserBase.cxx:55
static parser main_parser
Definition: parserBase.hxx:41
static stringtypeParser stringParser
Definition: dataParsers.hxx:33

References YACS::parser::buildAttr(), YACS::parser::init(), YACS::parser::main_parser, YACS::parser::maxcount(), YACS::parser::pre(), YACS::parser::SetUserDataAndPush(), and YACS::stringtypeParser::stringParser.

◆ post()

template<class T = mycontrol>
virtual T& YACS::controltypeParser< T >::post ( )
inlinevirtual

Reimplemented in YACS::linktypeParser< T >, and YACS::linktypeParser< mystream >.

Definition at line 72 of file linkParsers.hxx.

73  {
74  mincount("fromnode",1);
75  mincount("tonode",1);
76  return _link;
77  }
virtual void mincount(std::string name, int min)
Definition: parserBase.cxx:134

References YACS::controltypeParser< T >::_link, and YACS::parser::mincount().

Referenced by YACS::controltypeParser< T >::onEnd().

◆ pre()

template<class T = mycontrol>
virtual void YACS::controltypeParser< T >::pre ( )
inlinevirtual

Reimplemented from YACS::parser.

Definition at line 55 of file linkParsers.hxx.

56  {
57  _link.clear();
58  }

References YACS::controltypeParser< T >::_link.

◆ property()

template<class T = mycontrol>
virtual void YACS::controltypeParser< T >::property ( const myprop prop)
inlinevirtual

Definition at line 67 of file linkParsers.hxx.

68  {
69  DEBTRACE( "property_set: " << prop._name << prop._value )
70  _link.setProperty(prop._name,prop._value);
71  }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
std::string _name
Definition: factory.hxx:96
std::string _value
Definition: factory.hxx:97

References YACS::controltypeParser< T >::_link, myprop::_name, myprop::_value, and DEBTRACE.

◆ tonode()

template<class T = mycontrol>
virtual void YACS::controltypeParser< T >::tonode ( const std::string &  name)
inlinevirtual

Definition at line 63 of file linkParsers.hxx.

64  {
65  _link.tonode(name);
66  }

References YACS::controltypeParser< T >::_link.

Referenced by YACS::controltypeParser< T >::onEnd().

Member Data Documentation

◆ _link

◆ controlParser

template<class T >
controltypeParser< T > YACS::controltypeParser< T >::controlParser
static

Definition at line 34 of file linkParsers.hxx.


The documentation for this struct was generated from the following file: