SimbaSettingReader Class Reference

Provides static methods that can be used to read registry or INI settings. More...

List of all members.

Classes

class  Listener
 A base class which allows one to get a callback when a given setting is changed. More...

Static Public Member Functions

static void Finalize ()
 Deletes the s_customSettings pointer.
static EncodingType GetAppCharEncoding ()
 Retrieves the Application ANSI encoding. This is used to override the default value as given by ICU.
static simba_string GetConfigErrorMessagesPath ()
 Retrieves path to the Simba error messages XML file.
static simba_wstring const & GetConfigurationBranding ()
 DEPRECATED: Gets branding for the configuration source.
static simba_wstring const & GetConfigurationIniFile ()
 Get the name of the INI file from which this class reads the SDK and DSII specific settings.
static simba_string GetDriverLocale ()
 Retrieves the driver-wide locale.
static EncodingType GetDriverManagerEncoding ()
 Retrieves the Driver Manager's WCHAR encoding.
static simba_string GetEncryptSwapFile ()
 Retrieves the configuration activating the encryption of temporary swap files.
static simba_string GetErrorMessagesPath (const simba_string &in_driverLocation)
 Retrieves path to the Simba error messages XML file.
static simba_string GetLogFileCount ()
 Retrieves the setting for the number of files to log to for DSI logging.
static simba_string GetLogFileSize ()
 Retrieves the maximum log size for DSI logging.
static simba_string GetLogLevel ()
 Retrieves a flag for whether DSI logging should be done. Typically accepted values are 0-6 or Off, Fatal, Error, etc... It is up to the caller to validate and convert the string to a meaningful value.
static simba_string GetLogNamespace ()
 Retrieves the namespace for log files.
static simba_string GetLogPath ()
 Retrieves the directory for log files.
static const simba_string GetLogType ()
 Get the logger type name.
static simba_string GetMemoryLimit ()
 Gets the memory limit.
static simba_string GetMemoryStrategy ()
 Gets the memory strategy.
static simba_string GetMemoryThresholdPercent ()
 Gets the memory threshold percent.
static simba_string GetODBCInstLib ()
 DEPRECATED: Gets the lib name (absolute path or name alone) for odbcinst.
static std::vector< simba_stringGetODBCInstLibs ()
 Gets a vector containing the lib names (absolute path or name alone) for odbcinst.
static simba_string GetSwapDiskLimit ()
 Gets the disk space limit available for swap files.
static simba_string GetSwapFilePath ()
 Retrieves the directory for temporary swap files.
static bool GetTraceToStdErr ()
 Retrieves the option to enable tracing of function calls and important information before the Driver is created and fully initialized.
static simba_wstring GetUnixConfigEnvVariable ()
 Gets the branding for the environment variable used to override the location of the config file.
static void InitializeInstance (const simba_wstring &in_defaultBranding, const simba_wstring &in_defaultEnvVariable, const simba_wstring &in_subkey)
 Initializes the instance only one time (done in Driver or SimbaServerSingleton).
static simba_string ReadSetting (const simba_string &in_valueName)
 Get Custom Setting.
static void RegisterListener (Listener &in_listener, const std::string &in_listenFor)
 Register a listener to be invoked when the given key is modified.
static void SetConfigurationBranding (const simba_wstring &in_branding)
 DEPRECATED: Sets branding for the configuration source.
static void SetConfigurationIniFile (const simba_wstring &in_iniFileName)
 Set the name of the INI file from which this class reads the SDK and DSII specific settings.
static void SetConfigurationListener (INotifiable *in_notifiable)
 Sets the notifiable object to notify of INI file name or base registry key changes.
static void SetDriverLocale (const simba_string &in_locale)
 Set the driver-wide locale.
static void SetErrorMessagesPath (const simba_string &in_errMsgPath)
 Set path to the Simba error messages file.
static void SetLogFileCount (const simba_string &in_logFileCountSetting)
 Set the log rotation file count for DSI logging.
