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
564 const tstring& value)
565{
566 return WriteString(section.c_str(), entry.c_str(), value.c_str());
567}
568
569//
570//
571//
572inline bool
577
578//
579//
580//
581inline uint
587//
588//
589//
590inline bool
595//
596//
597//
598inline uint
604//
605//
606//
607inline bool
612//
613//
614//
615inline bool
617{
618 return File.ReadData(Section.c_str(), entry, buffer, size);
619}
620//
621//
622//
623inline bool
625{
626 return File.WriteData(Section.c_str(), entry, buffer, size);
627}
628//
629//
630//
631inline bool
633{
634 return File.ReadData(Section, entry, buffer, size);
635}
636//
637//
638//
639inline bool
641{
642 return File.WriteData(Section, entry, buffer, size);
643}
644//
645//
646//
647inline int
652//
653//
654//
655inline bool
660//
661//
662//
663inline int
665{
666 return File.ReadInteger(Section.c_str(), entry.c_str(), defint);
667}
668//
669//
670//
671inline bool
673{
674 return File.WriteInteger(Section.c_str(), entry.c_str(), value);
675}
676//
677//
678//
679inline double
681{
682 return File.ReadDouble(Section.c_str(), entry, defval);
683}
684//
685//
686//
687inline bool
692//
693//
694//
695inline double
697{
698 return File.ReadDouble(Section.c_str(), entry.c_str(), defval);
699}
700//
701//
702//
703inline bool
705{
706 return File.WriteDouble(Section.c_str(), entry.c_str(), defval);
707}
708//
709//
710//
711inline bool
713{
714 return File.ReadBool(Section.c_str(), entry, defval);
715}
716//
717//
718//
719inline bool
724//
725//
726//
727inline bool
729{
730 return File.ReadBool(Section, entry, defval);
731}
732//
733//
734//
735inline bool
740//
741//
742//
743inline bool
748//
749//
750//
751inline bool
756//
757//
758//
759inline bool
764//
765//
766//
767inline bool
772//
773//
774//
775inline bool
780//
781//
782//
783inline bool
788//
789//
790//
791inline bool
796//
797//
798//
799inline bool
804//
805//
806//
807inline bool
812//
813//
814//
815inline bool
820//
821//
822//
823inline bool
828//
829//
830//
831inline bool
836//
837//
838//
839inline bool
844//
845//
846//
847inline bool
852//
853//
854//
855inline bool
860//
861//
862//
863inline bool
868//
869//
870//
871inline bool
876//
877//
878//
879inline bool
884//
885//
886//
887inline bool
892//
893//
894//
895inline bool
900//
901//
902//
903inline bool
908//
909//
910//
911inline bool
916//
917//
918//
919inline bool
924//
925//
926//
927inline bool
932//
933//
934//
935inline bool
940//
941//
942//
943inline bool
948//
949//
950//
951inline bool
956//
957//
958//
959inline bool
964//
965//
966//
967inline bool
969{
970 return File.ReadSize(Section.c_str(), entry, size);
971}
972//
973//
974//
975inline bool
977{
978 return File.WriteSize(Section.c_str(), entry, size);
979}
980//
981//
982//
983inline bool
985{
986 return File.ReadSize(Section, entry, size);
987}
988//
989//
990//
991inline bool
993{
994 return File.WriteSize(Section, entry, size);
995}
996//
997//
998//
999
1000//
1001//
1002//
1003} // OWL namespace
1004
1005
1006#endif // OWL_CONFIGFL_H
1007
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 TRect.
Definition configfl.cpp:836
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:872
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
This method reads a TPoint.
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
This method reads a TSize.
Definition configfl.cpp:848
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 TRect.
Definition configfl.cpp:822
tstring FileName
Definition configfl.h:153
bool WritePoint(LPCTSTR section, LPCTSTR entry, const TPoint &point)
This method writes a TPoint.
Definition configfl.cpp:810
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:862
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:912
bool WriteSize(LPCTSTR entry, const TSize &size)
Definition configfl.h:976
bool ReadData(LPCTSTR entry, void *buffer, uint size) const
Definition configfl.h:616
int ReadInteger(LPCTSTR entry, int defint=0) const
Definition configfl.h:648
TConfigFileSection(TConfigFile &file, const tstring &section)
Definition configfl.h:166
bool ReadFont(LPCTSTR entry, LOGFONT &font) const
Definition configfl.h:840
double ReadDouble(LPCTSTR entry, double defval) const
Definition configfl.h:680
bool WriteString(LPCTSTR entry, LPCTSTR value)
Definition configfl.h:591
bool ReadTime(LPCTSTR entry, TTime &val) const
Definition configfl.h:808
bool ReadDate(LPCTSTR entry, TDate &value) const
Definition configfl.h:744
bool WriteTime(LPCTSTR entry, TTime &val)
Definition configfl.h:816
bool ReadRect(LPCTSTR entry, TRect &val) const
Definition configfl.h:904
TConfigFile & File
Definition configfl.h:243
bool WriteInteger(LPCTSTR entry, int value)
Definition configfl.h:656
uint ReadString(LPCTSTR entry, TCHAR *buffer, uint bufSize, LPCTSTR defstr=0) const
Definition configfl.h:582
bool WriteData(LPCTSTR entry, void *buffer, uint size)
Definition configfl.h:624
bool WriteBool(LPCTSTR entry, bool val)
Definition configfl.h:720
bool EraseEntry(LPCTSTR entry)
Definition configfl.h:573
const tstring & GetSection()
Definition configfl.h:169
bool WriteFont(LPCTSTR entry, const LOGFONT &font)
Definition configfl.h:848
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:944
bool ReadColor(LPCTSTR entry, TColor &color) const
Definition configfl.h:872
bool ReadPoint(LPCTSTR entry, TPoint &val) const
Definition configfl.h:936
bool WriteSystemTime(LPCTSTR entry, const TSystemTime &val)
Definition configfl.h:784
bool WriteDate(LPCTSTR entry, const TDate &val)
Definition configfl.h:752
bool WriteDouble(LPCTSTR entry, double defval)
Definition configfl.h:688
bool WriteColor(LPCTSTR entry, const TColor &clr)
Definition configfl.h:880
bool ReadSystemTime(LPCTSTR entry, TSystemTime &val) const
Definition configfl.h:776
bool ReadSize(LPCTSTR entry, TSize &sz) const
Definition configfl.h:968
bool ReadBool(LPCTSTR entry, bool defval) const
Definition configfl.h:712
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,...