Version: 9.12.0
QtxResourceMgr::JsonFormat Class Reference

Reader/writer for .json resources files. More...

Inheritance diagram for QtxResourceMgr::JsonFormat:
Inheritance graph

Public Member Functions

 JsonFormat ()
 Constructor. More...
 
 ~JsonFormat ()
 Destructor. More...
 
- Public Member Functions inherited from QtxResourceMgr::Format
 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

 JsonFormat (const QString &)
 Constructor. More...
 
virtual bool load (const QString &, QMap< QString, Section > &)
 Load resources from json-file. More...
 
virtual bool save (const QString &, const QMap< QString, Section > &)
 Save resources to the json-file. More...
 

Private Member Functions

bool load (const QString &, QMap< QString, Section > &, QSet< QString > &)
 Load resources from json-file. More...
 

Detailed Description

Reader/writer for .json resources files.

Constructor & Destructor Documentation

◆ JsonFormat() [1/2]

QtxResourceMgr::JsonFormat::JsonFormat ( )

Constructor.

◆ ~JsonFormat()

QtxResourceMgr::JsonFormat::~JsonFormat ( )

Destructor.

◆ JsonFormat() [2/2]

QtxResourceMgr::JsonFormat::JsonFormat ( const QString &  fmt)
protected

Constructor.

Member Function Documentation

◆ load() [1/2]

bool QtxResourceMgr::JsonFormat::load ( const QString &  fname,
QMap< QString, Section > &  secMap 
)
protectedvirtual

Load resources from json-file.

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

Implements QtxResourceMgr::Format.

References QtxResourceMgr::load().

◆ load() [2/2]

bool QtxResourceMgr::JsonFormat::load ( const QString &  fname,
QMap< QString, Section > &  secMap,
QSet< QString > &  importHistory 
)
private

Load resources from json-file.

Parameters
fnameresources file name
secMapresources map to be filled in
importHistorylist of already imported resources files (to prevent import loops)
Returns
true on success or false on error

References Qtx::Always, IMapConstIterator< Key, Value >::key(), QtxResourceMgr::load(), Qtx::makeEnvVarSubst(), and IMapConstIterator< Key, Value >::value().

◆ save()

bool QtxResourceMgr::JsonFormat::save ( const QString &  fname,
const QMap< QString, Section > &  secMap 
)
protectedvirtual

Save resources to the json-file.

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

Implements QtxResourceMgr::Format.

References Qtx::mkDir(), and IMapConstIterator< Key, Value >::value().


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