edbee - Qt Editor Library
Public Member Functions | Protected Member Functions | List of all members
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. More...
 
virtual ~BasePListParser ()
 the default desctructor More...
 
QString lastErrorMessage () const
 Returns the last error message of the parsed file. More...
 

Protected Member Functions

void setLastErrorMessage (const QString &str)
 Sets the last error message. To correctly set the last error message while parsing please use raiseError. More...
 
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>) More...
 
bool endParsing ()
 Closes the parsers. More...
 
void raiseError (const QString &str)
 Call this method to raise an error and stop the xml parsing. More...
 
QList< QVariant > readList ()
 reads a list of qvariants More...
 
QHash< QString, QVariant > readDict ()
 reads a dictionary More...
 
QVariant readNextPlistType (int level=-1)
 reads the next plist type More...
 
bool readNextElement (const QString &name, int level=-1)
 Reads the next element and optionally expects it to be the given name. More...
 
QString readElementText ()
 Reads the element text contents. More...
 
int currentStackLevel ()
 returns the current stack-level More...
 

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)
protected

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 ( )
protected

returns the current stack-level

◆ endParsing()

bool edbee::BasePListParser::endParsing ( )
protected

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)
protected

Call this method to raise an error and stop the xml parsing.

Parameters
strthe error to raise

◆ readDict()

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

reads a dictionary

◆ readElementText()

QString edbee::BasePListParser::readElementText ( )
protected

Reads the element text contents.

◆ readList()

QList< QVariant > edbee::BasePListParser::readList ( )
protected

reads a list of qvariants

◆ readNextElement()

bool edbee::BasePListParser::readNextElement ( const QString &  name,
int  level = -1 
)
protected

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)
protected

reads the next plist type

Parameters
levelthe level we're currently parsing

◆ setLastErrorMessage()

void edbee::BasePListParser::setLastErrorMessage ( const QString &  str)
protected

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: