|
OWLNext 7.0
Borland's Object Windows Library for the modern age
|
#include <owl/configfl.h>
Public Member Functions | |
| TMemConfigFile (const tstring &name) | |
| virtual | ~TMemConfigFile () |
| virtual void | LoadValues (const TConfigFile &file) |
| virtual uint | ReadSection (LPCTSTR section, TCHAR *buffer, uint bufSize) const |
| Copies all value names of the given section to the specified buffer. | |
| virtual uint | ReadSections (TCHAR *buffer, uint bufSize) const |
| Copies all section names to the specified buffer. | |
| virtual bool | EraseSection (LPCTSTR section) |
| virtual bool | EraseEntry (LPCTSTR section, LPCTSTR entry) |
| virtual void | UpdateFile () |
| virtual uint | ReadString (LPCTSTR section, LPCTSTR entry, TCHAR *buffer, uint bufSize, LPCTSTR defstr=0) const |
| Looks up the value of the given entry of the given section, and if found, copies it to the given buffer. | |
| virtual bool | WriteString (LPCTSTR section, LPCTSTR entry, LPCTSTR value) |
| void | Flush () |
| void | LoadFromFile () |
| 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) |
| Public Member Functions inherited from owl::TConfigFile | |
| TConfigFile (const tstring &name) | |
| Constructs instance and sets FileName to name. | |
| virtual | ~TConfigFile () |
| Destroys the instance. | |
| const tstring & | GetFileName () const |
| virtual bool | SectionExists (LPCTSTR section) const |
| 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) |
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. | |
| Protected Attributes inherited from owl::TConfigFile | |
| tstring | FileName |
| Static Protected Attributes inherited from owl::TConfigFile | |
| static int | DefaultPrecision = -1 |
Definition at line 289 of file configfl.h.
| owl::TMemConfigFile::TMemConfigFile | ( | const tstring & | name | ) |
Definition at line 1052 of file configfl.cpp.
References owl::TConfigFile::TConfigFile().
|
virtual |
Definition at line 1059 of file configfl.cpp.
References Flush().
|
inline |
Definition at line 86 of file configfl.h.
|
virtual |
|
inline |
Definition at line 85 of file configfl.h.
|
virtual |
| void owl::TMemConfigFile::Flush | ( | ) |
Definition at line 1065 of file configfl.cpp.
| void owl::TMemConfigFile::LoadFromFile | ( | ) |
Definition at line 1258 of file configfl.cpp.
References _T, _tcslen, owl::TConfigFile::FileName, and owl::TFile::IsOpen().
|
virtual |
Reimplemented from owl::TConfigFile.
Definition at line 1070 of file configfl.cpp.
References owl::TConfigFile::TConfigFile(), Flush(), and owl::TConfigFile::LoadValues().
| int owl::TConfigFile::ReadSection | ( | const tstring & | section, |
| tstring & | buffer ) const |
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 1106 of file configfl.cpp.
References _T, _tcsncpy, and PRECONDITION.
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 1139 of file configfl.cpp.
References _T, _tcsncpy, and PRECONDITION.
| int owl::TConfigFile::ReadSections | ( | tstring & | sections | ) | const |
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 1172 of file configfl.cpp.
References TMemConfigFile(), _T, _tcslen, _tcsncpy, owl::TMSortedObjectArray< T, A >::Find(), owl::TArrayBase::NPOS, and PRECONDITION.
|
virtual |
Implements owl::TConfigFile.
Definition at line 1212 of file configfl.cpp.
References _T, owl::TFile::CreateAlways, owl::TConfigFile::FileName, owl::TFile::IsOpen(), MAX_PATH, and owl::TFile::WriteOnly.
|
inline |
Definition at line 91 of file configfl.h.
|
virtual |
Implements owl::TConfigFile.
Definition at line 1196 of file configfl.cpp.
References owl::TMSortedObjectArray< T, A >::Find(), and PRECONDITION.