Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
_punct.h
Go to the documentation of this file.
1
32#ifndef _RWSTD_LOC_PUNCT_H_INCLUDED
33#define _RWSTD_LOC_PUNCT_H_INCLUDED
34
35
36#if __GNUG__ >= 3
37# pragma GCC system_header
38#endif // gcc >= 3
39
40
41#include <rw/_defs.h>
42#include <rw/_ioiter.h>
43#include <rw/_traits.h>
44
45
47
48struct _RWSTD_EXPORT ios_base;
49
50} // namespace std
51
52
54
55enum {
56 // bitset elements representing decimal_point, thousands_sep, grouping,
57 // truename, falsename, currency_sym, positive_sign, negative_sign,
58 // frac_digits, pos_format, neg_format
59
60 // values are bitset elements since they are used to indicate which
61 // members have already been cached by std::moneypunct and std::numpunct
62 __rw_dp = 0x0001, __rw_ts = 0x0002, __rw_gr = 0x0004, __rw_tn = 0x0008,
63 __rw_fn = 0x0010, __rw_cs = 0x0020, __rw_ps = 0x0040, __rw_ns = 0x0080,
64 __rw_fd = 0x0100, __rw_pf = 0x0200, __rw_nf = 0x0400,
65
66 // bitset elements used by std::time_get and std::time_put
67 __rw_abday = 0x0001, __rw_day = 0x0002, __rw_abmon = 0x0004,
68 __rw_month = 0x0008, __rw_ampm = 0x0010, __rw_d_t_fmt = 0x0020,
69 __rw_d_fmt = 0x0040, __rw_t_fmt = 0x0080, __rw_t_fmt_ampm = 0x0100,
70
71 // bitset elements used by std::time_get and std::time_put
72 // for alternative date/time representions and eras
73 __rw_era_d_t_fmt = 0x0200, __rw_era_d_fmt = 0x0400, __rw_era_t_fmt = 0x0800,
74 __rw_era_names = 0x1000, __rw_era_fmts = 0x2000,
75 __rw_alt_digits = 0x4000,
76
77 // other flags
78 __rw_wide = 0x100000, __rw_mon = 0x200000, __rw_intl = 0x400000
79};
80
81struct __rw_facet;
82
83template <class _CharT>
84inline const _CharT*
85__rw_get_punct (const _RW::__rw_facet*, int, _CharT)
86{
87 // body provided to work around bugs in compilers such as IBM
88 // VAC++ 7.0 (see bug #562) that instantiate the function when
89 // e.g., use_facet<numpunct<int> >(locale) is called
90 _RWSTD_ASSERT (!"must not be called");
91 return 0;
92}
93
94// use overloading instead of specialization below to prevent
95// linker unsats when using Intel C++ on Windows (PR #29178)
96/* _RWSTD_SPECIALIZED_FUNCTION */ _RWSTD_EXPORT
97const char* __rw_get_punct (const _RW::__rw_facet*, int, char);
98
99#ifndef _RWSTD_NO_WCHAR_T
100
101/* _RWSTD_SPECIALIZED_FUNCTION */ _RWSTD_EXPORT
102const wchar_t* __rw_get_punct (const _RW::__rw_facet*, int, wchar_t);
103
104#endif // _RWSTD_NO_WCHAR_T
105
106// extracts as many values from the given range as necessary to
107// (not necessarily unambiguously) match one or more names (in
108// case of duplicates) in the array of sequences given by the
109// third and fourth arguments
110// case insensitive comparison (characters are compared after
111// converting to uppercase using std::ctype<charT>::toupper())
112// is performed if the last argument is nonzero
113// retuns the iterator pointing one past the last extracted value,
114// fills 6th argument with the index of the matched name and sets
115// the 7th argument to eofbit if the end of input has been reached
116// while trying to match a name (note that the returned iterator
117// may be equal to the end iterator and eofbit may not be set)
119template <class _CharT, class _InputIter>
120_InputIter __rw_match_name (_InputIter, _InputIter,
121 const _CharT* const*, const _RWSTD_SIZE_T*,
122 _RWSTD_SIZE_T, _RWSTD_SIZE_T&, int&,
123 _STD::ios_base*);
124
125} // namespace __rw
126
127
128#if _RWSTD_DEFINE_TEMPLATE_FIRST (_PUNCT)
129# include <loc/_punct.cc>
130#endif // _RWSTD_DEFINE_TEMPLATE_FIRST (_PUNCT)
131
132
133#ifdef _RWSTD_MSVC
134# pragma warning (push)
135# pragma warning (disable: 4231)
136#endif // _RWSTD_MSVC
137
138
140
141#define _RWSTD_ARG_LIST(charT) \
142 _RWSTD_ISTREAMBUF_ITER (charT), _RWSTD_ISTREAMBUF_ITER (charT), \
143 const charT* const*, const _RWSTD_SIZE_T*, _RWSTD_SIZE_T, \
144 _RWSTD_SIZE_T&, int&, _STD::ios_base*
145
146#if _RWSTD_INSTANTIATE (_PUNCT, _CHAR)
147
148_RWSTD_INSTANTIATE_FUN_1 (_RWSTD_TI_EXPORT _RW::__rw_istreambuf_iterator
149 __rw_match_name (_RWSTD_ARG_LIST (char)));
150
151#endif // _RWSTD_INSTANTIATE (_PUNCT, _CHAR)
152
153#if _RWSTD_INSTANTIATE (_PUNCT, _WCHAR_T)
154
155_RWSTD_INSTANTIATE_FUN_1 (_RWSTD_TI_EXPORT _RW::__rw_wistreambuf_iterator
156 __rw_match_name (_RWSTD_ARG_LIST (wchar_t)));
157
158#endif // _RWSTD_INSTANTIATE (_PUNCT, _WCHAR_T)
159
160#undef _RWSTD_ARG_LIST
161
162} // namespace __rw
163
164
165#ifdef _RWSTD_MSVC
166# pragma warning (pop)
167#endif // _RWSTD_MSVC
168
169
170#if _RWSTD_DEFINE_TEMPLATE_LAST (_PUNCT)
171# include <loc/_punct.cc>
172#endif // _RWSTD_DEFINE_TEMPLATE_LAST (_PUNCT)
173
174
175#endif // _RWSTD_LOC_PUNCT_H_INCLUDED
#define _RWSTD_EXPORT
Definition _defs.h:485
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567
#define _EXPORT
Definition _defs.h:498
#define _RWSTD_INSTANTIATE_FUN_1(arg)
Definition _defs.h:1410
#define _RWSTD_ASSERT(ignore)
Definition _defs.h:1108
#define _RWSTD_TI_EXPORT
Definition _defs.h:1331
#define _RWSTD_ARG_LIST(charT)
Definition json.h:5363