static void SetLogFileSize (const simba_string &in_logFileSizeSetting)
 Set the log file size for DSI logging.
static void SetLogLevel (const simba_string &in_logLevelSetting)
 Set the log level for DSI logging.
static void SetLogNamespace (const simba_string &in_namespaceSetting)
 Set the directory for log files.
static void SetLogPath (const simba_string &in_pathSetting)
 Set the directory for log files.
static void SetLogType (const simba_string &in_logTypeName)
 Set the logger type name.
static void SetODBCInstLib (const simba_string &in_libSetting)
 Sets the lib name (absolute path or name alone) for odbcinst.
static void SetSetting (const simba_string &in_name, const simba_string &in_value)
 Set custom setting.
static void SetSwapFilePath (const simba_string &in_pathSetting)
 Set the directory for temporary swap files.
static void SetUnixConfigEnvVariable (const simba_wstring &in_newEnvVariable)
 Sets branding for the environment variable used to override the location of the config file.
static void UnregisterListener (Listener &in_listener, const std::string &in_listeningFor)
 Unregister a listener previously registered with RegisterListener.

Detailed Description

Provides static methods that can be used to read registry or INI settings.


Member Function Documentation

static void Finalize (  )  [static]

Deletes the s_customSettings pointer.

static EncodingType GetAppCharEncoding (  )  [static]

Retrieves the Application ANSI encoding. This is used to override the default value as given by ICU.

Returns:
Driver Manager encoding.
static simba_string GetConfigErrorMessagesPath (  )  [static]

Retrieves path to the Simba error messages XML file.

Returns:
The path to the Simba error messages XML file.
static simba_wstring const& GetConfigurationBranding (  )  [static]

DEPRECATED: Gets branding for the configuration source.

This function is mapped to GetConfigurationIniFile() on Windows and GetConfigurationIniFile() on Linux/OSX/Unix. It was kept for backward compatibility, but is deprecated and can be removed in a later version of the SDK.

Parameters:
in_branding The branding to set for the configuration.
static simba_wstring const& GetConfigurationIniFile (  )  [static]

Get the name of the INI file from which this class reads the SDK and DSII specific settings.

Returns:
Name of the INI file.
static simba_string GetDriverLocale (  )  [static]

Retrieves the driver-wide locale.

Returns:
The driver-wide locale.
static EncodingType GetDriverManagerEncoding (  )  [static]

Retrieves the Driver Manager's WCHAR encoding.

Returns:
Driver Manager encoding.
static simba_string GetEncryptSwapFile (  )  [static]

Retrieves the configuration activating the encryption of temporary swap files.

Returns:
The encryption flag, or empty if none is specified.
static simba_string GetErrorMessagesPath ( const simba_string in_driverLocation  )  [static]

Retrieves path to the Simba error messages XML file.

Parameters:
in_driverLocation The location of the driver dll in the file system, with the trailing "/" or "\" appended.
Returns:
The path for error messages.
static simba_string GetLogFileCount (  )  [static]

Retrieves the setting for the number of files to log to for DSI logging.

Returns:
The string representing the number of files to log to, or empty if none is specified.
static simba_string GetLogFileSize (  )  [static]

Retrieves the maximum log size for DSI logging.

Returns:
The string specifying the maximum log size for DSI logging, or empty if none is specified.
static simba_string GetLogLevel (  )  [static]

Retrieves a flag for whether DSI logging should be done. Typically accepted values are 0-6 or Off, Fatal, Error, etc... It is up to the caller to validate and convert the string to a meaningful value.

Returns:
The log level configuration value.
static simba_string GetLogNamespace (  )  [static]

Retrieves the namespace for log files.

Returns:
The namespace for filtering log files, or empty if none is specified.
static simba_string GetLogPath (  )  [static]

Retrieves the directory for log files.

Returns:
The path for log files, or empty if none is specified.
static const simba_string GetLogType (  )  [static]

