Public Member Functions | Protected Attributes

XMLStorage::XMLReader Struct Reference

XML file reader. More...

#include <xmlstorage.h>

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

List of all members.

Public Member Functions

 XMLReader (XMLNode *node, std::istream &in)
int get ()
 read one character from XML stream

Protected Attributes

std::istream & _in
int _last_crlf

Detailed Description

XML file reader.

Definition at line 2664 of file xmlstorage.h.


Constructor & Destructor Documentation

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

Definition at line 2666 of file xmlstorage.h.

     :  XMLReaderBase(node),
        _in(in),
        _last_crlf(0)
    {
    }

Member Function Documentation

int XMLStorage::XMLReader::get (  ) [inline, virtual]

read one character from XML stream

Implements XMLStorage::XMLReaderBase.

Definition at line 2674 of file xmlstorage.h.

References XMLStorage::XMLLocation::_column, _in, _last_crlf, XMLStorage::XMLLocation::_line, and XMLStorage::XMLReaderBase::_location.

    {
        int c = _in.get();

//       // increment line counter on LF
//      if (c == '\n') {
//          _location._column = 1;
//          ++_location._line;
         // increment line counter on LF, CR, CR/LF or LF/CR line endings
        if (c=='\n' || c=='\r') {
            if (!_last_crlf || c==_last_crlf) {
                _location._column = 1;
                ++_location._line;
                _last_crlf = c;
            } else
                _last_crlf = 0;
        } else {
            ++_location._column;
            _last_crlf = 0;
        }

        return c;
    }

Member Data Documentation

std::istream& XMLStorage::XMLReader::_in [protected]

Definition at line 2699 of file xmlstorage.h.

Referenced by get().

Definition at line 2700 of file xmlstorage.h.

Referenced by get().


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage