OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Derived from TConfigFile, TRegConfigFile is used to maintain configuration settings in the registry. More...
#include <owl/configfl.h>
Protected Attributes | |
TRegKey | Root |
Protected Attributes inherited from owl::TConfigFile | |
tstring | FileName |
Additional Inherited Members | |
Static Public Member Functions inherited from owl::TConfigFile | |
static void | SetPrecision (int newprec=-1) |
static int | GetPrecision () |
Static Protected Member Functions inherited from owl::TConfigFile | |
static bool | StringToBool (LPCTSTR str, bool *val) |
This static method converts a string to a bool, accepting most common boolean keywords: yes, on, true and 1. | |
static tstring | BoolToString (bool val) |
This static method returns yes or no given a boolean value. | |
Static Protected Attributes inherited from owl::TConfigFile | |
static int | DefaultPrecision = -1 |
Derived from TConfigFile, TRegConfigFile is used to maintain configuration settings in the registry.
Definition at line 329 of file configfl.h.
owl::TRegConfigFile::TRegConfigFile | ( | const tstring & | name, |
HKEY | root = HKEY_CURRENT_USER ) |
This source file implements TRegConfigFile.
This class is derived from TConfigFile and overrides the low-level storage methods to vector them to the registry. TRegConfigFile is not intended to handle all of an app's registry needs, but rather to be used for a convenient wrapper for app preference settings. All data is stored in HKEY_CURRENT_USER, using FileName like so:
FileName should contain the company name and product name to adhere to standard registry practices. Eg:
A version number can also be used to allow multiple versions of the same product to live together:
All sections are created under the subtree as described above. Eg,
Entries are stored under sections as REG_SZ values (for numbers it is REG_DWORD). Eg,
Definition at line 1361 of file configfl.cpp.
|
virtual |
Definition at line 1366 of file configfl.cpp.
Definition at line 86 of file configfl.h.
Implements owl::TConfigFile.
Definition at line 1447 of file configfl.cpp.
References owl::TConfigFile::FileName, PRECONDITION, and Root.
Implements owl::TConfigFile.
Definition at line 85 of file configfl.h.
Implements owl::TConfigFile.
Definition at line 1441 of file configfl.cpp.
References owl::TConfigFile::FileName, PRECONDITION, and Root.
Implements owl::TConfigFile.
|
inline |
Definition at line 93 of file configfl.h.
|
virtual |
This method reads binary data.
Reimplemented from owl::TConfigFile.
Definition at line 1506 of file configfl.cpp.
References owl::TConfigFile::FileName, owl::TRegKey::GetSubkey(), PRECONDITION, and Root.
|
virtual |
This method reads binary data.
Reimplemented from owl::TConfigFile.
Definition at line 76 of file configfl.cpp.
|
inline |
Definition at line 96 of file configfl.h.
|
virtual |
Reimplemented from owl::TConfigFile.
Definition at line 1458 of file configfl.cpp.
References owl::TConfigFile::FileName, owl::TRegKey::GetSubkey(), PRECONDITION, and Root.
This method reads an integer.
Reimplemented from owl::TConfigFile.
Definition at line 79 of file configfl.cpp.
Definition at line 83 of file configfl.cpp.
|
virtual |
Copies all value names of the given section to the specified buffer.
Each string is null-terminated, and the buffer is then terminated with a trailing null. Returns the number of characters written, excluding the trailing null-terminators. If the buffer is too small, the last string copied to the buffer may be truncated.
Implements owl::TConfigFile.
Definition at line 1382 of file configfl.cpp.
References _T, _tcslen, _tcsncpy, owl::TConfigFile::FileName, PRECONDITION, and Root.
|
virtual |
Implements owl::TConfigFile.
Copies all section names to the specified buffer.
Each string is null-terminated, and the buffer is then terminated with a trailing null. Returns the number of characters written, excluding the trailing null-terminators. If the buffer is too small, the last string copied to the buffer may be truncated.
Implements owl::TConfigFile.
Definition at line 1414 of file configfl.cpp.
References _T, _tcslen, _tcsncpy, owl::TConfigFile::FileName, PRECONDITION, and Root.
Implements owl::TConfigFile.
Definition at line 84 of file configfl.cpp.
|
inline |
Definition at line 89 of file configfl.h.
uint owl::TConfigFile::ReadString | ( | const tstring & | section, |
const tstring & | entry, | ||
tstring & | buffer, | ||
LPCTSTR | defstr = 0 ) const |
String-aware overload.
Definition at line 88 of file configfl.cpp.
|
virtual |
Looks up the value of the given entry of the given section, and if found, copies it to the given buffer.
If not found, the given default value defstr
is copied to the buffer, unless defstr
is null, in which case an empty string is copied to the buffer.
Implements owl::TConfigFile.
Definition at line 1483 of file configfl.cpp.
References _T, owl::TConfigFile::FileName, owl::TRegKey::GetSubkey(), PRECONDITION, and Root.
|
virtual |
Implements owl::TConfigFile.
Definition at line 82 of file configfl.h.
Reimplemented from owl::TConfigFile.
Definition at line 1370 of file configfl.cpp.
References owl::TConfigFile::FileName, owl::TRegKey::HasSubkey(), PRECONDITION, and Root.
Reimplemented from owl::TConfigFile.
Definition at line 66 of file configfl.cpp.
|
virtual |
Implements owl::TConfigFile.
Definition at line 1453 of file configfl.cpp.
|
inline |
Definition at line 94 of file configfl.h.
|
virtual |
This method writes binary data.
Reimplemented from owl::TConfigFile.
Definition at line 1518 of file configfl.cpp.
References owl::TConfigFile::FileName, PRECONDITION, and Root.
|
virtual |
This method writes binary data.
Reimplemented from owl::TConfigFile.
Definition at line 77 of file configfl.cpp.
|
inline |
Definition at line 97 of file configfl.h.
Reimplemented from owl::TConfigFile.
Definition at line 1465 of file configfl.cpp.
References owl::TConfigFile::FileName, PRECONDITION, and Root.
This method writes an integer. We format it as a string.
Reimplemented from owl::TConfigFile.
Definition at line 80 of file configfl.cpp.
|
inline |
Definition at line 91 of file configfl.h.
Implements owl::TConfigFile.
Definition at line 1496 of file configfl.cpp.
References owl::TConfigFile::FileName, PRECONDITION, and Root.
|
virtual |
Implements owl::TConfigFile.
|
protected |
Definition at line 366 of file configfl.h.