# EDS Configuration Manager

Topics

:

Overview
Functions

Overview

The EDS configuration manager is used to load program parameters from an EDS101 encrypted database file. This allows programs to maintain a platform dependent, application specific configuration file that users of the program cannot modify, read, or alter.

Configurable parameters are assigned a name and value string. Each name and value string is encrypted and written to a binary file create and maintained by the gxDatabase engine. When an encrypted configuration file is loaded into memory all the strings are decrypted and maintained like a normal text file.

Each configurable parameter is assigned a case-sensitive name in the file followed by an equal sign, then a value. The first character of a parameter name must be alphanumeric. If the first character is not alphanumeric the line will be ignored. The configuration manager can read strings, integer, or floating point values from the encrypted binary file. A number sign or a semicolon precedes comments in the configuration file. The following is an example of a decrypted configuration file:

    # Define a signed long integer value
    Long=2147483647

    # Define a signed short integer value
    Int=32768

    # Define a double precision floating point value
    Float=1.12345

    # Define a character string value
    String=YES

There can only be one instance of a parameter name in the file. If a parameter is named two or more times, the configuration manager will use the first one it finds and ignore all others. Limits and default values for each parameter must be defined within the application itself. The application is responsible for creating the configurable parameters in the file. This version of the configuration manager allows you to update any changes to existing values. If the parameter you are changing does not exist, the parameter name and value will be written to the configuration file.

Functions

edsConfig::edsConfig()
edsConfig::~edsConfig()
edsConfig::ChangeConfigValue()
edsConfig::Close()
edsConfig::Create()
edsConfig::Disconnect()
edsConfig::Exists()
edsConfig::FilterComments()
edsConfig::Flush()
edsConfig::GetCommentChar()
edsConfig::GetFileName()
edsConfig::GetFloatValue()
edsConfig::GetIntValue()
edsConfig::GetLongValue()
edsConfig::GetParmID()
edsConfig::GetStrValue()
edsConfig::Load()
edsConfig::Open()
edsConfig::OpenDatabase()
edsConfig::ReLoad()
edsConfig::Read()
edsConfig::ReadComments()
edsConfig::SetCommentChar()
edsConfig::SetFileName()
edsConfig::SetParmID()
edsConfig::UnLoad()
edsConfig::Write()
edsConfig::WriteCommentLine()
edsConfig::WriteConfigLine()
edsConfig::WriteLine()

edsConfig::edsConfig()

- Class constructor used to construct a configuration file object.

edsConfig::edsConfig(const UString &fname)

- Class constructor used to construct a configuration file object and set the name of the configuration file.

edsConfig::edsConfig(char *fname)

- Class constructor used to construct a configuration file object and set the name of the configuration file.

edsConfig::edsConfig(const char *fname)

- Class constructor used to construct a configuration file object and set the name of the configuration file.

edsConfig::edsConfig(const UString &fname, const UString &p_id)

- Class constructor used to construct a configuration file object and set the name of the configuration file and the string value that will be used to identify parameter values within the file.

edsConfig::edsConfig(const UString &fname, char *p_id)

- Class constructor used to construct a configuration file object and set the name of the configuration file and the string value that will be used to identify parameter values within the file.

edsConfig::edsConfig(const UString &fname, const char *p_id)

- Class constructor used to construct a configuration file object and set the name of the configuration file and the string value that will be used to identify parameter values within the file.

edsConfig::edsConfig(const edsConfig &ob)

- Private class copy constructor used to disallow copying.

void edsConfig::operator=(const edsConfig &ob)

- Private assignment operator used to disallow assignment.

edsConfig::~edsConfig()

- Class destructor responsible for clearing the list and de-allocating all the nodes when a edsConfig object is destroyed.

int edsConfig::ChangeConfigValue(const UString &parm, const UString &value)

