Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6i18n.h
Go to the documentation of this file.
1 
18 #ifndef P6I18N_H__
19 #define P6I18N_H__ 1
20 
21 #include "p6err.h"
22 #include "p6comdef.h"
23 #include "p6filetypes.h"
24 
25 
26 #ifdef __cplusplus
27 namespace P6R {
28 extern "C" {
29 #endif
30 
36 typedef enum
37 {
38  NOOP = 0x00,
39  READ = 0x01,
40  WRITE = 0x02,
41  READWRITE = 0x03,
42  APPEND = 0x04
43 } P6OPEN_MODE;
44 
45 
54 static const P6I18NFLAGS P6I18N_NOFLAGS = 0x00000000;
55 
56 
66 #undef INTERFACE
67 #define INTERFACE p6II18nFile
69 {
87  P6DECLCOMMETHOD(initialize)(P6THIS_ P6I18NFLAGS flags, const P6CHAR* pLocale ) P6PURE;
88 
104  P6DECLCOMMETHOD(fopen)(P6THIS_ const P6WCHAR* pFilePath, P6FILEFLAGS operation, P6FILEMODE mode ) P6PURE;
105 
115  P6DECLCOMMETHOD(fclose)(P6THIS) P6PURE;
116 
146  P6DECLCOMMETHOD(fileFormatString)(P6THIS_ P6UINT32* pcWritten, const P6WCHAR* pszFormat, const P6ARG* pArgs, P6INT32 cArgs ) P6PURE;
147 
160  P6DECLCOMMETHOD(fgetwc)(P6THIS_ P6WCHAR* pWc ) P6PURE;
161 
175  P6DECLCOMMETHOD(fgetws)(P6THIS_ P6WCHAR* pDst, P6UINT32 dstSize ) P6PURE;
176 
187  P6DECLCOMMETHOD(fputwc)(P6THIS_ P6WCHAR wc ) P6PURE;
188 
201  P6DECLCOMMETHOD(fputws)(P6THIS_ P6WCHAR* pWs ) P6PURE;
202 
215  P6DECLCOMMETHOD(fwide)(P6THIS_ P6INT32 mode, P6INT32* result ) P6PURE;
216 
230  P6DECLCOMMETHOD(fgetUTF8)(P6THIS_ P6CHAR* pDst, P6UINT32 dstSize ) P6PURE;
231 
243  P6DECLCOMMETHOD(fputUTF8)(P6THIS_ P6CHAR* pUtf8 ) P6PURE;
244 };
245 
246  // {16CBE73E-8593-4fa4-BB8C-AD4B00A4654F}
247 #define IF_p6II18nFile {0x16cbe73e,0x8593,0x4fa4,{0xbb,0x8c,0xad,0x4b,0x0,0xa4,0x65,0x4f}}
248 
249 // {424D9BB3-33E6-41ee-BE1D-B1343DFDC651}
250 #define COMP_p6I18nFile {0x424d9bb3,0x33e6,0x41ee,{0xbe,0x1d,0xb1,0x34,0x3d,0xfd,0xc6,0x51}}
251 
252 
253 
262 #undef INTERFACE
263 #define INTERFACE p6II18n
265 {
282  P6DECLCOMMETHOD(initialize)(P6THIS_ P6I18NFLAGS flags, const P6CHAR* pLocale ) P6PURE;
283 
300  P6DECLCOMMETHOD(setLocale)(P6THIS_ const P6CHAR* pLocale ) P6PURE;
301 
313  P6DECLCOMMETHOD(getLocaleInUse)(P6THIS_ const P6CHAR** pLocale ) P6PURE;
314 
328  P6DECLCOMMETHOD(setCollation)(P6THIS_ const P6CHAR* pCollationName ) P6PURE;
329 
342  P6DECLCOMMETHOD(getCollationInUse)(P6THIS_ const P6CHAR** pCollationName ) P6PURE;
343 
344 
345  // [A] Conversion Methods
358  P6DECLCOMMETHOD(btowc)(P6THIS_ P6INT32 sc, P6WCHAR* pWc ) P6PURE;
359 
372  P6DECLCOMMETHOD(wctob)(P6THIS_ P6WCHAR wc, P6INT32* pSc ) P6PURE;
373 
395  P6DECLCOMMETHOD(wcstod)(P6THIS_ const P6WCHAR* pSrc, P6WCHAR** pEndPtr, P6FLOAT* pToDouble ) P6PURE;
396 
428  P6DECLCOMMETHOD(wcstol)(P6THIS_ const P6WCHAR* pSrc, P6WCHAR** pEndptr, P6INT32 base, P6INT32* pResult ) P6PURE;
429 
449  P6DECLCOMMETHOD(wcstoul)(P6THIS_ const P6WCHAR* pSrc, P6WCHAR** pEndptr, P6INT32 base, P6UINT32* pResult ) P6PURE;
450 
483  P6DECLCOMMETHOD(wcstoll)(P6THIS_ const P6WCHAR* pSrc, P6WCHAR** pEndptr, P6INT32 base, P6INT64* pResult ) P6PURE;
484 
517  P6DECLCOMMETHOD(wcstoull)(P6THIS_ const P6WCHAR* pSrc, P6WCHAR** pEndptr, P6INT32 base, P6UINT64* pResult ) P6PURE;
518 
537  P6DECLCOMMETHOD(wcsxfrm)(P6THIS_ P6WCHAR* pDst, const P6WCHAR* pSrc, P6UINT32 n, P6UINT32* pResultSize ) P6PURE;
538 
556  P6DECLCOMMETHOD(utf8ToWc)(P6THIS_ P6WCHAR* pDst, P6UINT32* pDstSize, const P6CHAR* pSrc, P6UINT32 srcSize ) P6PURE;
557 
578  P6DECLCOMMETHOD(utf8ToWcs)(P6THIS_ P6WCHAR* pDst, P6UINT32* pDstSize, const P6CHAR* pSrc ) P6PURE;
579 
603  P6DECLCOMMETHOD(utf8NToWcs)(P6THIS_ P6WCHAR* pDst, P6UINT32* pDstSize, const P6CHAR* pSrc, P6UINT32 cCount ) P6PURE;
604 
626  P6DECLCOMMETHOD(wcToUtf8)(P6THIS_ P6CHAR* pDst, P6UINT32* pDstSize, P6WCHAR wc ) P6PURE;
627 
648  P6DECLCOMMETHOD(wcsToUtf8)(P6THIS_ P6CHAR* pDst, P6UINT32* pDstSize, const P6WCHAR* pWs ) P6PURE;
649 
671  P6DECLCOMMETHOD(wcsNToUtf8)(P6THIS_ P6CHAR* pDst, P6UINT32* pDstSize, const P6WCHAR* pWs, P6UINT32 cCount ) P6PURE;
672 
673 
674 
675  // [B] Query Properties Methods
688  P6DECLCOMMETHOD(iswalnum)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
689 
702  P6DECLCOMMETHOD(iswalpha)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
703 
716  P6DECLCOMMETHOD(iswcntrl)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
717 
730  P6DECLCOMMETHOD(iswdigit)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
731 
744  P6DECLCOMMETHOD(iswgraph)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
745 
758  P6DECLCOMMETHOD(iswlower)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
759 
772  P6DECLCOMMETHOD(iswprint)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
773 
786  P6DECLCOMMETHOD(iswpunct)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
787 
800  P6DECLCOMMETHOD(iswspace)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
801 
814  P6DECLCOMMETHOD(iswupper)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
815 
828  P6DECLCOMMETHOD(iswxdigit)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
829 
848  P6DECLCOMMETHOD(iswctype)(P6THIS_ P6WCHAR wc, P6UINT16 charClass, P6BOOL* pResult ) P6PURE;
849 
862  P6DECLCOMMETHOD(iswLineTerminator)(P6THIS_ P6WCHAR wc, P6BOOL* pResult ) P6PURE;
863 
880  P6DECLCOMMETHOD(wcscspn)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32* pResultSize ) P6PURE;
881 
897  P6DECLCOMMETHOD(wcsspn)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32* pResultSize ) P6PURE;
898 
911  P6DECLCOMMETHOD(wcslen)(P6THIS_ const P6WCHAR* pWs, P6UINT32* pResultSize ) P6PURE;
912 
913 
914 
915  // [C] String (character) Search Methods
930  P6DECLCOMMETHOD(wcsstr)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6WCHAR** pResult ) P6PURE;
931 
947  P6DECLCOMMETHOD(wcspbrk)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6WCHAR** pResult ) P6PURE;
948 
963  P6DECLCOMMETHOD(wcschr)(P6THIS_ const P6WCHAR* pWs, P6WCHAR wc, P6WCHAR** pResult ) P6PURE;
964 
979  P6DECLCOMMETHOD(wcsrchr)(P6THIS_ const P6WCHAR* pWs, P6WCHAR wc, P6WCHAR** pResult ) P6PURE;
980 
996  P6DECLCOMMETHOD(wmemchr)(P6THIS_ const P6WCHAR* pWs, P6WCHAR wc, P6UINT32 n, P6WCHAR** pResult ) P6PURE;
997 
998 
999 
1000  // [D] String (character) Construction (Manipualation) Methods
1032  P6DECLCOMMETHOD(formatString)(P6THIS_ P6WCHAR* pDst, P6SIZE cDst, P6SIZE *pcWritten, const P6WCHAR* pszFormat, const P6ARG* pArgs, P6INT32 cArgs ) P6PURE;
1033 
1047  P6DECLCOMMETHOD(towlower)(P6THIS_ P6WCHAR wc, P6WCHAR* pLowerWc ) P6PURE;
1048 
1062  P6DECLCOMMETHOD(towupper)(P6THIS_ P6WCHAR wc, P6WCHAR* pUpperWc ) P6PURE;
1063 
1075  P6DECLCOMMETHOD(wcslwr)(P6THIS_ P6WCHAR* pWs ) P6PURE;
1076 
1088  P6DECLCOMMETHOD(wcsupr)(P6THIS_ P6WCHAR* pWs ) P6PURE;
1089 
1103  P6DECLCOMMETHOD(wcsncat)(P6THIS_ P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32 n ) P6PURE;
1104 
1118  P6DECLCOMMETHOD(wcsncpy)(P6THIS_ P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32 n ) P6PURE;
1119 
1137  P6DECLCOMMETHOD(wcslcpy)(P6THIS_ P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32 size ) P6PURE;
1138 
1156  P6DECLCOMMETHOD(wcslcat)(P6THIS_ P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32 size ) P6PURE;
1157 
1172  P6DECLCOMMETHOD(wmemcpy)(P6THIS_ P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32 n ) P6PURE;
1173 
1191  P6DECLCOMMETHOD(wmemmove)(P6THIS_ P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32 n ) P6PURE;
1192 
1207  P6DECLCOMMETHOD(wmemset)(P6THIS_ P6WCHAR* pWs, P6WCHAR wc, P6UINT32 n ) P6PURE;
1208 
1224  P6DECLCOMMETHOD(wcsdup)(P6THIS_ P6WCHAR** pWs1, const P6WCHAR* pWs2 ) P6PURE;
1225 
1237  P6DECLCOMMETHOD(wcsdupFree)(P6THIS_ P6WCHAR* pWs ) P6PURE;
1238 
1252  P6DECLCOMMETHOD(wcsStrToCntrl)(P6THIS_ P6WCHAR* pWs ) P6PURE;
1253 
1273  P6DECLCOMMETHOD(wcsCntrlToStr)(P6THIS_ const P6WCHAR* pWs, P6WCHAR* pDst, P6UINT32* pDstSize ) P6PURE;
1274 
1275  // -> format time strings in a wide and local manner
1276  // -> P6R extension that supports "%k" which expands to display milliseconds
1300  P6DECLCOMMETHOD(wcsftime)(P6THIS_ P6WCHAR* pDst, P6UINT32* pDstSize, const P6WCHAR* pFormat, P6TIME tod, P6BOOL inGMT ) P6PURE;
1301 
1302  // [E] String Comparison Methods
1318  P6DECLCOMMETHOD(wcscmp)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6INT32* pResult ) P6PURE;
1319 
1337  P6DECLCOMMETHOD(wcsncmp)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32 n, P6INT32* pResult ) P6PURE;
1338 
1355  P6DECLCOMMETHOD(wcsicmp)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6INT32* pResult ) P6PURE;
1356 
1374  P6DECLCOMMETHOD(wcsnicmp)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32 n, P6INT32* pResult ) P6PURE;
1375 
1393  P6DECLCOMMETHOD(wcscoll)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6INT32* pResult ) P6PURE;
1394 
1412  P6DECLCOMMETHOD(wmemcmp)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6UINT32 n, P6INT32* pResult ) P6PURE;
1413 
1429  P6DECLCOMMETHOD(startsWith)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6BOOL* pResult ) P6PURE;
1430 
1445  P6DECLCOMMETHOD(endsWith)(P6THIS_ const P6WCHAR* pWs1, const P6WCHAR* pWs2, P6BOOL* pResult ) P6PURE;
1446 
1447  // [F] String Parsing Methods
1470  P6DECLCOMMETHOD(wcstok)(P6THIS_ P6WCHAR* pWs, const P6WCHAR* pDelimit, P6WCHAR** pResult ) P6PURE;
1471 
1472 
1473  // [G] Misc
1490  P6DECLCOMMETHOD(wctype)(P6THIS_ const P6CHAR* property, P6UINT16* pCharClass ) P6PURE;
1491 
1504  P6DECLCOMMETHOD(trimEnd)(P6THIS_ P6WCHAR* pWs ) P6PURE;
1505 };
1506 
1507 // {AA13B086-7425-4ec4-9C35-40DA83A6CAEC}
1508 #define IF_p6II18n {0xaa13b086,0x7425,0x4ec4,{0x9c,0x35,0x40,0xda,0x83,0xa6,0xca,0xec}}
1509 
1510 // {4D41A2BA-761D-4d05-A4BC-CD376BBCA93D}
1511 #define COMP_p6I18n {0x4d41a2ba,0x761d,0x4d05,{0xa4,0xbc,0xcd,0x37,0x6b,0xbc,0xa9,0x3d}}
1512 
1513 #ifdef __cplusplus
1514 } /* extern "C" */
1515 } // namespace
1516 #endif
1517 
1518 
1519 
1520 #endif
1521 
1522 
1523 
size_t P6SIZE
Definition: p6types.h:90
uint64_t P6UINT64
Definition: p6types.h:79
uint32_t P6UINT32
Definition: p6types.h:77
#define P6DECLAREICOM
Definition: p6defs.h:191
#define P6PURE
Definition: p6defs.h:192
Standard error codes.
unsigned char P6BOOL
Boolean type.
Definition: p6types.h:133
Main internationalization (p6I18n) and localization (L10N) interface.
Definition: p6i18n.h:264
File and directory type definitions.
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
P6UINT32 P6I18NFLAGS
P6I18NFLAGS.
Definition: p6i18n.h:53
int64_t P6INT64
Definition: p6types.h:78
P6COM base interface definitions.
P6OPEN_MODE
file open modes, no combinations are currently supported
Definition: p6i18n.h:36
p6I18n file IO support.
Definition: p6i18n.h:68
P6UINT32 P6FILEFLAGS
File access flags are passed to various file open/create calls to specify the type of access that is ...
Definition: p6filetypes.h:40
uint16_t P6UINT16
Definition: p6types.h:75
#define P6DECLCOMMETHOD(method)
Definition: p6defs.h:189
P6UINT32 P6FILEMODE
Definition: p6filetypes.h:75
P6INT64 P6TIME
The wallclock time represented as the number of microseconds since midnight January 1 1970 UTC...
Definition: p6types.h:259
#define P6THIS_
Definition: p6defs.h:193
double P6FLOAT
Definition: p6types.h:93
int32_t P6INT32
Definition: p6types.h:76
#define P6THIS
Definition: p6defs.h:194
Argument definition.
Definition: p6types.h:591
char P6CHAR
Narrow character type.
Definition: p6types.h:105
#define P6DECLAREIF_(iface, baseif)
Definition: p6defs.h:188