OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
configfl.h
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1998 by Yura Bidus
4//
5/// \file
6/// This header file declares the class: TConfigFile,TIniConfigFile,
7/// TRegConfigFile and TConfigFileSection.
8//
9// Log History:
10// 03/27/99 - Added Read/WriteData sugested by Jogy
11// 06/17/2002 - Added variations of functions with tstring as parameter
12//------------------------------------------------------------------------------
13
14#if !defined(OWL_CONFIGFL_H)
15#define OWL_CONFIGFL_H
16
17#include <owl/private/defs.h>
18#if defined(BI_HAS_PRAGMA_ONCE)
19# pragma once
20#endif
21
22#include <owl/defs.h>
23#include <owl/registry.h>
24
25namespace owl {
26
27class _OWLCLASS TDate;
28class _OWLCLASS TTime;
29class _OWLCLASS TSystemTime;
30class _OWLCLASS TPoint;
31class _OWLCLASS TRect;
32class _OWLCLASS TSize;
33class _OWLCLASS TFont;
34class _OWLCLASS TColor;
35
36
37#include <owl/preclass.h>
38
39/// \addtogroup winsys
40/// @{
41
42
43/// \class TConfigFile
44// ~~~~~ ~~~~~~~~~~~
45/// Save/Load configuration parameters
46/// Base abstract class
47//
49 public:
50
51 //
52 /// Constructs instance and sets FileName to name.
53 //
54 TConfigFile(const tstring& name) : FileName(name) {}
55
56/// Destroys the instance.
57 virtual ~TConfigFile(){}
58
59 // -1 = pring default(%1.20Lg), == 0 not use precision(%Lg), else use specified
60 static void SetPrecision(int newprec = -1){ DefaultPrecision = newprec; }
61 static int GetPrecision(){ return DefaultPrecision; }
62
63 const tstring& GetFileName() const {return FileName;}
64 virtual void LoadValues(const TConfigFile& file);
65
66 virtual bool SectionExists(LPCTSTR section) const;
69 virtual bool EraseSection(LPCTSTR section) = 0;
71 virtual void UpdateFile() = 0;
72
75
76 virtual bool ReadData(LPCTSTR section, LPCTSTR entry, void* buffer, uint size) const;
77 virtual bool WriteData(LPCTSTR section, LPCTSTR entry, void* buffer, uint size);
78
79 virtual int ReadInteger(LPCTSTR section, LPCTSTR entry,int defint=0) const;
80 virtual bool WriteInteger(LPCTSTR section, LPCTSTR entry, int value);
81
82 bool SectionExists(const tstring& section) const;
83 int ReadSection(const tstring& section, tstring& buffer) const;
84 int ReadSections(tstring& sections) const;
85 bool EraseSection(const tstring& section);
86 bool EraseEntry(const tstring& section, const tstring& entry);
87
88 uint ReadString(const tstring& section, const tstring& entry, tstring& buffer, LPCTSTR defstr=0) const;
90 {return ReadString(section, entry, buffer, defstr.c_str());}
91 bool WriteString(const tstring& section, const tstring& entry, const tstring& value);
92
93 bool ReadData(const tstring& section, const tstring& entry, void* buffer, uint size) const;
94 bool WriteData(const tstring& section, const tstring& entry, void* buffer, uint size);
95
96 int ReadInteger(const tstring& section, const tstring& entry,int defint=0) const;
97 bool WriteInteger(const tstring& section, const tstring& entry, int value);
98
99 double ReadDouble(LPCTSTR section, LPCTSTR entry, double defval=0.0) const;
100 bool WriteDouble(LPCTSTR section, LPCTSTR entry, double value);
101 double ReadDouble(const tstring& section, const tstring& entry, double defval=0.0) const;
102 bool WriteDouble(const tstring& section, const tstring& entry, double value);
103
104 bool ReadBool(LPCTSTR section, LPCTSTR entry, bool defval=false) const;
105 bool WriteBool(LPCTSTR section, LPCTSTR entry, bool val);
106 bool ReadBool(const tstring& section, const tstring& entry, bool defval=false) const;
107 bool WriteBool(const tstring& section, const tstring& entry, bool val);
108
109 bool ReadDate(LPCTSTR section, LPCTSTR entry, TDate& value) const;
110 bool WriteDate(LPCTSTR section, LPCTSTR entry, const TDate& val);
111 bool ReadDate(const tstring& section, const tstring& entry, TDate& value) const;
112 bool WriteDate(const tstring& section, const tstring& entry, const TDate& val);
113
114 bool ReadSystemTime(LPCTSTR section, LPCTSTR entry, TSystemTime& val) const;
115 bool WriteSystemTime(LPCTSTR section, LPCTSTR entry, const TSystemTime& val);
116 bool ReadSystemTime(const tstring& section, const tstring& entry, TSystemTime& val) const;
117 bool WriteSystemTime(const tstring& section, const tstring& entry, const TSystemTime& val);
118
119 bool ReadTime(LPCTSTR section, LPCTSTR entry, TTime& val) const;
120 bool WriteTime(LPCTSTR section, LPCTSTR entry, TTime& val);
121 bool ReadTime(const tstring& section, const tstring& entry, TTime& val) const;
122 bool WriteTime(const tstring& section, const tstring& entry, TTime& val);
123
124 bool ReadFont(LPCTSTR section, LPCTSTR entry, LOGFONT& font) const;
125 bool WriteFont(LPCTSTR section, LPCTSTR entry, const LOGFONT& font);
126 bool ReadFont(const tstring& section, const tstring& entry, LOGFONT& font) const;
127 bool WriteFont(const tstring& section, const tstring& entry, const LOGFONT& font);
128
129 bool ReadColor(LPCTSTR section, LPCTSTR entry, TColor& color) const;
130 bool WriteColor(LPCTSTR section, LPCTSTR entry, const TColor& clr);
131 bool ReadColor(const tstring& section, const tstring& entry, TColor& color) const;
132 bool WriteColor(const tstring& section, const tstring& entry, const TColor& clr);
133
134 bool ReadRect(LPCTSTR section, LPCTSTR entry, TRect& val) const;
135 bool WriteRect(LPCTSTR section, LPCTSTR entry, const TRect& rc);
136 bool ReadRect(const tstring& section, const tstring& entry, TRect& val) const;
137 bool WriteRect(const tstring& section, const tstring& entry, const TRect& rc);
138
139 bool ReadPoint(LPCTSTR section, LPCTSTR entry, TPoint& val)const;
140 bool WritePoint(LPCTSTR section, LPCTSTR entry, const TPoint& point);
141 bool ReadPoint(const tstring& section, const tstring& entry, TPoint& val)const;
142 bool WritePoint(const tstring& section, const tstring& entry, const TPoint& point);
143
144 bool ReadSize(LPCTSTR section, LPCTSTR entry, TSize& sz) const;
145 bool WriteSize(LPCTSTR section, LPCTSTR entry, const TSize& size);
146 bool ReadSize(const tstring& section, const tstring& entry, TSize& sz) const;
147 bool WriteSize(const tstring& section, const tstring& entry, const TSize& size);
148 protected:
149 static bool StringToBool(LPCTSTR str, bool* val);
150 static tstring BoolToString(bool val);
151
152 protected:
155};
156
157//
158/// \class TConfigFileSection
159// ~~~~~ ~~~~~~~~~~~~~~~~~~
160/// Small inline wrapper around Section.
161/// ConfigFile must exist all the time while the section exist!
162//
164 public:
165
168
169 const tstring& GetSection() {return Section;}
170
171 bool Erase() { return File.EraseSection(Section.c_str()); }
172 bool EraseEntry(LPCTSTR entry);
173
174 uint ReadString(LPCTSTR entry, LPTSTR buffer, uint bufSize, LPCTSTR defstr=0) const;
175 bool WriteString(LPCTSTR entry, LPCTSTR value);
176 uint ReadString(const tstring& entry, tstring& buffer, LPCTSTR defstr=0) const;
178 {return ReadString(entry, buffer, defstr.c_str());}
179 bool WriteString(const tstring& entry, const tstring& value);
180
181 bool ReadData(LPCTSTR entry, void* buffer, uint size) const;
182 bool WriteData(LPCTSTR entry, void* buffer, uint size);
183 bool ReadData(const tstring& entry, void* buffer, uint size) const;
184 bool WriteData(const tstring& entry, void* buffer, uint size);
185
186 int ReadInteger(LPCTSTR entry,int defint=0) const ;
187 bool WriteInteger(LPCTSTR entry, int value);
188 int ReadInteger(const tstring& entry,int defint=0) const ;
189 bool WriteInteger(const tstring& entry, int value);
190
191 double ReadDouble(LPCTSTR entry, double defval) const;
192 bool WriteDouble(LPCTSTR entry, double defval);
193 double ReadDouble(const tstring& entry, double defval) const;
194 bool WriteDouble(const tstring& entry, double defval);
195
196 bool ReadBool(LPCTSTR entry, bool defval) const;
197 bool WriteBool(LPCTSTR entry, bool val);
198 bool ReadBool(const tstring& entry, bool defval) const;
199 bool WriteBool(const tstring& entry, bool val);
200
201 bool ReadDate(LPCTSTR entry, TDate& value) const;
202 bool WriteDate(LPCTSTR entry, const TDate& val);
203 bool ReadDate(const tstring& entry, TDate& value) const;
204 bool WriteDate(const tstring& entry, const TDate& val);
205
206 bool ReadSystemTime(LPCTSTR entry, TSystemTime& val) const;
207 bool WriteSystemTime(LPCTSTR entry, const TSystemTime& val);
208 bool ReadSystemTime(const tstring& entry, TSystemTime& val) const;
209 bool WriteSystemTime(const tstring& entry, const TSystemTime& val);
210
211 bool ReadTime(LPCTSTR entry, TTime& val) const;
212 bool WriteTime(LPCTSTR entry, TTime& val);
213 bool ReadTime(const tstring& entry, TTime& val) const;
214 bool WriteTime(const tstring& entry, TTime& val);
215
216 bool ReadFont(LPCTSTR entry, LOGFONT& font) const;
217 bool WriteFont(LPCTSTR entry, const LOGFONT& font);
218 bool ReadFont(const tstring& entry, LOGFONT& font) const;
219 bool WriteFont(const tstring& entry, const LOGFONT& font);
220
221 bool ReadColor(LPCTSTR entry, TColor& color) const;
222 bool WriteColor(LPCTSTR entry, const TColor& clr);
223 bool ReadColor(const tstring& entry, TColor& color) const;
224 bool WriteColor(const tstring& entry, const TColor& clr);
225
226 bool ReadRect(LPCTSTR entry, TRect& val) const;
227 bool WriteRect(LPCTSTR entry, const TRect& rc);
228 bool ReadRect(const tstring& entry, TRect& val) const;
229 bool WriteRect(const tstring& entry, const TRect& rc);
230
231 bool ReadPoint(LPCTSTR entry, TPoint& val)const;
232 bool WritePoint(LPCTSTR entry, const TPoint& point);
233 bool ReadPoint(const tstring& entry, TPoint& val)const;
234 bool WritePoint(const tstring& entry, const TPoint& point);
235
236 bool ReadSize(LPCTSTR entry, TSize& sz) const;
237 bool WriteSize(LPCTSTR entry, const TSize& size);
238 bool ReadSize(const tstring& entry, TSize& sz) const;
239 bool WriteSize(const tstring& entry, const TSize& size);
240
241 protected:
244};
245
246/// \class TIniConfigFile
247/// Encapsulates the Windows INI file interface
248/// Get/SetPrivateProfileXXX functions
250 public:
251
254
255 virtual ~TIniConfigFile(){}
256
257 virtual uint ReadSection(LPCTSTR section, LPTSTR buffer, uint bufSize) const;
258 virtual uint ReadSections(LPTSTR buffer, uint bufSize) const;
259 virtual bool EraseSection(LPCTSTR section);
260 virtual bool EraseEntry(LPCTSTR section, LPCTSTR entry);
261 virtual void UpdateFile();
262
263 virtual uint ReadString(LPCTSTR section, LPCTSTR entry, LPTSTR buffer, uint bufSize, LPCTSTR defstr=0) const;
264 virtual bool WriteString(LPCTSTR section, LPCTSTR entry, LPCTSTR value);
265 virtual bool ReadData(LPCTSTR section, LPCTSTR entry, void* buffer, uint size) const;
266 virtual bool WriteData(LPCTSTR section, LPCTSTR entry, void* buffer, uint size);
267
268 // Overloads from base
269
270 using TConfigFile::ReadSection;
271 using TConfigFile::ReadSections;
272 using TConfigFile::EraseSection;
273 using TConfigFile::EraseEntry;
274
275 using TConfigFile::ReadString;
276 using TConfigFile::WriteString;
277 using TConfigFile::ReadData;
278 using TConfigFile::WriteData;
279};
280
281////////////////////////////////////////////////////////////////////////////
282//
283/// \class TMemConfigFile
284// ~~~~~ ~~~~~~~~~~~~~~
285/// Derived from TConfigFile, TMemConfigFile is used to maintain configuration
286/// settings in memory.
287//
288class TMemConfigFileSections;
290 private:
291 TMemConfigFileSections* Sections;
292
293 int AddSection(const tstring& section);
294
295 public:
297 virtual ~TMemConfigFile();
298 virtual void LoadValues(const TConfigFile& file);
299
300 virtual uint ReadSection(LPCTSTR section, LPTSTR buffer, uint bufSize) const;
301 virtual uint ReadSections(LPTSTR buffer, uint bufSize) const;
302 virtual bool EraseSection(LPCTSTR section);
303 virtual bool EraseEntry(LPCTSTR section, LPCTSTR entry);
304 virtual void UpdateFile();
305
306 virtual uint ReadString(LPCTSTR section, LPCTSTR entry, LPTSTR buffer, uint bufSize, LPCTSTR defstr=0) const;
307 virtual bool WriteString(LPCTSTR section, LPCTSTR entry, LPCTSTR value);
308
309 // Overloads from base
310
311 using TConfigFile::ReadSection;
312 using TConfigFile::ReadSections;
313 using TConfigFile::EraseSection;
314 using TConfigFile::EraseEntry;
315
316 using TConfigFile::ReadString;
317 using TConfigFile::WriteString;
318
319 void Flush();
320 void LoadFromFile();
321};
322
323//
324/// \class TRegConfigFile
325// ~~~~~ ~~~~~~~~~~~~~~
326/// Derived from TConfigFile, TRegConfigFile is used to maintain configuration
327/// settings in the registry.
328//
330 public:
332 virtual ~TRegConfigFile();
333
334 // Override these to change storage technique:
335 //
336 virtual bool SectionExists(LPCTSTR section) const;
337 virtual uint ReadSection(LPCTSTR section, LPTSTR buffer, uint bufSize) const;
338 virtual uint ReadSections(LPTSTR buffer, uint bufSize) const;
339 virtual bool EraseSection(LPCTSTR section);
340 virtual bool EraseEntry(LPCTSTR section, LPCTSTR entry);
341 virtual void UpdateFile();
342
343 virtual int ReadInteger(LPCTSTR section, LPCTSTR entry,int defint=0) const;
344 virtual bool WriteInteger(LPCTSTR section, LPCTSTR entry, int value);
345 virtual uint ReadString(LPCTSTR section, LPCTSTR entry, LPTSTR buffer, uint bufSize, LPCTSTR defstr=0) const;
346 virtual bool WriteString(LPCTSTR section, LPCTSTR entry, LPCTSTR value);
347 virtual bool ReadData(LPCTSTR section, LPCTSTR entry, void* buffer, uint size) const;
348 virtual bool WriteData(LPCTSTR section, LPCTSTR entry, void* buffer, uint size);
349
350 // Overloads from base
351
352 using TConfigFile::SectionExists;
353 using TConfigFile::ReadSection;
354 using TConfigFile::ReadSections;
355 using TConfigFile::EraseSection;
356 using TConfigFile::EraseEntry;
357
358 using TConfigFile::ReadInteger;
359 using TConfigFile::WriteInteger;
360 using TConfigFile::ReadString;
361 using TConfigFile::WriteString;
362 using TConfigFile::ReadData;
363 using TConfigFile::WriteData;
364
365 protected:
367};
368
369/// @}
370
371#include <owl/posclass.h>
372
373//
374// Inlines
375//
376inline bool
378{
379 return SectionExists(section.c_str());
380}
381//
382inline bool
384{
385 return EraseSection(section.c_str());
386}
387//
388inline bool
390{
391 return EraseEntry(section.c_str(), entry.c_str());
392}
393
394//
395inline bool
397 void* buffer, uint size) const
398{
399 return ReadData(section.c_str(), entry.c_str(),buffer,size);
400}
401//
402inline bool
404 void* buffer, uint size)
405{
406 return WriteData(section.c_str(), entry.c_str(), buffer, size);
407}
408
409//
410inline int
412 int defint) const
413{
414 return ReadInteger(section.c_str(), entry.c_str(), defint);
415}
416//
417inline bool
419 int value)
420{
421 return WriteInteger(section.c_str(), entry.c_str(), value);
422}
423//
424inline double
426 double defval) const
427{
428 return ReadDouble(section.c_str(), entry.c_str(), defval);
429}
430//
431inline bool
433 double value)
434{
435 return WriteDouble(section.c_str(), entry.c_str(), value);
436}
437//
438inline bool
440 bool defval) const
441{
442 return ReadBool(section.c_str(), entry.c_str(), defval);
443}
444//
445inline bool
447 bool val)
448{
449 return WriteBool(section.c_str(), entry.c_str(), val);
450}
451//
452inline bool
454 TDate& value) const
455{
456 return ReadDate(section.c_str(), entry.c_str(), value);
457}
458//
459inline bool
461 const TDate& val)
462{
463 return WriteDate(section.c_str(), entry.c_str(), val);
464}
465//
466inline bool
468 const tstring& entry, TSystemTime& val) const
469{
470 return ReadSystemTime(section.c_str(), entry.c_str(), val);
471}
472//
473inline bool
475 const tstring& entry, const TSystemTime& val)
476{
477 return WriteSystemTime(section.c_str(), entry.c_str(), val);
478}
479//
480inline bool
482{
483 return ReadTime(section.c_str(), entry.c_str(), val);
484}
485//
486inline bool
488{
489 return WriteTime(section.c_str(), entry.c_str(), val);
490}
491//
492inline bool
494 LOGFONT& font) const
495{
496 return ReadFont(section.c_str(), entry.c_str(), font);
497}
498//
499inline bool
501 const LOGFONT& font)
502{
503 return WriteFont(section.c_str(), entry.c_str(), font);
504}
505//
506inline bool
508 TColor& color) const
509{
510 return ReadColor(section.c_str(), entry.c_str(), color);
511}
512//
513inline bool
515 const TColor& color)
516{
517 return WriteColor(section.c_str(), entry.c_str(), color);
518}
519//
520inline bool
522 TRect& val) const
523{
524 return ReadRect(section.c_str(), entry.c_str(), val);
525}
526//
527inline bool
529 const TRect& rc)
530{
531 return WriteRect(section.c_str(), entry.c_str(), rc);
532}
533//
534inline bool
536 TPoint& val) const
537{
538 return ReadPoint(section.c_str(), entry.c_str(), val);
539}
540//
541inline bool
543 const TPoint& point)
544{
545 return WritePoint(section.c_str(), entry.c_str(), point);
546}
547//
548inline bool
550 TSize& sz) const
551{
552 return ReadSize(section.c_str(), entry.c_str(), sz);
553}
554//
555inline bool
557 const TSize& size)
558{
559 return WriteSize(section.c_str(), entry.c_str(), size);
560}
561//
562inline bool
566//
567inline bool
569 const tstring& value)
570{
571 return WriteString(section.c_str(), entry.c_str(), value.c_str());
572}
573
574//
575//
576//
577inline bool
582
583//
584//
585//
586inline uint
592//
593//
594//
595inline bool
600//
601//
602//
603inline uint
609//
610//
611//
612inline bool
617//
618//
619//
620inline bool
622{
623 return File.ReadData(Section.c_str(), entry, buffer, size);
624}
625//
626//
627//
628inline bool
630{
631 return File.WriteData(Section.c_str(), entry, buffer, size);
632}
633//
634//
635//
636inline bool
638{
639 return File.ReadData(Section, entry, buffer, size);
640}
641//
642//
643//
644inline bool
646{
647 return File.WriteData(Section, entry, buffer, size);
648}
649//
650//
651//
652inline int
657//
658//
659//
660inline bool
665//
666//
667//
668inline int
670{
671 return File.ReadInteger(Section.c_str(), entry.c_str(), defint);
672}
673//
674//
675//
676inline bool
678{
679 return File.WriteInteger(Section.c_str(), entry.c_str(), value);
680}
681//
682//
683//
684inline double
686{
687 return File.ReadDouble(Section.c_str(), entry, defval);
688}
689//
690//
691//
692inline bool
697//
698//
699//
700inline double
702{
703 return File.ReadDouble(Section.c_str(), entry.c_str(), defval);
704}
705//
706//
707//
708inline bool
710{
711 return File.WriteDouble(Section.c_str(), entry.c_str(), defval);
712}
713//
714//
715//
716inline bool
718{
719 return File.ReadBool(Section.c_str(), entry, defval);
720}
721//
722//
723//
724inline bool
729//
730//
731//
732inline bool
734{
735 return File.ReadBool(Section, entry, defval);
736}
737//
738//
739//
740inline bool
745//
746//
747//
748inline bool
753//
754//
755//
756inline bool
761//
762//
763//
764inline bool
769//
770//
771//
772inline bool
777//
778//
779//
780inline bool
785//
786//
787//
788inline bool
793//
794//
795//
796inline bool
801//
802//
803//
804inline bool
809//
810//
811//
812inline bool
817//
818//
819//
820inline bool
825//
826//
827//
828inline bool
833//
834//
835//
836inline bool
841//
842//
843//
844inline bool
849//
850//
851//
852inline bool
857//
858//
859//
860inline bool
865//
866//
867//
868inline bool
873//
874//
875//
876inline bool
881//
882//
883//
884inline bool
889//
890//
891//
892inline bool
897//
898//
899//
900inline bool
905//
906//
907//
908inline bool
913//
914//
915//
916inline bool
921//
922//
923//
924inline bool
929//
930//
931//
932inline bool
937//
938//
939//
940inline bool
945//
946//
947//
948inline bool
953//
954//
955//
956inline bool
961//
962//
963//
964inline bool
969//
970//
971//
972inline bool
974{
975 return File.ReadSize(Section.c_str(), entry, size);
976}
977//
978//
979//
980inline bool
982{
983 return File.WriteSize(Section.c_str(), entry, size);
984}
985//
986//
987//
988inline bool
990{
991 return File.ReadSize(Section, entry, size);
992}
993//
994//
995//
996inline bool
998{
999 return File.WriteSize(Section, entry, size);
1000}
1001//
1002//
1003//
1004
1005//
1006//
1007//
1008} // OWL namespace
1009
1010
1011#endif // OWL_CONFIGFL_H
1012
Class wrapper for management of color values.
Definition color.h:245
Save/Load configuration parameters Base abstract class.
Definition configfl.h:48
TConfigFile(const tstring &name)
Constructs instance and sets FileName to name.
Definition configfl.h:54
virtual bool WriteData(LPCTSTR section, LPCTSTR entry, void *buffer, uint size)
This method writes binary data.
Definition configfl.cpp:219
static int DefaultPrecision
Definition configfl.h:154
bool ReadTime(LPCTSTR section, LPCTSTR entry, TTime &val) const
Definition configfl.cpp:472
virtual bool EraseSection(LPCTSTR section)=0
bool ReadColor(LPCTSTR section, LPCTSTR entry, TColor &color) const
This method reads an RGB color.
Definition configfl.cpp:742
double ReadDouble(LPCTSTR section, LPCTSTR entry, double defval=0.0) const
Definition configfl.cpp:333
virtual bool WriteInteger(LPCTSTR section, LPCTSTR entry, int value)
This method writes an integer. We format it as a string.
Definition configfl.cpp:257
bool WriteRect(LPCTSTR section, LPCTSTR entry, const TRect &rc)
This method writes a rectangle.
Definition configfl.cpp:883
static int GetPrecision()
Definition configfl.h:61
bool ReadDate(LPCTSTR section, LPCTSTR entry, TDate &value) const
Definition configfl.cpp:416
virtual bool SectionExists(LPCTSTR section) const
Definition configfl.cpp:905
bool WriteFont(LPCTSTR section, LPCTSTR entry, const LOGFONT &font)
This method writes a font description in the following format:
Definition configfl.cpp:651
virtual ~TConfigFile()
Destroys the instance.
Definition configfl.h:57
bool WriteColor(LPCTSTR section, LPCTSTR entry, const TColor &clr)
This method writes an RGB color.
Definition configfl.cpp:784
bool ReadPoint(LPCTSTR section, LPCTSTR entry, TPoint &val) const
Definition configfl.cpp:796
bool WriteDouble(LPCTSTR section, LPCTSTR entry, double value)
This method writes an integer.
Definition configfl.cpp:354
const tstring & GetFileName() const
Definition configfl.h:63
virtual uint ReadSections(TCHAR *sections, uint bufSize) const =0
virtual bool EraseEntry(LPCTSTR section, LPCTSTR entry)=0
bool WriteTime(LPCTSTR section, LPCTSTR entry, TTime &val)
Definition configfl.cpp:488
bool WriteDate(LPCTSTR section, LPCTSTR entry, const TDate &val)
Definition configfl.cpp:432
bool WriteSystemTime(LPCTSTR section, LPCTSTR entry, const TSystemTime &val)
Definition configfl.cpp:461
static void SetPrecision(int newprec=-1)
Definition configfl.h:60
bool ReadSize(LPCTSTR section, LPCTSTR entry, TSize &sz) const
Definition configfl.h:563
virtual void UpdateFile()=0
bool ReadBool(LPCTSTR section, LPCTSTR entry, bool defval=false) const
This method reads a boolean value.
Definition configfl.cpp:388
bool ReadRect(LPCTSTR section, LPCTSTR entry, TRect &val) const
This method reads a rectangle.
Definition configfl.cpp:844
tstring FileName
Definition configfl.h:153
bool WritePoint(LPCTSTR section, LPCTSTR entry, const TPoint &point)
This method writes a TPoint.
Definition configfl.cpp:832
virtual uint ReadSection(LPCTSTR section, TCHAR *buffer, uint bufSize) const =0
virtual int ReadInteger(LPCTSTR section, LPCTSTR entry, int defint=0) const
This method reads an integer.
Definition configfl.cpp:236
bool WriteSize(LPCTSTR section, LPCTSTR entry, const TSize &size)
This method writes a TSize.
Definition configfl.cpp:895
bool ReadFont(LPCTSTR section, LPCTSTR entry, LOGFONT &font) const
This method will take a profile string of the form:
Definition configfl.cpp:521
virtual bool ReadData(LPCTSTR section, LPCTSTR entry, void *buffer, uint size) const
This method reads binary data.
Definition configfl.cpp:193
bool WriteBool(LPCTSTR section, LPCTSTR entry, bool val)
This method writes a bool.
Definition configfl.cpp:408
uint ReadString(const tstring &section, const tstring &entry, tstring &buffer, const tstring &defstr) const
Definition configfl.h:89
bool ReadSystemTime(LPCTSTR section, LPCTSTR entry, TSystemTime &val) const
Definition configfl.cpp:444
virtual bool WriteString(LPCTSTR section, LPCTSTR entry, LPCTSTR value)=0
virtual uint ReadString(LPCTSTR section, LPCTSTR entry, TCHAR *buffer, uint bufSize, LPCTSTR defstr=0) const =0
Small inline wrapper around Section.
Definition configfl.h:163
bool WriteRect(LPCTSTR entry, const TRect &rc)
Definition configfl.h:917
bool WriteSize(LPCTSTR entry, const TSize &size)
Definition configfl.h:981
bool ReadData(LPCTSTR entry, void *buffer, uint size) const
Definition configfl.h:621
int ReadInteger(LPCTSTR entry, int defint=0) const
Definition configfl.h:653
TConfigFileSection(TConfigFile &file, const tstring &section)
Definition configfl.h:166
bool ReadFont(LPCTSTR entry, LOGFONT &font) const
Definition configfl.h:845
double ReadDouble(LPCTSTR entry, double defval) const
Definition configfl.h:685
bool WriteString(LPCTSTR entry, LPCTSTR value)
Definition configfl.h:596
bool ReadTime(LPCTSTR entry, TTime &val) const
Definition configfl.h:813
bool ReadDate(LPCTSTR entry, TDate &value) const
Definition configfl.h:749
bool WriteTime(LPCTSTR entry, TTime &val)
Definition configfl.h:821
bool ReadRect(LPCTSTR entry, TRect &val) const
Definition configfl.h:909
TConfigFile & File
Definition configfl.h:243
bool WriteInteger(LPCTSTR entry, int value)
Definition configfl.h:661
uint ReadString(LPCTSTR entry, TCHAR *buffer, uint bufSize, LPCTSTR defstr=0) const
Definition configfl.h:587
bool WriteData(LPCTSTR entry, void *buffer, uint size)
Definition configfl.h:629
bool WriteBool(LPCTSTR entry, bool val)
Definition configfl.h:725
bool EraseEntry(LPCTSTR entry)
Definition configfl.h:578
const tstring & GetSection()
Definition configfl.h:169
bool WriteFont(LPCTSTR entry, const LOGFONT &font)
Definition configfl.h:853
uint ReadString(const tstring &entry, tstring &buffer, const tstring &defstr) const
Definition configfl.h:177
bool WritePoint(LPCTSTR entry, const TPoint &point)
Definition configfl.h:949
bool ReadColor(LPCTSTR entry, TColor &color) const
Definition configfl.h:877
bool ReadPoint(LPCTSTR entry, TPoint &val) const
Definition configfl.h:941
bool WriteSystemTime(LPCTSTR entry, const TSystemTime &val)
Definition configfl.h:789
bool WriteDate(LPCTSTR entry, const TDate &val)
Definition configfl.h:757
bool WriteDouble(LPCTSTR entry, double defval)
Definition configfl.h:693
bool WriteColor(LPCTSTR entry, const TColor &clr)
Definition configfl.h:885
bool ReadSystemTime(LPCTSTR entry, TSystemTime &val) const
Definition configfl.h:781
bool ReadSize(LPCTSTR entry, TSize &sz) const
Definition configfl.h:973
bool ReadBool(LPCTSTR entry, bool defval) const
Definition configfl.h:717
The TDate class represents a date.
Definition date.h:48
Encapsulates the Windows INI file interface Get/SetPrivateProfileXXX functions.
Definition configfl.h:249
virtual ~TIniConfigFile()
Definition configfl.h:255
TIniConfigFile(const tstring &name)
Definition configfl.h:252
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
Derived from TConfigFile, TRegConfigFile is used to maintain configuration settings in the registry.
Definition configfl.h:329
Encapsulates a registration key in the Windows Registry.
Definition registry.h:115
The tagSIZE struct is defined as.
Definition geometry.h:234
TSystemTime is a class derived from the structure SYSTEMTIME.
Definition wsyscls.h:420
The TTime class encapsulates time functions and characteristics.
Definition time.h:38
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
const tchar * Section
Definition rcntfile.cpp:45
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
General definitions used by all ObjectWindows programs.
#define _OWLCLASS
Definition defs.h:338
General Registry access & registration implementation TRegKey, TRegValue, TRegKeyIterator,...