Public Types | Public Member Functions | Public Attributes

XMLStorage::XMLStateReader Struct Reference

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::XMLStateReader:
Inheritance graph
[legend]
Collaboration diagram for XMLStorage::XMLStateReader:
Collaboration graph
[legend]

List of all members.

Public Types

enum  XML_STATE {
  XSS_NONE, XSS_START_ELEMENT, XSS_END_ELEMENT, XSS_ELEMENT,
  XSS_CHARACTERS
}

Public Member Functions

 XMLStateReader (XMLNode *node, std::istream &in)
bool has_next ()
void next ()
virtual void StartElementHandler (const XS_String &name, const XMLNode::AttributeMap &attr)
 notifications about XML start tag
virtual void EndElementHandler ()
 notifications about XML end tag
virtual void DefaultHandler (const std::string &s)
 store content, white space and comments

Public Attributes

ParseContext _parse_ctx
enum XML_STATE _state
XS_String _node_name
XMLNode::AttributeMap _attrs

Detailed Description

Definition at line 2985 of file xmlstorage.h.


Member Enumeration Documentation

Enumerator:
XSS_NONE 
XSS_START_ELEMENT 
XSS_END_ELEMENT 
XSS_ELEMENT 
XSS_CHARACTERS 

Definition at line 2987 of file xmlstorage.h.

                   {
        XSS_NONE,
        XSS_START_ELEMENT,
        XSS_END_ELEMENT,
        XSS_ELEMENT,
        XSS_CHARACTERS,
    //  XSS_COMMENT,
    //  XSS_SPACE,
    //  XSS_CDATA,
    //  XSS_PROCESSING_INSTRUCTION
    };

Constructor & Destructor Documentation

XMLStorage::XMLStateReader::XMLStateReader ( XMLNode node,
std::istream &  in 
) [inline]

Definition at line 2999 of file xmlstorage.h.

     :  XMLReader(node, in),
        _parse_ctx(*this),
        _state(XSS_NONE)
    {
    }

Member Function Documentation

void XMLStorage::XMLStateReader::DefaultHandler ( const std::string &  s ) [virtual]

store content, white space and comments

Reimplemented from XMLStorage::XMLReaderBase.

Definition at line 1291 of file xmlstorage.cpp.

void XMLStorage::XMLStateReader::EndElementHandler (  ) [virtual]

notifications about XML end tag

Reimplemented from XMLStorage::XMLReaderBase.

Definition at line 1277 of file xmlstorage.cpp.

{
//  _node_name.erase();
//  _attrs.clear();
    _content.erase();

    if (_state == XSS_START_ELEMENT)
        _state = XSS_ELEMENT;
    else {
        assert(_state==XSS_NONE);
        _state = XSS_END_ELEMENT;
    }
}
bool XMLStorage::XMLStateReader::has_next (  )

Definition at line 1251 of file xmlstorage.cpp.

{
    while(_state == XSS_NONE)
        if (!_parse_ctx.proceed())
            break;

    return _state != XSS_NONE;
}
void XMLStorage::XMLStateReader::next (  )

Definition at line 1260 of file xmlstorage.cpp.

void XMLStorage::XMLStateReader::StartElementHandler ( const XS_String name,
const XMLNode::AttributeMap attributes 
) [virtual]

notifications about XML start tag

Reimplemented from XMLStorage::XMLReaderBase.

Definition at line 1267 of file xmlstorage.cpp.

{
    _node_name = name;
    _attrs = attr;
    _content.erase();

    assert(_state==XSS_NONE);
    _state = XSS_START_ELEMENT;
}

Member Data Documentation

Definition at line 3018 of file xmlstorage.h.

Definition at line 3017 of file xmlstorage.h.

Definition at line 3014 of file xmlstorage.h.

Referenced by XMLStorage::XMLStreamReader::XMLStreamReader().

Definition at line 3016 of file xmlstorage.h.


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage