ReactOS 0.4.16-dev-320-g3bd9ddc
num_put.cpp File Reference
#include "stlport_prefix.h"
#include <locale>
#include <ostream>
Include dependency graph for num_put.cpp:

Go to the source code of this file.

Functions

template<class Char >
static _STLP_BEGIN_NAMESPACE ptrdiff_t __insert_grouping_aux (Char *first, Char *last, const string &grouping, Char separator, Char Plus, Char Minus, int basechars)
 
template<class Char , class Str >
static void __insert_grouping_aux (Str &iostr, size_t __group_pos, const string &grouping, Char separator, Char Plus, Char Minus, int basechars)
 
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_DECLSPEC const char *_STLP_CALL __hex_char_table_lo ()
 
_STLP_DECLSPEC const char *_STLP_CALL __hex_char_table_hi ()
 
char *_STLP_CALL __write_integer (char *buf, ios_base::fmtflags flags, long x)
 
ptrdiff_t _STLP_CALL __insert_grouping (char *first, char *last, const string &grouping, char separator, char Plus, char Minus, int basechars)
 
void _STLP_CALL __insert_grouping (__iostring &str, size_t group_pos, const string &grouping, char separator, char Plus, char Minus, int basechars)
 
ptrdiff_t _STLP_CALL __insert_grouping (wchar_t *first, wchar_t *last, const string &grouping, wchar_t separator, wchar_t Plus, wchar_t Minus, int basechars)
 
void _STLP_CALL __insert_grouping (__iowstring &str, size_t group_pos, const string &grouping, wchar_t separator, wchar_t Plus, wchar_t Minus, int basechars)
 

Variables

_STLP_MOVE_TO_STD_NAMESPACE template class _STLP_CLASS_DECLSPEC ostreambuf_iterator< char, char_traits< char > >
 

Function Documentation

◆ __hex_char_table_hi()

_STLP_DECLSPEC const char *_STLP_CALL __hex_char_table_hi ( )

Definition at line 121 of file num_put.cpp.

122{ return "0123456789ABCDEFX"; }

Referenced by __write_integer_backward(), and num_put< _CharT, _OutputIter >::do_put().

◆ __hex_char_table_lo()

Definition at line 118 of file num_put.cpp.

119{ return "0123456789abcdefx"; }

Referenced by __write_integer_backward(), and num_put< _CharT, _OutputIter >::do_put().

◆ __insert_grouping() [1/4]

void _STLP_CALL __insert_grouping ( __iostring str,
size_t  group_pos,
const string grouping,
char  separator,
char  Plus,
char  Minus,
int  basechars 
)

Definition at line 142 of file num_put.cpp.

143 {
144 __insert_grouping_aux(str, group_pos, grouping, separator, Plus, Minus, basechars);
145}
static const WCHAR separator[]
Definition: asmname.c:65
static _STLP_BEGIN_NAMESPACE ptrdiff_t __insert_grouping_aux(Char *first, Char *last, const string &grouping, Char separator, Char Plus, Char Minus, int basechars)
Definition: num_put.cpp:31
const WCHAR * str

◆ __insert_grouping() [2/4]

void _STLP_CALL __insert_grouping ( __iowstring str,
size_t  group_pos,
const string grouping,
wchar_t  separator,
wchar_t  Plus,
wchar_t  Minus,
int  basechars 
)

Definition at line 157 of file num_put.cpp.

159 {
160 __insert_grouping_aux(str, group_pos, grouping, separator, Plus, Minus, basechars);
161}

◆ __insert_grouping() [3/4]

ptrdiff_t _STLP_CALL __insert_grouping ( char first,
char last,
const string grouping,
char  separator,
char  Plus,
char  Minus,
int  basechars 
)

Definition at line 135 of file num_put.cpp.

136 {
137 return __insert_grouping_aux(first, last, grouping,
138 separator, Plus, Minus, basechars);
139}
const GLint * first
Definition: glext.h:5794
static UINT UINT last
Definition: font.c:45

Referenced by __money_do_put(), __put_float(), and __put_integer().

◆ __insert_grouping() [4/4]

ptrdiff_t _STLP_CALL __insert_grouping ( wchar_t first,
wchar_t last,
const string grouping,
wchar_t  separator,
wchar_t  Plus,
wchar_t  Minus,
int  basechars 
)

