Version: 6.3.1
Public Member Functions | Protected Member Functions | Private Attributes

QtxResourceMgr.Format Class Reference

Generic resources files reader/writer class.

#include <QtxResourceMgr.h>

Inheritance diagram for QtxResourceMgr.Format:
Inheritance graph

Public Member Functions

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

Protected Member Functions

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

Private Attributes

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

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
QStringList QtxResourceMgr.Format::options ( ) const
Returns:
list of the format options
QString QtxResourceMgr.Format::option ( const QString &  opt) const

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

Parameters:
optoption name
Returns:
option value
void QtxResourceMgr.Format::setOption ( const QString &  opt,
const QString &  val 
)
Parameters:
optoption name
valoption value
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::save ( Resources res)
bool QtxResourceMgr.Format::load ( const QString &  fname,
QMap< QString, Section > &  secMap 
) [protected, pure 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.IniFormat, and QtxResourceMgr.XmlFormat.

bool QtxResourceMgr.Format::save ( const QString &  fname,
const QMap< QString, Section > &  secMap 
) [protected, pure virtual]

Should be implemented in the successors.

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

Implemented in QtxResourceMgr.IniFormat, and QtxResourceMgr.XmlFormat.


Field Documentation

QString QtxResourceMgr.Format.myFmt [private]
QMap<QString, QString> QtxResourceMgr.Format.myOpt [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS