librcsb-core-wrapper
1.000
|
Public class that represents a dictionary object file. More...
#include <DictObjFile.h>
Public Member Functions | |
DictObjFile (const string &persStorFileName, const eFileMode fileMode=READ_MODE, const bool verbose=false, const string &dictSdbFileName=std::string()) | |
~DictObjFile () | |
void | Build () |
void | Write () |
void | Read () |
unsigned int | GetNumDictionaries () |
void | GetDictionaryNames (vector< string > &dictNames) |
DictObjCont & | GetDictObjCont (const string &dictName) |
void | Print () |
Public class that represents a dictionary object file.
This class represents a dictionary object file. This file is a container of dictionary objects. Each dictionary object is a container of its attributes and of objects of type: item, sub-category and category. Each of those objects is a container of relevant attributes for that object type. This class provides methods for construction/destruction, building the dictionary object file from a dictionary, writing/reading dictionary object file to/from the persistent storage file, accessing the dictionaries and printing the content of the dictionary object file.
DictObjFile::DictObjFile | ( | const string & | persStorFileName, |
const eFileMode | fileMode = READ_MODE , |
||
const bool | verbose = false , |
||
const string & | dictSdbFileName = std::string() |
||
) |
Constructs a dictionary object file.
[in] | persStoreFileName | - relative or absolute name of the persistent storage file |
[in] | fileMode | - optional parameter that indicates the dictionary object file mode. Possible values are read-only and create. Default is read mode. |
[in] | verbose | - optional parameter that indicates whether logging should be turned on (if true) or off (if false). If verbose is not specified, logging is turned off. |
[in] | dictSdbFileName | - optional parameter that indicates relative or absolute name of the SDB dictionary file. Must be specified if dictionary object file is in create mode. In read mode, the dictionary object file content is retrieved from the persistent storage file. In create mode its content will be built from the file specified by this parameter. |
FileModeException | - if dictionary object file is not in create mode |
InvalidStateException | - if dictionary and/or DDL file are specified for dictionary object file in read mode. |
EmptyValueException | - if dictionary and/or DDL file are not specified for dictionary object file in create mode. |
DictObjFile::~DictObjFile | ( | ) |
Destructs a dictionary object file, by releasing all consumed resources.
Not applicable |
None |
void DictObjFile::Build | ( | ) |
Builds a dictionary object file from the dictionary. This method parses the dictionary, parses the DDL, verifies the dictionary against the DDL and constructs objects.
None |
FileModeException | - if dictionary object file is not in create mode |
void DictObjFile::GetDictionaryNames | ( | vector< string > & | dictNames | ) |
Retrieves dictionary names of the dictionaries in the dictionary object file.
[out] | dictNames | - retrieved dictionary names |
None |
DictObjCont& DictObjFile::GetDictObjCont | ( | const string & | dictName | ) |
Retrieves a reference to the dictionary object.
[in] | dictName | - dictionary name |
NotFoundException | - if dictionary with name dictName does not exist |
unsigned int DictObjFile::GetNumDictionaries | ( | ) |
Retrieves the number of dictionaries in the dictionary object file.
None |
None |
void DictObjFile::Print | ( | ) |
Prints the content of the dictionary object file.
None |
None |
void DictObjFile::Read | ( | ) |
Reads a dictionary object file from the persistent storage file.
None |
FileModeException | - if dictionary object file is not in read mode |
void DictObjFile::Write | ( | ) |
Writes a dictionary object file to the persistent storage file.
None |
FileModeException | - if dictionary object file is not in create mode |