DictObjFile Class Reference

Public class that represents a dictionary object file. More...

`#include <DictObjFile.h>`

Collaboration diagram for DictObjFile:

## 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 ()

## Detailed Description

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.

## Constructor & Destructor Documentation

## DictObjFile()

DictObjFile::DictObjFile | ( | const string & | persStorFileName,
|  | const eFileMode | fileMode = `READ_MODE`,
|  | const bool | verbose = `false`,
|  | const string & | dictSdbFileName = `std::string()`
| ) |  |

Constructs a dictionary object file.

Parameters

  [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.

Returns
  Not applicable

Precondition
  None

Postcondition
  None

Exceptions

  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::~DictObjFile | ( |  | ) |

Destructs a dictionary object file, by releasing all consumed resources.

Parameters

  | Not applicable

Returns
  Not applicable

Precondition
  None

Postcondition
  None

Exceptions

None

## Member Function Documentation

## Build()

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.

Parameters

  | None

Returns
  None

Precondition
  None

Postcondition
  None

Exceptions

  FileModeException | - if dictionary object file is not in create mode

## GetDictionaryNames()

void DictObjFile::GetDictionaryNames | ( | vector< string > & | dictNames | ) |

Retrieves dictionary names of the dictionaries in the dictionary object file.

Parameters

  [out] | dictNames | - retrieved dictionary names

Returns
  None

Precondition
  None

Postcondition
  None

Exceptions

None

## GetDictObjCont()

DictObjCont & DictObjFile::GetDictObjCont | ( | const string & | dictName | ) |

Retrieves a reference to the dictionary object.

Parameters

  [in] | dictName | - dictionary name

Returns
  Reference to the dictionary object.

Precondition
  Dictionary with name dictName must be present

Postcondition
  None

Exceptions

  NotFoundException | - if dictionary with name dictName does not exist

## GetNumDictionaries()

unsigned int DictObjFile::GetNumDictionaries | ( |  | ) |

Retrieves the number of dictionaries in the dictionary object file.

Parameters

  | None

Returns
  The number of dictionaries in the dictionary object file.

Precondition
  None

Postcondition
  None

Exceptions

None

## Print()

void DictObjFile::Print | ( |  | ) |

Prints the content of the dictionary object file.

Parameters

  | None

Returns
  None

Precondition
  None

Postcondition
  None

Exceptions

None

## Read()

void DictObjFile::Read | ( |  | ) |

Reads a dictionary object file from the persistent storage file.

Parameters

  | None

Returns
  None

Precondition
  None

Postcondition
  None

Exceptions

  FileModeException | - if dictionary object file is not in read mode

## Write()

void DictObjFile::Write | ( |  | ) |

Writes a dictionary object file to the persistent storage file.

Parameters

  | None

Returns
  None

Precondition
  None

Postcondition
  None

Exceptions

  FileModeException | - if dictionary object file is not in create mode

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

- rcsb/DictObjFile.h