Get the logger type name.

Returns:
The logger type name.
static simba_string GetMemoryLimit (  )  [static]

Gets the memory limit.

Returns:
The memory limit.
static simba_string GetMemoryStrategy (  )  [static]

Gets the memory strategy.

Returns:
The memory strategy.
static simba_string GetMemoryThresholdPercent (  )  [static]

Gets the memory threshold percent.

Returns:
The memory threshold percent.
static simba_string GetODBCInstLib (  )  [static]

DEPRECATED: Gets the lib name (absolute path or name alone) for odbcinst.

static std::vector<simba_string> GetODBCInstLibs (  )  [static]

Gets a vector containing the lib names (absolute path or name alone) for odbcinst.

static simba_string GetSwapDiskLimit (  )  [static]

Gets the disk space limit available for swap files.

Returns:
The disk space limit.
static simba_string GetSwapFilePath (  )  [static]

Retrieves the directory for temporary swap files.

Returns:
The path for swap files, or empty if none is specified.
static bool GetTraceToStdErr (  )  [static]

Retrieves the option to enable tracing of function calls and important information before the Driver is created and fully initialized.

Returns:
True to do tracing, false otherwise.
static simba_wstring GetUnixConfigEnvVariable (  )  [static]

Gets the branding for the environment variable used to override the location of the config file.

This function is only available on non-windows platforms.

Returns:
The name of the environment variable that refers to the config file
static void InitializeInstance ( const simba_wstring in_defaultBranding,
const simba_wstring in_defaultEnvVariable,
const simba_wstring in_subkey 
) [static]

Initializes the instance only one time (done in Driver or SimbaServerSingleton).

This overload exists only on Windows. It sets the default name of the base INI file and Windows registry key (see SetConfigurationIniFile() and SetConfigurationRegistryKey()).

Parameters:
in_defaultIniFileName Default INI file name.
in_defaultBaseRegistryKey Default base registry key. (WINDOWS ONLY)
in_defaultEnvVariable Default environment variable name. (UNIX PLATFORMS ONLY)
in_subkey Subkey or section name to look for config below branding. Initializes the instance only one time (done in Driver or SimbaServerSingleton). On Windows, it sets the name of the base Windows registry key (see SetConfigurationRegistryKey()) and leave the name of the INI file empty. On Linux/OSX/Unix, it sets the name of the INI file (see SetConfigurationIniFile()) and the default environment variable.

On Windows, this version of the function is deprecated. The version that allows to provide both the default INI file name and the default registry key should be used instead. This version was kept for now for backward compatibility reason only.

Parameters:
in_defaultBranding Default registry or config file branding.
in_defaultEnvVariable Default environment variable name. (UNIX PLATFORMS ONLY)
in_subkey Subkey or section name to look for config below branding.
static simba_string ReadSetting ( const simba_string in_valueName  )  [static]

Get Custom Setting.

Retrieves the in_valueName from the Simba configuration.

Parameters:
in_valueName The custom key to retrieve from configuration.
Returns:
The value set for the custom key.
static void RegisterListener ( Listener in_listener,
const std::string &  in_listenFor 
) [static]

Register a listener to be invoked when the given key is modified.

Parameters:
in_listener The listener to register. The same listener may be registered for any number of distinct keys, but only once per key.
in_listenFor The key to listen for.
static void SetConfigurationBranding ( const simba_wstring in_branding  )  [static]

DEPRECATED: Sets branding for the configuration source.

This function is mapped to SetConfigurationIniFile() on Windows and SetConfigurationIniFile() on Linux/OSX/Unix. It was kept for backward compatibility, but is deprecated and can be removed in a later version of the SDK.

Parameters:
in_branding The branding to set for the configuration.
static void SetConfigurationIniFile ( const simba_wstring in_iniFileName  )  [static]

Set the name of the INI file from which this class reads the SDK and DSII specific settings.