- Public member function used to a modify a configuration file user-defined string value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const char *parm, const UString &value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const UString &parm, unsigned value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const char *parm, unsigned value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(char *parm, unsigned value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const UString &parm, long value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const char *parm, long value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(char *parm, long value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const UString &parm, float value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const char *parm, float value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(char *parm, float value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const UString &parm, double value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(char *parm, const UString &value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const char *parm, double value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(char *parm, double value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const UString &parm, const char *value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const UString &parm, char *value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const char *parm, const char *value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(char *parm, char *value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const UString &parm, int value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(const char *parm, int value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

int edsConfig::ChangeConfigValue(char *parm, int value)

- Public member function used to a modify a configuration file value. NOTE: All parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configuration file parameter. By default an equal sign will be used as a parameter ID.

gxDatabaseError edsConfig::Close()

- Public member function used to disconnect the database from the file. Returns zero if successful.

gxDatabaseError edsConfig::Create(const UString &fname)

- Public member function used create a new database file. Returns zero if successful.

gxDatabaseError edsConfig::Create(const char *fname)

- Public member function used create a new database file. Returns zero if successful

gxDatabaseError edsConfig::Disconnect()

- Public member function used to disconnect the database from the file. Returns zero if successful.

int edsConfig::Exists()

- Public member function that returns true if the database file exists.

void edsConfig::FilterComments()

- Public member function used to force the configuration manager to ignore all lines starting with a comment ID when the configuration file is loaded from disk.

gxDatabaseError edsConfig::Flush()

- Public member function used to flush the database file. Returns zero if successful.

char edsConfig::GetCommentChar()

- Public member function that returns the character value currently being used by the configuration manager to filter comments from a file.

char *edsConfig::GetFileName()

- Public member function that returns the name of the configuration file.

double edsConfig::GetFloatValue(char *Name)

- Public member function used to read a double precision floating point value from the configurable parameter list loaded in memory. Returns zero if the parameter name is not found.

double edsConfig::GetFloatValue(const char *Name)

- Public member function used to read a double precision floating point value from the configurable parameter list loaded in memory. Returns zero if the parameter name is not found.

double edsConfig::GetFloatValue(const UString &Name)

- Public member function used to read a double precision floating point value from the configurable parameter list loaded in memory. Returns zero if the parameter name is not found.

int edsConfig::GetIntValue(char *Name)

- Public member function used to read an integer value from the configurable parameter list loaded in memory. Returns zero if the parameter name is not found.

int edsConfig::GetIntValue(const char *Name)

- Public member function used to read an integer value from the configurable parameter list loaded in memory. Returns zero if the parameter name is not found.

int edsConfig::GetIntValue(const UString &Name)

- Public member function used to read an integer value from the configurable parameter list loaded in memory. Returns zero if the parameter name is not found.

long edsConfig::GetLongValue(char *Name)

- Public member function used to read an long integer value from the configurable parameter list loaded in memory. Returns zero if the parameter name is not found.

long edsConfig::GetLongValue(const char *Name)

- Public member function used to read an long integer value from the configurable parameter list loaded in memory. Returns zero if the parameter name is not found.

long edsConfig::GetLongValue(const UString &Name)

- Public member function used to read an long integer value from the configurable parameter list loaded in memory. Returns zero if the parameter name is not found.

char *edsConfig::GetParmID()

- Public member function that returns the character string currently being used by the configuration manager to identify configurable parameters.

char* edsConfig::GetStrValue(char *Name)

- Public member function used to read a string value from the configurable parameter list loaded in memory. Returns a null value if the parameter name is not found.

char* edsConfig::GetStrValue(const char *Name)

- Public member function used to read a string value from the configurable parameter list loaded in memory. Returns a null value if the parameter name is not found.

char* edsConfig::GetStrValue(const UString &Name)

- Public member function used to read a string value from the configurable parameter list loaded in memory. Returns a null value if the parameter name is not found.

int edsConfig::Load()

- Public member function used to load all the configurable names and values after the configuration file has been named by the edsConfig class constructor or a call to the edsConfig::SetFileName() function. Returns false if the file cannot be opened or a memory allocation error occurred.

int edsConfig::Load(char *fname)

- Public member function used to load all the configurable names and values from the specified file. Returns false if the file cannot be opened or a memory allocation error occurred.

int edsConfig::Load(const char *fname)

- Public member function used to load all the configurable names and values from the specified file. Returns false if the file cannot be opened or a memory allocation error occurred

int edsConfig::Load(const UString &fname)

- Public member function used to load all the configurable names and values from the specified file. Returns false if the file cannot be opened or a memory allocation error occurred.

gxDatabaseError edsConfig::Open(const UString &fname)

- Public member function used to open a database file. Returns zero if successful.

gxDatabase *edsConfig::OpenDatabase()

- Public member function that returns a pointer to the database engine.

int edsConfig::ReLoad()

- Public member function used to reload the configurable names and values after the configuration file has been named by the edsConfig class constructor or a call to the edsConfig::SetFileName() function. Returns false if the file cannot be opened or a memory allocation error occurred.

int edsConfig::ReLoad(char *fname)

- Public member function used to reload configurable names and values from the specified file. Returns false if the file cannot be opened or a memory allocation error occurred.

int edsConfig::ReLoad(const char *fname)

- Public member function used to reload configurable names and values from the specified file. Returns false if the file cannot be opened or a memory allocation error occurred.

int edsConfig::ReLoad(const UString &fname)

- Public member function used to reload configurable names and values from the specified file. Returns false if the file cannot be opened or a memory allocation error occurred.

edsWORD *edsConfig::Read(FAU addr = gxCurrAddress)

- Public member function used to read an encrypted string directly from the database file.

void edsConfig::ReadComments()

- Public member function used to force the configuration manager to read all lines starting with a comment ID when the configuration file is loaded from disk.

void edsConfig::SetCommentChar(char c)

- Public member function used to set the character value used by the configuration manager to identify comment strings in the configuration file.

void edsConfig::SetFileName(const UString &s)

- Public member function used to set the name of the configuration file.

void edsConfig::SetFileName(const char *s)

- Public member function used to set the name of the configuration file.

void edsConfig::SetFileName(char *s)

- Public member function used to set the name of the configuration file.

void edsConfig::SetParmID(const UString &s)

- Public member function used to set the string value used by the configuration manager to identify configurable parameters in the configuration file. By default an equal sign will be used as a parameter ID.

void edsConfig::SetParmID(char *s)

- Public member function used to set the string value used by the configuration manager to identify configurable parameters in the configuration file. By default an equal sign will be used as a parameter ID.

void edsConfig::SetParmID(const char *s)

- Public member function used to set the string value used by the configuration manager to identify configurable parameters in the configuration file. By default an equal sign will be used as a parameter ID.

void edsConfig::UnLoad()

- Public member function used to unload all the configurable names and values from memory.

int edsConfig::Write(const char *s, FAU addr = (FAU_t)

- Public member function used to write an encrypted string to a database block. NOTE: The block size for encrypted strings is fixed length. The block size is set by the edsMaxLine constant. Additionally, no blocks will be deleted. Blocks that need to be changed will be overwritten. Blocks that need to be deleted will be removed with a comment character starting at the beginning of the string.

int edsConfig::WriteCommentLine(const UString &s)

- Public member function used to write a comment line to the configuration file. NOTE: Do not include the comment ID character. The comment ID will by automatically inserted. Returns zero if an error occurs or one to indicate that the line was written successfully.

int edsConfig::WriteCommentLine(const char *s)

- Public member function used to write a comment line to the configuration file. NOTE: Do not include the comment ID character. The comment ID will by automatically inserted. Returns zero if an error occurs or one to indicate that the line was written successfully.

int edsConfig::WriteCommentLine(char *s)

- Public member function used to write a comment line to the configuration file. NOTE: Do not include the comment ID character. The comment ID will by automatically inserted. Returns zero if an error occurs or one to indicate that the line was written successfully.

int edsConfig::WriteConfigLine(const UString &parm, const UString &value)

- Public member function used to write a line to the configuration file. NOTE: Parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configurable file parameter. By default an equal sign will be used as a parameter ID. Returns zero if an error occurs or one to indicate that the line was written successfully.

int edsConfig::WriteConfigLine(const char *parm, const char *value)

- Public member function used to write a line to the configuration file. NOTE: Parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configurable file parameter. By default an equal sign will be used as a parameter ID. Returns zero if an error occurs or one to indicate that the line was written successfully.

int edsConfig::WriteConfigLine(char *parm, char *value)

- Public member function used to write a line to the configuration file. NOTE: Parameter values should not contain a parameter ID label at the end of the string. The parameter ID label will be added to mark it as a configurable file parameter. By default an equal sign will be used as a parameter ID. Returns zero if an error occurs or one to indicate that the line was written successfully.

int edsConfig::WriteLine(const UString &s)

- Public member function used to write a line of text to the configuration file. Returns zero if an error occurs or one to indicate that the line was written successfully.

int edsConfig::WriteLine(const char *s)

- Public member function used to write a line of text to the configuration file. Returns zero if an error occurs or one to indicate that the line was written successfully.

int edsConfig::WriteLine(char *s)

- Public member function used to write a line of text to the configuration file. Returns zero if an error occurs or one to indicate that the line was written successfully.

End Of Document