Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6config.h
Go to the documentation of this file.
1 
18 #ifndef ICONFIG_H__
19 #define ICONFIG_H__ 1
20 
21 #include "p6i18n.h"
22 
23 
24 #ifdef __cplusplus
25 namespace P6R {
26 extern "C" {
27 #endif
28 
29 static const P6UINT32 MAX_IDENTIFER_SIZE = 4000;
30 static const P6UINT32 MAX_ENUM_BUF = 4000*16; // MAX_IDENTIFER_SIZE*16 == 64K
31 
38 typedef P6VOID (*CONFIG_NOTIFY_CHANGE)(P6INT32 eventCode,P6VOID* pContext );
39 
59 typedef enum
60 {
69 
70 
90 #undef INTERFACE
91 #define INTERFACE p6IEnumConfigWSections
93 {
109  P6DECLCOMMETHOD(next)(P6THIS_ P6UINT32 cElements, const P6WCHAR** parElements, P6UINT32* pcReturned ) P6PURE;
110 
119  P6DECLCOMMETHOD(reset)(P6THIS) P6PURE;
120 };
121 #define IF_p6IEnumConfigWSections {0xf6c2f961,0x605a,0x4e33,{0x93,0x8b,0x20,0x85,0xa9,0xcb,0x3c,0xed}}
122 
123 
130 typedef struct
131 {
132  const P6WCHAR* pName;
133  const P6WCHAR* pValue;
135 
136 
152 #undef INTERFACE
153 #define INTERFACE p6IEnumConfigWValues
155 {
171  P6DECLCOMMETHOD(next)(P6THIS_ P6UINT32 cElements, P6CONFIGWVALUE* parElements, P6UINT32* pcReturned ) P6PURE;
172 
181  P6DECLCOMMETHOD(reset)(P6THIS) P6PURE;
182 };
183 #define IF_p6IEnumConfigWValues {0x1faeacc1,0x1af2,0x4a3e,{0x80,0x47,0x5d,0x50,0xc0,0xe3,0x55,0xcf}}
184 
185 
198 #undef INTERFACE
199 #define INTERFACE p6IWConfigTokens
201 {
228  P6DECLCOMMETHOD(addToken)(P6THIS_ const P6WCHAR* pToken, const P6WCHAR* pValue ) P6PURE;
229 };
230 
231 // {A6824833-8289-4b70-8DFC-5C5F7028419C}
232 #define IF_p6IWConfigTokens {0xa6824833,0x8289,0x4b70,{0x8d,0xfc,0x5c,0x5f,0x70,0x28,0x41,0x9c}}
233 
234 
246 static const P6CONFIGFLAGS P6CONFIG_NOFLAGS = 0x00000000;
247 static const P6CONFIGFLAGS P6CONFIG_READONLY = 0x00000001;
248 
259 static const P6OPENFLAGS P6OPEN_NOFLAGS = 0x00000000;
260 static const P6OPENFLAGS P6OPEN_USENEW = 0x00000001;
261 static const P6OPENFLAGS P6OPEN_USEOLD = 0x00000002;
262 
263 
282 #undef INTERFACE
283 #define INTERFACE p6IWConfig
285 {
301  P6DECLCOMMETHOD(initialize)(P6THIS_ P6CONFIGFLAGS flags, const P6CHAR* pLocale ) P6PURE;
302 
319  P6DECLCOMMETHOD(openConfigFile)(P6THIS_ P6OPENFLAGS fFlags, const P6WCHAR* pPathName ) P6PURE;
320 
336  P6DECLCOMMETHOD(createConfigFile)(P6THIS_ const P6WCHAR* pPathName, P6BOOL overWrite ) P6PURE;
337 
352  P6DECLCOMMETHOD(closeConfigFile)(P6THIS_ P6BOOL withDefaults ) P6PURE;
353 
380  P6DECLCOMMETHOD(flushConfigFile)(P6THIS_ const P6WCHAR* pAlternateName, P6BOOL withDefaults ) P6PURE;
381 
393  P6DECLCOMMETHOD(reloadConfigFile)(P6THIS) P6PURE;
394 
421  P6DECLCOMMETHOD(getConfigInt)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, P6INT32 defaultValue, P6INT32* pValue ) P6PURE;
422 
439  P6DECLCOMMETHOD(getConfigUInt)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, P6UINT32 defaultValue, P6UINT32* pValue ) P6PURE;
440 
467  P6DECLCOMMETHOD(getConfigDouble)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, P6FLOAT defaultValue, P6FLOAT* pValue ) P6PURE;
468 
504  P6DECLCOMMETHOD(getConfigString)(P6THIS_ const P6WCHAR* pSectionName,
505  const P6WCHAR* pKeyName,
506  const P6WCHAR* defaultValue,
507  P6WCHAR* pBuffer,
508  P6UINT32 cBuffer,
509  P6UINT32* pWritten ) P6PURE;
510 
534  P6DECLCOMMETHOD(getConfigBool)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, P6BOOL defaultValue, P6BOOL* pValue ) P6PURE;
535 
558  P6DECLCOMMETHOD(getConfigSection)(P6THIS_ const P6WCHAR* pSectionName, P6WCHAR* pReturnBuf, P6UINT32 cBuffer, P6UINT32* pWritten ) P6PURE;
559 
577  P6DECLCOMMETHOD(setConfigInt)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, P6INT32 value ) P6PURE;
578 
594  P6DECLCOMMETHOD(setConfigUInt)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, P6UINT32 value ) P6PURE;
595 
613  P6DECLCOMMETHOD(setConfigDouble)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, P6FLOAT value ) P6PURE;
614 
632  P6DECLCOMMETHOD(setConfigString)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, const P6WCHAR* pValue ) P6PURE;
633 
634  P6DECLCOMMETHOD(setConfigStringList)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, const P6WCHAR* pstrValue ) P6PURE;
635 
636 
654  P6DECLCOMMETHOD(setConfigBool)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, P6BOOL value ) P6PURE;
655 
672  P6DECLCOMMETHOD(deleteConfigItem)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName ) P6PURE;
673 
686  P6DECLCOMMETHOD(deleteConfigSection)(P6THIS_ const P6WCHAR* pSectionName ) P6PURE;
687 
701  P6DECLCOMMETHOD(enableVersionStamp)(P6THIS_ P6BOOL enabled ) P6PURE;
702 
732  P6DECLCOMMETHOD(registerForNotify)(P6THIS_ P6CONFIG_NOTIFY_CODES regFor,
734  P6VOID* pContext ) P6PURE;
735 
751  P6DECLCOMMETHOD(unregisterForNotify)(P6THIS_ P6CONFIG_NOTIFY_CODES regFor, CONFIG_NOTIFY_CHANGE pFn ) P6PURE;
752 
764  P6DECLCOMMETHOD(enumConfigSections)(P6THIS_ p6IEnumConfigWSections** ppEnum ) P6PURE;
765 
778  P6DECLCOMMETHOD(enumConfigValues)(P6THIS_ const P6WCHAR* pSectionName, p6IEnumConfigWValues** ppEnum ) P6PURE;
779 
796  P6DECLCOMMETHOD(enumConfigList)(P6THIS_ const P6WCHAR* pSectionName, const P6WCHAR* pKeyName, p6IEnumConfigWValues** ppEnum ) P6PURE;
797 };
798 
799 // {9699FB6A-28EF-47f3-A659-1837A466F6A7}
800 #define IF_p6IWConfig {0x9699fb6a,0x28ef,0x47f3,{0xa6,0x59,0x18,0x37,0xa4,0x66,0xf6,0xa7}}
801 
802 // {104DEEBC-8510-4baa-A39E-4DDF8CDE58B2}
803 #define COMP_p6WConfig {0x104deebc,0x8510,0x4baa,{0xa3,0x9e,0x4d,0xdf,0x8c,0xde,0x58,0xb2}}
804 
805 #define GLOBAL_CONFIG_INTERFACE "P6R::p6IWConfig::ApplicationGlobalConfig\0"
806 
807 #ifdef __cplusplus
808 } /* extern "C" */
809 } // namespace
810 #endif
811 
812 
813 
814 #endif
815 
816 
Provides configuration file management with multi-language support.
Definition: p6config.h:284
P6UINT32 P6CONFIGFLAGS
P6CONFIGFLAGS.
Definition: p6config.h:245
To get a pointer to this object perform the following steps:
Definition: p6config.h:154
uint32_t P6UINT32
Definition: p6types.h:77
#define P6DECLAREICOM
Definition: p6defs.h:191
P6CONFIG_NOTIFY_CODES
Configuration Notify Codes.
Definition: p6config.h:59
To get a pointer to this object perform the following steps:
Definition: p6config.h:200
#define P6PURE
Definition: p6defs.h:192
unsigned char P6BOOL
Boolean type.
Definition: p6types.h:133
To get a pointer to this object perform the following steps:
Definition: p6config.h:92
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:111
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:97
const P6WCHAR * pName
Definition: p6config.h:132
it may not contain all the symbols used by this software If you run into undefined symbol please let us know and we can provide you a build that will be compatible with your specific value
Definition: readme.txt:85
Under [section] name=value The name value pair is broken up so that no additional parsing is required...
Definition: p6config.h:130
Interface definition for all p6I18n and L10n features.
P6UINT32 P6OPENFLAGS
P6OPENFLAGS.
Definition: p6config.h:258
P6VOID(* CONFIG_NOTIFY_CHANGE)(P6INT32 eventCode, P6VOID *pContext)
Configuration Change Notification Callback.
Definition: p6config.h:38
#define P6DECLCOMMETHOD(method)
Definition: p6defs.h:189
#define P6THIS_
Definition: p6defs.h:193
double P6FLOAT
Definition: p6types.h:93
void P6VOID
Definition: p6types.h:109
int32_t P6INT32
Definition: p6types.h:76
#define P6THIS
Definition: p6defs.h:194
const P6WCHAR * pValue
Definition: p6config.h:133
char P6CHAR
Narrow character type.
Definition: p6types.h:105
#define P6DECLAREIF_(iface, baseif)
Definition: p6defs.h:188