The given file name can be an absolute or relative path. If a relative path is given, the file is looked for into the following directories:

  • On Windows into the driver DLL directory if a non-zero module identifier has been set (see SetModuleId()) or the current directory if the module identifier is null (default).
  • On Linux/OSX/Unix files with these paths in order: 1. <current_working_directory>/in_name 2. $HOME/.in_name 3. /etc/in_name

The default value is set at the first call to InitializeInstance(). If the SDK is doing this first call, the default values depends on the build configuration:

  • For a standalone driver, the INI file name is set to "simba.ini".
  • For a Simba server, the INI file name is set to "simbaserver.ini".

If an empty string is given, it disables reading properties from an INI file.

On Windows, the SimbaSettingReader reads first from the INI file if the name is not empty. If it fails to open the INI file, it falls back to the registry to load its settings. On Linux, there is obviously no such falls back and properties can only come from an INI file.

Parameters:
in_iniFileName Name of the INI file provided as an absolute or relative path.
static void SetConfigurationListener ( INotifiable in_notifiable  )  [static]

Sets the notifiable object to notify of INI file name or base registry key changes.

When SetConfigurationBranding() is called, the notifiable will have Notify() called on it.

Parameters:
in_notifiable The object to notify of changes to the branding. (NOT OWN)
static void SetDriverLocale ( const simba_string in_locale  )  [static]

Set the driver-wide locale.

Parameters:
in_locale The driver-wide locale to set.
static void SetErrorMessagesPath ( const simba_string in_errMsgPath  )  [static]

Set path to the Simba error messages file.

Parameters:
in_errMsgPath The path for error messages.
static void SetLogFileCount ( const simba_string in_logFileCountSetting  )  [static]

Set the log rotation file count for DSI logging.

Parameters:
in_logFileCountSetting The number of log files for log rotation.
static void SetLogFileSize ( const simba_string in_logFileSizeSetting  )  [static]

Set the log file size for DSI logging.

Parameters:
in_logFileSizeSetting The log file size.
static void SetLogLevel ( const simba_string in_logLevelSetting  )  [static]

Set the log level for DSI logging.

Parameters:
in_logLevelSetting The logging configuration.
static void SetLogNamespace ( const simba_string in_namespaceSetting  )  [static]

Set the directory for log files.

Parameters:
in_namespaceSetting The namespace for filtering log files.
static void SetLogPath ( const simba_string in_pathSetting  )  [static]

Set the directory for log files.

Parameters:
in_pathSetting The path for log files.
static void SetLogType ( const simba_string in_logTypeName  )  [static]

Set the logger type name.

Parameters:
in_logTypeName Log type name.
static void SetODBCInstLib ( const simba_string in_libSetting  )  [static]

Sets the lib name (absolute path or name alone) for odbcinst.

Parameters:
in_libSetting The library name to load.
static void SetSetting ( const simba_string in_name,
const simba_string in_value 
) [static]

Set custom setting.

Parameters:
in_name The custom key.
in_value The custom value for the key given.
static void SetSwapFilePath ( const simba_string in_pathSetting  )  [static]

Set the directory for temporary swap files.

Parameters:
in_pathSetting The path for swap files.
static void SetUnixConfigEnvVariable ( const simba_wstring in_newEnvVariable  )  [static]

Sets branding for the environment variable used to override the location of the config file.

This function is only available on non-windows platforms.

Defaults to SIMBAINI.

When setting the environment variable, it may be used to specify an absolute or relative path and filename to the configuration file to use. ex. export SIMBAINI=/path/to/alternate.simba.ini

static void UnregisterListener ( Listener in_listener,
const std::string &  in_listeningFor 
) [static]

Unregister a listener previously registered with RegisterListener.

Parameters:
in_listener The listener, as previously passed into RegisterListener.
in_listeningFor The key to unregister for, as previously passed into RegisterListener.

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

Generated on Wed May 17 14:21:19 2017 for SimbaEngine 10.1.3.1011 by simba