|
OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Save/Load configuration parameters Base abstract class. More...
#include <owl/configfl.h>
Public Member Functions | |
| TConfigFile (const tstring &name) | |
| Constructs instance and sets FileName to name. | |
| virtual | ~TConfigFile () |
| Destroys the instance. | |
| const tstring & | GetFileName () const |
| virtual void | LoadValues (const TConfigFile &file) |
| virtual bool | SectionExists (LPCTSTR section) const |
| virtual uint | ReadSection (LPCTSTR section, TCHAR *buffer, uint bufSize) const =0 |
| virtual uint | ReadSections (TCHAR *sections, uint bufSize) const =0 |
| virtual bool | EraseSection (LPCTSTR section)=0 |
| virtual bool | EraseEntry (LPCTSTR section, LPCTSTR entry)=0 |
| virtual void | UpdateFile ()=0 |
| virtual uint | ReadString (LPCTSTR section, LPCTSTR entry, TCHAR *buffer, uint bufSize, LPCTSTR defstr=0) const =0 |
| virtual bool | WriteString (LPCTSTR section, LPCTSTR entry, LPCTSTR value)=0 |
| virtual bool | ReadData (LPCTSTR section, LPCTSTR entry, void *buffer, uint size) const |
| This method reads binary data. | |
| virtual bool | WriteData (LPCTSTR section, LPCTSTR entry, void *buffer, uint size) |
| This method writes binary data. | |
| virtual int | ReadInteger (LPCTSTR section, LPCTSTR entry, int defint=0) const |
| This method reads an integer. | |
| virtual bool | WriteInteger (LPCTSTR section, LPCTSTR entry, int value) |
| This method writes an integer. We format it as a string. | |
| bool | SectionExists (const tstring §ion) const |
| int | ReadSection (const tstring §ion, tstring &buffer) const |
| int | ReadSections (tstring §ions) const |
| bool | EraseSection (const tstring §ion) |
| bool | EraseEntry (const tstring §ion, const tstring &entry) |
| uint | ReadString (const tstring §ion, const tstring &entry, tstring &buffer, LPCTSTR defstr=0) const |
| String-aware overload. | |
| uint | ReadString (const tstring §ion, const tstring &entry, tstring &buffer, const tstring &defstr) const |
| bool | WriteString (const tstring §ion, const tstring &entry, const tstring &value) |
| bool | ReadData (const tstring §ion, const tstring &entry, void *buffer, uint size) const |
| bool | WriteData (const tstring §ion, const tstring &entry, void *buffer, uint size) |
| int | ReadInteger (const tstring §ion, const tstring &entry, int defint=0) const |
| bool | WriteInteger (const tstring §ion, const tstring &entry, int value) |
| double | ReadDouble (LPCTSTR section, LPCTSTR entry, double defval=0.0) const |
| bool | WriteDouble (LPCTSTR section, LPCTSTR entry, double value) |
| This method writes an integer. | |
| double | ReadDouble (const tstring §ion, const tstring &entry, double defval=0.0) const |
| bool | WriteDouble (const tstring §ion, const tstring &entry, double value) |
| bool | ReadBool (LPCTSTR section, LPCTSTR entry, bool defval=false) const |
| This method reads a boolean value. | |
| bool | WriteBool (LPCTSTR section, LPCTSTR entry, bool val) |
| This method writes a bool. | |
| bool | ReadBool (const tstring §ion, const tstring &entry, bool defval=false) const |
| bool | WriteBool (const tstring §ion, const tstring &entry, bool val) |
| bool | ReadDate (LPCTSTR section, LPCTSTR entry, TDate &value) const |
| bool | WriteDate (LPCTSTR section, LPCTSTR entry, const TDate &val) |
| bool | ReadDate (const tstring §ion, const tstring &entry, TDate &value) const |
| bool | WriteDate (const tstring §ion, const tstring &entry, const TDate &val) |
| bool | ReadSystemTime (LPCTSTR section, LPCTSTR entry, TSystemTime &val) const |
| bool | WriteSystemTime (LPCTSTR section, LPCTSTR entry, const TSystemTime &val) |
| bool | ReadSystemTime (const tstring §ion, const tstring &entry, TSystemTime &val) const |
| bool | WriteSystemTime (const tstring §ion, const tstring &entry, const TSystemTime &val) |
| bool | ReadTime (LPCTSTR section, LPCTSTR entry, TTime &val) const |
| bool | WriteTime (LPCTSTR section, LPCTSTR entry, TTime &val) |
| bool | ReadTime (const tstring §ion, const tstring &entry, TTime &val) const |
| bool | WriteTime (const tstring §ion, const tstring &entry, TTime &val) |
| bool | ReadFont (LPCTSTR section, LPCTSTR entry, LOGFONT &font) const |
| This method will take a profile string of the form: | |
| bool | WriteFont (LPCTSTR section, LPCTSTR entry, const LOGFONT &font) |
| This method writes a font description in the following format: | |
| bool | ReadFont (const tstring §ion, const tstring &entry, LOGFONT &font) const |
| bool | WriteFont (const tstring §ion, const tstring &entry, const LOGFONT &font) |
| bool | ReadColor (LPCTSTR section, LPCTSTR entry, TColor &color) const |
| This method reads an RGB color. | |
| bool | WriteColor (LPCTSTR section, LPCTSTR entry, const TColor &clr) |
| This method writes an RGB color. | |
| bool | ReadColor (const tstring §ion, const tstring &entry, TColor &color) const |
| bool | WriteColor (const tstring §ion, const tstring &entry, const TColor &clr) |
| bool | ReadRect (LPCTSTR section, LPCTSTR entry, TRect &val) const |
| This method reads a TRect. | |
| bool | WriteRect (LPCTSTR section, LPCTSTR entry, const TRect &rc) |
| This method writes a TRect. | |
| bool | ReadRect (const tstring §ion, const tstring &entry, TRect &val) const |
| bool | WriteRect (const tstring §ion, const tstring &entry, const TRect &rc) |
| bool | ReadPoint (LPCTSTR section, LPCTSTR entry, TPoint &val) const |
| This method reads a TPoint. | |
| bool | WritePoint (LPCTSTR section, LPCTSTR entry, const TPoint &point) |
| This method writes a TPoint. | |
| bool | ReadPoint (const tstring §ion, const tstring &entry, TPoint &val) const |
| bool | WritePoint (const tstring §ion, const tstring &entry, const TPoint &point) |
| bool | ReadSize (LPCTSTR section, LPCTSTR entry, TSize &sz) const |
| This method reads a TSize. | |
| bool | WriteSize (LPCTSTR section, LPCTSTR entry, const TSize &size) |
| This method writes a TSize. | |
| bool | ReadSize (const tstring §ion, const tstring &entry, TSize &sz) const |
| bool | WriteSize (const tstring §ion, const tstring &entry, const TSize &size) |
Static Public Member Functions | |
| static void | SetPrecision (int newprec=-1) |
| static int | GetPrecision () |
Static Protected Member Functions | |
| 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. | |
Protected Attributes | |
| tstring | FileName |
Static Protected Attributes | |
| static int | DefaultPrecision = -1 |
Save/Load configuration parameters Base abstract class.
Definition at line 48 of file configfl.h.
|
inline |
Constructs instance and sets FileName to name.
Definition at line 54 of file configfl.h.
References FileName.
|
inlinevirtual |
Destroys the instance.
Definition at line 57 of file configfl.h.
|
staticprotected |
This static method returns yes or no given a boolean value.
Definition at line 102 of file configfl.cpp.
Definition at line 389 of file configfl.h.
References EraseEntry().
|
pure virtual |
Implemented in owl::TIniConfigFile, owl::TMemConfigFile, and owl::TRegConfigFile.
|
inline |
Definition at line 383 of file configfl.h.
References EraseSection().
|
pure virtual |
Implemented in owl::TIniConfigFile, owl::TMemConfigFile, and owl::TRegConfigFile.
|
inline |
Definition at line 63 of file configfl.h.
References FileName.
|
inlinestatic |
Definition at line 61 of file configfl.h.
References DefaultPrecision.
|
virtual |
Reimplemented in owl::TMemConfigFile.
Definition at line 144 of file configfl.cpp.
References TConfigFile(), _T, _tcslen, owl::is_integer(), MAX_PATH, ReadInteger(), ReadSection(), ReadSections(), ReadString(), WriteInteger(), and WriteString().
|
inline |
Definition at line 439 of file configfl.h.
References ReadBool().
| bool owl::TConfigFile::ReadBool | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| bool | defval = false ) const |
This method reads a boolean value.
Definition at line 388 of file configfl.cpp.
References _T, _tcslen, COUNTOF, PRECONDITION, ReadString(), and StringToBool().
|
inline |
Definition at line 507 of file configfl.h.
References ReadColor().
| bool owl::TConfigFile::ReadColor | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| TColor & | color ) const |
This method reads an RGB color.
Definition at line 742 of file configfl.cpp.
References _T, _tcschr, _tcslen, _ttoi, COUNTOF, PRECONDITION, and ReadString().
|
inline |
Definition at line 396 of file configfl.h.
References ReadData().
|
virtual |
This method reads binary data.
Reimplemented in owl::TIniConfigFile, and owl::TRegConfigFile.
Definition at line 193 of file configfl.cpp.
References _stscanf, _T, _tcslen, PRECONDITION, and ReadString().
|
inline |
Definition at line 453 of file configfl.h.
References ReadDate().
| bool owl::TConfigFile::ReadDate | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| TDate & | value ) const |
Definition at line 416 of file configfl.cpp.
References owl::TDate::TDate(), _T, PRECONDITION, and ReadString().
|
inline |
Definition at line 425 of file configfl.h.
References ReadDouble().
| double owl::TConfigFile::ReadDouble | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| double | defval = 0.0 ) const |
Definition at line 333 of file configfl.cpp.
References _T, _tcslen, _tcstod, COUNTOF, PRECONDITION, and ReadString().
|
inline |
Definition at line 493 of file configfl.h.
References ReadFont().
| bool owl::TConfigFile::ReadFont | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| LOGFONT & | pFont ) const |
This method will take a profile string of the form:
and fills in a logfont structure.
Definition at line 521 of file configfl.cpp.
References _T, _tcscat, _tcschr, _tcscpy, _tcslen, _tcstok, _ttoi, MAX_PATH, PRECONDITION, and ReadString().
|
inline |
Definition at line 411 of file configfl.h.
References ReadInteger().
|
virtual |
This method reads an integer.
Reimplemented in owl::TRegConfigFile.
Definition at line 236 of file configfl.cpp.
References _T, _tcstol, COUNTOF, PRECONDITION, and ReadString().
|
inline |
Definition at line 535 of file configfl.h.
References ReadPoint().
| bool owl::TConfigFile::ReadPoint | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| TPoint & | val ) const |
This method reads a TPoint.
Definition at line 796 of file configfl.cpp.
References _T, PRECONDITION, and ReadString().
|
inline |
Definition at line 521 of file configfl.h.
References ReadRect().
| bool owl::TConfigFile::ReadRect | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| TRect & | val ) const |
This method reads a TRect.
Definition at line 822 of file configfl.cpp.
References _T, PRECONDITION, and ReadString().
Definition at line 280 of file configfl.cpp.
References ReadSection().
|
pure virtual |
Implemented in owl::TIniConfigFile, owl::TMemConfigFile, and owl::TRegConfigFile.
Implemented in owl::TIniConfigFile, owl::TMemConfigFile, and owl::TRegConfigFile.
| int owl::TConfigFile::ReadSections | ( | tstring & | sections | ) | const |
Definition at line 299 of file configfl.cpp.
References ReadSections().
|
inline |
Definition at line 549 of file configfl.h.
References ReadSize().
| bool owl::TConfigFile::ReadSize | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| TSize & | sz ) const |
This method reads a TSize.
Definition at line 848 of file configfl.cpp.
References _T, PRECONDITION, and ReadString().
|
inline |
Definition at line 89 of file configfl.h.
References ReadString().
| uint owl::TConfigFile::ReadString | ( | const tstring & | section, |
| const tstring & | entry, | ||
| tstring & | buffer, | ||
| LPCTSTR | defstr = 0 ) const |
String-aware overload.
Definition at line 318 of file configfl.cpp.
References _T, MAX_PATH, and ReadString().
|
pure virtual |
Implemented in owl::TIniConfigFile, owl::TMemConfigFile, and owl::TRegConfigFile.
|
inline |
Definition at line 467 of file configfl.h.
References ReadSystemTime().
| bool owl::TConfigFile::ReadSystemTime | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| TSystemTime & | val ) const |
Definition at line 444 of file configfl.cpp.
References owl::TSystemTime::TSystemTime(), _stscanf, _T, _tcslen, COUNTOF, PRECONDITION, and ReadString().
|
inline |
Definition at line 481 of file configfl.h.
References ReadTime().
| bool owl::TConfigFile::ReadTime | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| TTime & | val ) const |
Definition at line 472 of file configfl.cpp.
References owl::TTime::TTime(), _stscanf, _T, _tcslen, COUNTOF, PRECONDITION, and ReadString().
|
inline |
Definition at line 377 of file configfl.h.
References SectionExists().
|
virtual |
Reimplemented in owl::TRegConfigFile.
Definition at line 872 of file configfl.cpp.
References PRECONDITION, and ReadSection().
|
inlinestatic |
Definition at line 60 of file configfl.h.
References DefaultPrecision.
|
staticprotected |
This static method converts a string to a bool, accepting most common boolean keywords: yes, on, true and 1.
Definition at line 77 of file configfl.cpp.
References _tcsicmp, and PRECONDITION.
|
pure virtual |
Implemented in owl::TIniConfigFile, owl::TMemConfigFile, and owl::TRegConfigFile.
|
inline |
Definition at line 446 of file configfl.h.
References WriteBool().
| bool owl::TConfigFile::WriteBool | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| bool | val ) |
This method writes a bool.
Definition at line 408 of file configfl.cpp.
References BoolToString(), PRECONDITION, and WriteString().
|
inline |
Definition at line 514 of file configfl.h.
References WriteColor().
| bool owl::TConfigFile::WriteColor | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| const TColor & | clr ) |
This method writes an RGB color.
Definition at line 784 of file configfl.cpp.
References _T, owl::TColor::Blue(), owl::TColor::Green(), PRECONDITION, owl::TColor::Red(), and WriteString().
|
inline |
Definition at line 403 of file configfl.h.
References WriteData().
|
virtual |
This method writes binary data.
Reimplemented in owl::TIniConfigFile, and owl::TRegConfigFile.
Definition at line 219 of file configfl.cpp.
References _stprintf, _T, PRECONDITION, and WriteString().
|
inline |
Definition at line 460 of file configfl.h.
References WriteDate().
| bool owl::TConfigFile::WriteDate | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| const TDate & | val ) |
Definition at line 432 of file configfl.cpp.
References owl::TDate::AsString(), owl::TDate::Numbers, PRECONDITION, owl::TDate::SetPrintOption(), and WriteString().
|
inline |
Definition at line 432 of file configfl.h.
References WriteDouble().
| bool owl::TConfigFile::WriteDouble | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| double | value ) |
This method writes an integer.
Definition at line 354 of file configfl.cpp.
References _itot, _stprintf, _T, DefaultPrecision, PRECONDITION, and WriteString().
|
inline |
Definition at line 500 of file configfl.h.
References WriteFont().
| bool owl::TConfigFile::WriteFont | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| const LOGFONT & | logFont ) |
This method writes a font description in the following format:
Definition at line 651 of file configfl.cpp.
References _itot, _T, PRECONDITION, and WriteString().
|
inline |
Definition at line 418 of file configfl.h.
References WriteInteger().
|
virtual |
This method writes an integer. We format it as a string.
Reimplemented in owl::TRegConfigFile.
Definition at line 257 of file configfl.cpp.
References _ltot, _T, PRECONDITION, and WriteString().
|
inline |
Definition at line 542 of file configfl.h.
References WritePoint().
| bool owl::TConfigFile::WritePoint | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| const TPoint & | point ) |
This method writes a TPoint.
Definition at line 810 of file configfl.cpp.
References _T, PRECONDITION, and WriteString().
|
inline |
Definition at line 528 of file configfl.h.
References WriteRect().
| bool owl::TConfigFile::WriteRect | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| const TRect & | rc ) |
This method writes a TRect.
Definition at line 836 of file configfl.cpp.
References _T, owl::TRect::Height(), PRECONDITION, owl::TRect::Width(), and WriteString().
|
inline |
Definition at line 556 of file configfl.h.
References WriteSize().
| bool owl::TConfigFile::WriteSize | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| const TSize & | size ) |
This method writes a TSize.
Definition at line 862 of file configfl.cpp.
References _T, PRECONDITION, and WriteString().
|
inline |
Definition at line 563 of file configfl.h.
References WriteString().
|
pure virtual |
Implemented in owl::TIniConfigFile, owl::TMemConfigFile, and owl::TRegConfigFile.
References ReadData(), ReadInteger(), WriteData(), and WriteInteger().
|
inline |
Definition at line 474 of file configfl.h.
References WriteSystemTime().
| bool owl::TConfigFile::WriteSystemTime | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| const TSystemTime & | val ) |
Definition at line 461 of file configfl.cpp.
References _T, PRECONDITION, and WriteString().
|
inline |
Definition at line 487 of file configfl.h.
References WriteTime().
| bool owl::TConfigFile::WriteTime | ( | LPCTSTR | section, |
| LPCTSTR | entry, | ||
| TTime & | val ) |
Definition at line 488 of file configfl.cpp.
References _T, owl::TTime::Hour(), owl::TTime::Minute(), PRECONDITION, owl::TTime::Second(), and WriteString().
|
staticprotected |
Definition at line 154 of file configfl.h.
|
protected |
Definition at line 153 of file configfl.h.