Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
catalog.h
Go to the documentation of this file.
1
32#ifndef _RWSTD_CATALOG_H_INCLUDED
33#define _RWSTD_CATALOG_H_INCLUDED
34
35#include <map>
36#include <string>
37
38#include <rw/_defs.h>
39
40#ifdef _WIN32
41# define _RWSTD_USE_RC 1
42# include <windows.h>
43#endif
44
45
46#define NL_SETD 1 /* XPG3 Conformant Default set number. */
47#define NL_CAT_LOCALE (-1) /* XPG4 requirement */
48#define NL_CAT_LOCALE (-1) /* XPG4 requirement */
49
50#define _RWCAT_COOKIE 0xAB34BC56
51
52
54
55
56#ifndef _RWSTD_USE_RC
57
58// dummy implementation (does nothing)
59class __rw_cat
60{
61public:
62 __rw_cat(const char*, int) { }
63
64 ~__rw_cat() { }
65
66 __rw_cat* id () {
67 return this;
68 }
69
70 bool good () const {
71 return false;
72 }
73
74 const char* catgets (int, int, const char *__s) {
75 return __s;
76 }
77};
78
79#else // if defined (_RWSTD_USE_RC)
80
81#define NL_TEXTMAX 8024
82
83// Catalog type hold relationship between cat id and file
84class __rw_cat
85{
86public:
87 typedef _STD::map<int, _STD::string, _STD::less<int>,
88 _STD::allocator<_STD::pair<const int, _STD::string> > >
89 __cat_type;
90
91 typedef __cat_type::value_type __msg_type;
92
93protected:
94 HINSTANCE __cat;
95 __cat_type __msgs;
96
97public:
98 __rw_cat (const char *__fname, int)
99 : __cat (__fname ? LoadLibrary (__fname) : GetModuleHandle (0)) { }
100
101 ~__rw_cat () {
102 if (__cat)
103 FreeLibrary (__cat);
104 }
105
106 __rw_cat* id () {
107 return this;
108 }
109
110 bool good () {
111 return !!__cat;
112 }
113
114 HINSTANCE cat () {
115 return __cat;
116 }
117
118 const char* catgets (int, int, const char*);
119};
120
121
122#endif //_RWSTD_USE_RC
123
124
125} // namespace __rw
126
127
128typedef _RW::__rw_cat* nl_catd;
129typedef int nl_item;
130
132const char* catgets (nl_catd, int, int, const char*);
133nl_catd catopen (const char*, int);
134
135
136#endif // _RWSTD_CATALOG_H_INCLUDED
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567
nl_catd catopen(const char *, int)
int nl_item
Definition catalog.h:129
int catclose(nl_catd)
const char * catgets(nl_catd, int, int, const char *)
_RW::__rw_cat * nl_catd
Definition catalog.h:128