ZNC
trunk
|
A dictionary for strings. More...
#include <ZNCString.h>
Public Types | |
enum | status_t { MCS_SUCCESS = 0 , MCS_EOPEN = 1 , MCS_EWRITE = 2 , MCS_EWRITEFIL = 3 , MCS_EREADFIL = 4 } |
Status codes that can be returned by WriteToDisk() and ReadFromDisk(). More... | |
Public Member Functions | |
MCString () | |
Construct an empty MCString. More... | |
MCString (std::initializer_list< std::pair< const CString, CString >> list) | |
Construct a MCString using an initializer list eg. More... | |
virtual | ~MCString () |
Destruct this MCString. More... | |
enum status_t | WriteToDisk (const CString &sPath, mode_t iMode=0644) const |
Write this map to a file. More... | |
enum status_t | ReadFromDisk (const CString &sPath) |
Read a map from a file. More... | |
virtual bool | WriteFilter (CString &sKey, CString &sValue) const |
Filter used while writing this map. More... | |
virtual bool | ReadFilter (CString &sKey, CString &sValue) const |
Filter used while reading this map. More... | |
virtual CString & | Encode (CString &sValue) const |
Encode a value so that it can safely be parsed by ReadFromDisk(). More... | |
virtual CString & | Decode (CString &sValue) const |
Undo the effects of Encode(). More... | |
Public Attributes | |
K | keys |
STL member. More... | |
T | elements |
STL member. More... | |
Static Public Attributes | |
static const MCString | EmptyMap |
A static instance of an empty map. More... | |
A dictionary for strings.
This class maps strings to other strings.
enum MCString::status_t |
Status codes that can be returned by WriteToDisk() and ReadFromDisk().
Enumerator | |
---|---|
MCS_SUCCESS | No errors. |
MCS_EOPEN | Opening the file failed. |
MCS_EWRITE | Writing to the file failed. |
MCS_EWRITEFIL | WriteFilter() failed. |
MCS_EREADFIL | ReadFilter() failed. |
|
inline |
Construct an empty MCString.
|
inlinevirtual |
Destruct this MCString.
Undo the effects of Encode().
This is an internal function.
Encode a value so that it can safely be parsed by ReadFromDisk().
This is an internal function.
Filter used while reading this map.
This function is called by ReadFromDisk() for each pair that is beging read. This function has the chance to modify the data that is being read.
sKey | The key that was read. Can be modified. |
sValue | The value that was read. Can be modified. |
Read a map from a file.
sPath | The file name to read from. |
Filter used while writing this map.
This function is called by WriteToDisk() for each pair that is going to be written. This function has the chance to modify the data that will be written.
sKey | The key that will be written. Can be modified. |
sValue | The value that will be written. Can be modified. |
Write this map to a file.
sPath | The file name to write to. |
iMode | The mode for the file. |
|
inherited |
STL member.
|
static |
A static instance of an empty map.
|
inherited |
STL member.