Definition at line 149 of file num_put.cpp.

151 {
152 return __insert_grouping_aux(first, last, grouping, separator,
153 Plus, Minus, basechars);
154}

◆ __insert_grouping_aux() [1/2]

template<class Char >
static _STLP_BEGIN_NAMESPACE ptrdiff_t __insert_grouping_aux ( Char *  first,
Char *  last,
const string grouping,
Char  separator,
Char  Plus,
Char  Minus,
int  basechars 
)
static

Definition at line 31 of file num_put.cpp.

33 {
34 typedef string::size_type str_size;
35
36 if (first == last)
37 return 0;
38
39 int sign = 0;
40
41 if (*first == Plus || *first == Minus) {
42 sign = 1;
43 ++first;
44 }
45
46 first += basechars;
47 Char* cur_group = last; // Points immediately beyond the rightmost
48 // digit of the current group.
49 int groupsize = 0; // Size of the current group (if grouping.size() == 0, size
50 // of group unlimited: we force condition (groupsize <= 0))
51
52 for ( str_size n = 0; ; ) { // Index of the current group
53 if ( n < grouping.size() ) {
54 groupsize = __STATIC_CAST(int, grouping[n++] );
55 }
56
57 if ((groupsize <= 0) || (groupsize >= cur_group - first) || (groupsize == CHAR_MAX)) {
58 break;
59 }
60
61 // Insert a separator character just before position cur_group - groupsize
62 cur_group -= groupsize;
63 ++last;
64 copy_backward(cur_group, last, last + 1);
65 *cur_group = separator;
66 }
67
68 return (last - first) + sign + basechars;
69}
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter copy_backward(_InputIter __first, _InputIter __last, _OutputIter __result)
Definition: _algobase.h:328
size_type size() const
Definition: _string.h:400
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
GLdouble n
Definition: glext.h:7729
#define CHAR_MAX
Definition: limits.h:32
#define sign(x)
Definition: mapdesc.cc:613

Referenced by __insert_grouping().

◆ __insert_grouping_aux() [2/2]

template<class Char , class Str >
static void __insert_grouping_aux ( Str iostr,
size_t  __group_pos,
const string grouping,
Char  separator,
Char  Plus,
Char  Minus,
int  basechars 
)
static

Definition at line 74 of file num_put.cpp.

77 {
78 typedef string::size_type str_size;
79
80 if (iostr.size() < __group_pos)
81 return;
82
83 int __first_pos = 0;
84 Char __first = *iostr.begin();
85
86 if (__first == Plus || __first == Minus) {
87 ++__first_pos;
88 }
89
90 __first_pos += basechars;
91
92 typename Str::iterator cur_group(iostr.begin() + __group_pos); // Points immediately beyond the rightmost
93 // digit of the current group.
94 int groupsize = 0; // Size of the current group (if grouping.size() == 0, size
95 // of group unlimited: we force condition (groupsize <= 0))
96
97 for ( str_size n = 0; ; ) { // Index of the current group
98 if ( n < grouping.size() ) {
99 groupsize = __STATIC_CAST( int, grouping[n++] );
100 }
101
102 if ( (groupsize <= 0) || (groupsize >= ((cur_group - iostr.begin()) - __first_pos)) ||
103 (groupsize == CHAR_MAX)) {
104 break;
105 }
106
107 // Insert a separator character just before position cur_group - groupsize
108 cur_group -= groupsize;
109 cur_group = iostr.insert(cur_group, separator);
110 }
111}

◆ __write_integer()

char *_STLP_CALL __write_integer ( char buf,
ios_base::fmtflags  flags,
long  x 
)

Definition at line 125 of file num_put.cpp.

125 {
126 char tmp[64];
127 char* bufend = tmp+64;
128 char* beg = __write_integer_backward(bufend, flags, x);
129 return copy(beg, bufend, buf);
130}
char *_STLP_CALL __write_integer_backward(char *__buf, ios_base::fmtflags __flags, _Integer __x)
Definition: _num_put.c:304
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
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

Referenced by __write_formatted_timeT(), and ios_base::_M_throw_failure().

Variable Documentation

◆ ostreambuf_iterator< char, char_traits< char > >