A general plist xml-file parser.
More...
#include <baseplistparser.h>
|
| BasePListParser () |
| The constructor for the parser.
|
|
virtual | ~BasePListParser () |
| the default desctructor
|
|
QString | lastErrorMessage () const |
| Returns the last error message of the parsed file.
|
|
void | setLastErrorMessage (const QString &str) |
| Sets the last error message. To correctly set the last error message while parsing please use raiseError.
|
|
bool | beginParsing (QIODevice *device) |
| Start the parsing of the plist. If it isn't a valid plist this method return false. (it only checks and reads the existence of <plist>)
|
|
bool | endParsing () |
| Closes the parsers.
|
|
void | raiseError (const QString &str) |
| Call this method to raise an error and stop the xml parsing.
|
|
QList< QVariant > | readList () |
| reads a list of qvariants
|
|
QHash< QString, QVariant > | readDict () |
| reads a dictionary
|
|
QVariant | readNextPlistType (int level=-1) |
| reads the next plist type
|
|
bool | readNextElement (const QString &name, int level=-1) |
| Reads the next element and optionally expects it to be the given name.
|
|
QString | readElementText () |
| Reads the element text contents.
|
|
int | currentStackLevel () |
| returns the current stack-level
|
|
A general plist xml-file parser.
◆ BasePListParser()
edbee::BasePListParser::BasePListParser |
( |
| ) |
|
The constructor for the parser.
◆ ~BasePListParser()
edbee::BasePListParser::~BasePListParser |
( |
| ) |
|
|
virtual |
◆ beginParsing()
bool edbee::BasePListParser::beginParsing |
( |
QIODevice * | device | ) |
|
Start the parsing of the plist. If it isn't a valid plist this method return false. (it only checks and reads the existence of <plist>)
◆ currentStackLevel()
int edbee::BasePListParser::currentStackLevel |
( |
| ) |
|
returns the current stack-level
◆ endParsing()
bool edbee::BasePListParser::endParsing |
( |
| ) |
|
Closes the parsers.
- Returns
- true if the parsing was succesful
◆ lastErrorMessage()
QString edbee::BasePListParser::lastErrorMessage |
( |
| ) |
const |
Returns the last error message of the parsed file.
◆ raiseError()
void edbee::BasePListParser::raiseError |
( |
const QString & | str | ) |
|
Call this method to raise an error and stop the xml parsing.
- Parameters
-
◆ readDict()
QHash< QString, QVariant > edbee::BasePListParser::readDict |
( |
| ) |
|
◆ readElementText()
QString edbee::BasePListParser::readElementText |
( |
| ) |
|
Reads the element text contents.
◆ readList()
QList< QVariant > edbee::BasePListParser::readList |
( |
| ) |
|
reads a list of qvariants
◆ readNextElement()
bool edbee::BasePListParser::readNextElement |
( |
const QString & | name, |
|
|
int | level = -1 ) |
Reads the next element and optionally expects it to be the given name.
- Parameters
-
name | the name taht's expected. Use '' to not check the name |
minimum | level the level the element should be. -1 means ignore this argument |
◆ readNextPlistType()
QVariant edbee::BasePListParser::readNextPlistType |
( |
int | level = -1 | ) |
|
reads the next plist type
- Parameters
-
level | the level we're currently parsing |
◆ setLastErrorMessage()
void edbee::BasePListParser::setLastErrorMessage |
( |
const QString & | str | ) |
|
Sets the last error message. To correctly set the last error message while parsing please use raiseError.
The documentation for this class was generated from the following files: