MinitScript  0.9.31 PRE-BETA
Public Member Functions | Private Attributes | List of all members
Properties Class Reference

Properties class, which helps out with storeing or loading key value pairs from/to property files. More...

#include <minitscript/utilities/Properties.h>

Collaboration diagram for Properties:
Collaboration graph

Public Member Functions

 Properties ()
 Public constructor. More...
 
void clear ()
 Clear. More...
 
const string & get (const string &key, const string &defaultValue) const
 Get property value by key. More...
 
void put (const string &key, const string &value)
 Add property. More...
 
void load (const string &pathName, const string &fileName)
 Load property file. More...
 
void store (const string &pathName, const string &fileName) const
 Store property file. More...
 
const unordered_map< string, string > & getProperties ()
 

Private Attributes

unordered_map< string, string > properties
 

Detailed Description

Properties class, which helps out with storeing or loading key value pairs from/to property files.

Author
Andreas Drewke

Definition at line 16 of file Properties.h.

Constructor & Destructor Documentation

◆ Properties()

Properties ( )
inline

Public constructor.

Definition at line 25 of file Properties.h.

Member Function Documentation

◆ clear()

void clear ( )
inline

Clear.

Definition at line 30 of file Properties.h.

◆ get()

const string& get ( const string &  key,
const string &  defaultValue 
) const
inline

Get property value by key.

Parameters
keykey
defaultValuedefault value
Returns
value if found or default value

Definition at line 40 of file Properties.h.

◆ put()

void put ( const string &  key,
const string &  value 
)
inline

Add property.

Parameters
keykey
valuevalue

Definition at line 52 of file Properties.h.

◆ load()

void load ( const string &  pathName,
const string &  fileName 
)

Load property file.

Parameters
pathNamepath name
fileNamefile name
Exceptions
tdme::os::filesystem::FileSystemException

Definition at line 22 of file Properties.cpp.

◆ store()

void store ( const string &  pathName,
const string &  fileName 
) const

Store property file.

Parameters
pathNamepath name
fileNamefile name
Exceptions
tdme::os::filesystem::FileSystemException

Definition at line 38 of file Properties.cpp.

◆ getProperties()

const unordered_map<string, string>& getProperties ( )
inline
Returns
properties map

Definition at line 75 of file Properties.h.

Member Data Documentation

◆ properties

unordered_map<string, string> properties
private

Definition at line 19 of file Properties.h.


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