ReactOS 0.4.15-dev-7924-g5949c20
_num_put.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1999
3 * Silicon Graphics Computer Systems, Inc.
4 *
5 * Copyright (c) 1999
6 * Boris Fomitchev
7 *
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
10 *
11 * Permission to use or copy this software for any purpose is hereby granted
12 * without fee, provided the above notices are retained on all copies.
13 * Permission to modify the code and to distribute modified code is granted,
14 * provided the above notices are retained, and a notice that the code was
15 * modified is included with the above copyright notice.
16 *
17 */
18// WARNING: This is an internal header file, included by other C++
19// standard library headers. You should not attempt to use this header
20// file directly.
21
22
23#ifndef _STLP_INTERNAL_NUM_PUT_H
24#define _STLP_INTERNAL_NUM_PUT_H
25
26#ifndef _STLP_INTERNAL_NUMPUNCT_H
27# include <stl/_numpunct.h>
28#endif
29
30#ifndef _STLP_INTERNAL_CTYPE_H
31# include <stl/_ctype.h>
32#endif
33
34#ifndef _STLP_INTERNAL_OSTREAMBUF_ITERATOR_H
36#endif
37
38#ifndef _STLP_INTERNAL_IOSTREAM_STRING_H
39# include <stl/_iostream_string.h>
40#endif
41
42#ifndef _STLP_FACETS_FWD_H
43# include <stl/_facets_fwd.h>
44#endif
45
47
48//----------------------------------------------------------------------
49// num_put facet
50
51template <class _CharT, class _OutputIter>
52class num_put: public locale::facet {
53public:
54 typedef _CharT char_type;
55 typedef _OutputIter iter_type;
56
57 explicit num_put(size_t __refs = 0) : locale::facet(__refs) {}
58
59#if !defined (_STLP_NO_BOOL)
61 bool __val) const {
62 return do_put(__s, __f, __fill, __val);
63 }
64#endif
66 long __val) const {
67 return do_put(__s, __f, __fill, __val);
68 }
69
71 unsigned long __val) const {
72 return do_put(__s, __f, __fill, __val);
73 }
74
75#if defined (_STLP_LONG_LONG)
77 _STLP_LONG_LONG __val) const {
78 return do_put(__s, __f, __fill, __val);
79 }
80
82 unsigned _STLP_LONG_LONG __val) const {
83 return do_put(__s, __f, __fill, __val);
84 }
85#endif
86
88 double __val) const {
89 return do_put(__s, __f, __fill, (double)__val);
90 }
91
92#if !defined (_STLP_NO_LONG_DOUBLE)
94 long double __val) const {
95 return do_put(__s, __f, __fill, __val);
96 }
97#endif
98
100 const void * __val) const {
101 return do_put(__s, __f, __fill, __val);
102 }
103
105
106protected:
108#if !defined (_STLP_NO_BOOL)
109 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, bool __val) const;
110#endif
111 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long __val) const;
112 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, unsigned long __val) const;
113 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, double __val) const;
114#if !defined (_STLP_NO_LONG_DOUBLE)
115 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long double __val) const;
116#endif
117
118#if defined (_STLP_LONG_LONG)
119 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, _STLP_LONG_LONG __val) const;
120 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill,
121 unsigned _STLP_LONG_LONG __val) const ;
122#endif
123 virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, const void* __val) const;
124};
125
126#if defined (_STLP_USE_TEMPLATE_EXPORT)
128# if !defined (_STLP_NO_WCHAR_T)
130# endif
131#endif
132
133#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION)
134
136
137template <class _Integer>
138char* _STLP_CALL
139__write_integer_backward(char* __buf, ios_base::fmtflags __flags, _Integer __x);
140
141/*
142 * Returns the position on the right of the digits that has to be considered
143 * for the application of the grouping policy.
144 */
145extern size_t _STLP_CALL __write_float(__iostring&, ios_base::fmtflags, int, double);
146# if !defined (_STLP_NO_LONG_DOUBLE)
147extern size_t _STLP_CALL __write_float(__iostring&, ios_base::fmtflags, int, long double);
148# endif
149
150/*
151 * Gets the digits of the integer part.
152 */
154
155template <class _CharT>
157
158# if !defined (_STLP_NO_WCHAR_T)
159extern void _STLP_CALL __convert_float_buffer(__iostring const&, __iowstring&, const ctype<wchar_t>&, wchar_t, bool = true);
160# endif
162
163extern char* _STLP_CALL
165
166extern ptrdiff_t _STLP_CALL __insert_grouping(char* first, char* last, const string&, char, char, char, int);
167extern void _STLP_CALL __insert_grouping(__iostring&, size_t, const string&, char, char, char, int);
168# if !defined (_STLP_NO_WCHAR_T)
169extern ptrdiff_t _STLP_CALL __insert_grouping(wchar_t*, wchar_t*, const string&, wchar_t, wchar_t, wchar_t, int);
170extern void _STLP_CALL __insert_grouping(__iowstring&, size_t, const string&, wchar_t, wchar_t, wchar_t, int);
171# endif
172
174
175#endif /* _STLP_EXPOSE_STREAM_IMPLEMENTATION */
176
178
179#if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
180# include <stl/_num_put.c>
181#endif
182
183#endif /* _STLP_INTERNAL_NUMERIC_FACETS_H */
184
185// Local Variables:
186// mode:C++
187// End:
void __fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val, const input_iterator_tag &, _Distance *)
Definition: _algobase.h:417
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656
#define _STLP_LONG_LONG
Definition: _apcc.h:12
#define _STLP_CALL
Definition: _bc.h:131
#define _STLP_BASIC_IOSTRING(_CharT)
char *_STLP_CALL __write_integer_backward(char *__buf, ios_base::fmtflags __flags, _Integer __x)
Definition: _num_put.c:304
void _STLP_CALL __get_money_digits(_STLP_BASIC_IOSTRING(_CharT) &__buf, ios_base &__f, _STLP_LONGEST_FLOAT_TYPE __x)
Definition: _num_put.c:141
Definition: _ctype.h:58
int fmtflags
Definition: _ios_base.h:57
facet(size_t __init_count=0)
Definition: _locale.h:84
Definition: _locale.h:75
iter_type put(iter_type __s, ios_base &__f, char_type __fill, const void *__val) const
Definition: _num_put.h:99
iter_type put(iter_type __s, ios_base &__f, char_type __fill, long double __val) const
Definition: _num_put.h:93
num_put(size_t __refs=0)
Definition: _num_put.h:57
static locale::id id
Definition: _num_put.h:104
iter_type put(iter_type __s, ios_base &__f, char_type __fill, unsigned long __val) const
Definition: _num_put.h:70
_CharT char_type
Definition: _num_put.h:54
~num_put()
Definition: _num_put.h:107
iter_type put(iter_type __s, ios_base &__f, char_type __fill, long __val) const
Definition: _num_put.h:65
_OutputIter iter_type
Definition: _num_put.h:55
iter_type put(iter_type __s, ios_base &__f, char_type __fill, double __val) const
Definition: _num_put.h:87
virtual _OutputIter do_put(_OutputIter __s, ios_base &__f, _CharT __fill, bool __val) const
Definition: _num_put.c:420
iter_type put(iter_type __s, ios_base &__f, char_type __fill, bool __val) const
Definition: _num_put.h:60
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
#define _STLP_MOVE_TO_STD_NAMESPACE
Definition: features.h:525
#define _STLP_EXPORT_TEMPLATE_CLASS
Definition: features.h:987
#define _STLP_LONGEST_FLOAT_TYPE
Definition: features.h:213
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
#define _STLP_END_NAMESPACE
Definition: features.h:503
#define _STLP_MOVE_TO_PRIV_NAMESPACE
Definition: features.h:524
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
const GLint * first
Definition: glext.h:5794
#define put(ret, state, sp, n)
Definition: match.c:105
static UINT UINT last
Definition: font.c:45
ptrdiff_t _STLP_CALL __insert_grouping(char *first, char *last, const string &grouping, char separator, char Plus, char Minus, int basechars)
Definition: num_put.cpp:135
char *_STLP_CALL __write_integer(char *buf, ios_base::fmtflags flags, long x)
Definition: num_put.cpp:125
size_t _STLP_CALL __write_float(__iostring &buf, ios_base::fmtflags flags, int precision, double x)
void _STLP_CALL __adjust_float_buffer(__iostring &str, char dot)
void _STLP_CALL __get_floor_digits(__iostring &out, _STLP_LONGEST_FLOAT_TYPE __x)
void _STLP_CALL __convert_float_buffer(__iostring const &str, __iowstring &out, const ctype< wchar_t > &ct, wchar_t dot, bool __check_dot)