edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edbee::BasePListParser Class Reference

A general plist xml-file parser. More...

#include <baseplistparser.h>

+ Inheritance diagram for edbee::BasePListParser:
+ Collaboration diagram for edbee::BasePListParser:

Public Member Functions

 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
 

Detailed Description

A general plist xml-file parser.

Constructor & Destructor Documentation

◆ BasePListParser()

edbee::BasePListParser::BasePListParser ( )

The constructor for the parser.

◆ ~BasePListParser()

edbee::BasePListParser::~BasePListParser ( )
virtual

the default desctructor

Member Function Documentation

◆ 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
strthe error to raise

◆ readDict()

QHash< QString, QVariant > edbee::BasePListParser::readDict ( )

reads a dictionary

◆ 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
namethe name taht's expected. Use '' to not check the name
minimumlevel 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
levelthe 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: