![]() |
Plus | - Minimal XML for C++ | (Version 0.9.2) | Giancarlo Niccolai |
#include <mxml_element.h>
Inheritance diagram for MXML::Element:
Public Member Functions | |
void | nextLine () |
Increments current processing line and set current position in line to 0. | |
void | nextChar () |
Increments current position in line by one. | |
void | setPosition (const int line, const int character) |
Set current position to the given value. | |
const int | line () const |
Returns current line in processing file, or last line processed by this object. | |
const int | character () const |
Returns current position in line in processing file, or last position processed by this object. | |
const int | beginLine () const |
Returns the line where this object begun. | |
const int | beginChar () const |
Returns the position in line where this object begun. | |
void | markBegin () |
Marks current position as the begin of current item. | |
virtual void | write (std::ostream &stream, const int style) const=0 |
Serializes current object to the stream. | |
Protected Member Functions | |
Element (const int line=1, const int pos=0) | |
Private Attributes | |
int | m_line |
Current processing line in input file. | |
int | m_char |
Current processing character in current line of input file. | |
int | m_beginLine |
Line at which the current element begun. | |
int | m_beginChar |
Character in Line at which the current element begun. | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Element &elem) |
Serializes the object on a stream. |
This class provides basic functionality for XML parsing; in particular, it provides a way to keep track of current line/position while parsing the document, and declares a pure virtual write method (that is called then by the << operator).
|
|
|
Returns the position in line where this object begun.
|
|
Returns the line where this object begun.
|
|
Returns current position in line in processing file, or last position processed by this object.
|
|
Returns current line in processing file, or last line processed by this object.
|
|
Marks current position as the begin of current item. The constructor caller will set a default starting line and position, but it is possible that i.e. due blanks, the real initial position of the current object is later discovered to be elsewhere. Call this method to update the current position as the real begin of the object in the input stream. |
|
Increments current position in line by one.
|
|
Increments current processing line and set current position in line to 0.
|
|
Set current position to the given value.
|
|
Serializes current object to the stream. Notice that the << operator won't allow to set style, so using stream << element you will not able to set the output style. Anyway, the MXML::Document class can set the default style for its hyerarcy, and it will take care to pass the given style to all the objects, in case you want to serialize it with << operator.
Implemented in MXML::Attribute, MXML::Document, and MXML::Node. |
|
Serializes the object on a stream. See write() method for an in depth. |
|
Character in Line at which the current element begun.
|
|
Line at which the current element begun.
|
|
Current processing character in current line of input file.
|
|
Current processing line in input file.
|