Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxResourceMgr::Format Class Referenceabstract

Generic resources files reader/writer class.

#include <QtxResourceMgr.h>

Inheritance diagram for QtxResourceMgr::Format:
Inheritance graph

Public Member Functions

 Format (const QString &)
 Constructor. More...
 
virtual ~Format ()
 Destructor. More...
 
QString format () const
 Get the format name. More...
 
QStringList options () const
 Get options names. More...
 
QString option (const QString &) const
 Get the value of the option with specified name. More...
 
void setOption (const QString &, const QString &)
 Set the value of the option with specified name. More...
 
bool load (Resources *)
 Load resources from the resource file. More...
 
bool save (Resources *)
 Save resources to the resource file. More...
 

Protected Member Functions

virtual bool load (const QString &, QMap< QString, Section > &)=0
 Load resources from the specified resources file. More...
 
virtual bool save (const QString &, const QMap< QString, Section > &)=0
 Save resources to the specified resources file. More...
 

Private Attributes

QString myFmt
 format name More...
 
QMap< QString, QString > myOpt
 options map More...
 

Constructor & Destructor Documentation

QtxResourceMgr::Format::Format ( const QString &  fmt)
Parameters
fmtformat name (for example, "xml" or "ini")
QtxResourceMgr::Format::~Format ( )
virtual

Member Function Documentation

QString QtxResourceMgr::Format::format ( ) const
Returns
format name
bool QtxResourceMgr::Format::load ( Resources res)
Parameters
resresources object
Returns
true on success and false on error

References QtxResourceMgr::load(), QtxResourceMgr::Resources::myFileName, QtxResourceMgr::Resources::mySections, and QtxResourceMgr::sections().

bool QtxResourceMgr::Format::load ( const QString &  fname,
QMap< QString, Section > &  secMap 
)
protectedpure virtual

Should be implemented in the successors.

Parameters
fnameresources file name
secMapresources map to be filled in
Returns
true on success and false on error

Implemented in QtxResourceMgr::XmlFormat, and QtxResourceMgr::IniFormat.

QString QtxResourceMgr::Format::option ( const QString &  opt) const

If option doesn't exist then null QString is returned.

Parameters
optoption name
Returns
option value
QStringList QtxResourceMgr::Format::options ( ) const
Returns
list of the format options
bool QtxResourceMgr::Format::save ( Resources res)
bool QtxResourceMgr::Format::save ( const QString &  fname,
const QMap< QString, Section > &  secMap 
)
protectedpure virtual

Should be implemented in the successors.

Parameters
fnameresources file name
secMapresources map
Returns
true on success and false on error

Implemented in QtxResourceMgr::XmlFormat, and QtxResourceMgr::IniFormat.

void QtxResourceMgr::Format::setOption ( const QString &  opt,
const QString &  val 
)
Parameters
optoption name
valoption value

Member Data Documentation

QString QtxResourceMgr::Format::myFmt
private
QMap<QString, QString> QtxResourceMgr::Format::myOpt
private

The documentation for this class was generated from the following files: