18 #ifndef _STLP_ISTREAM_C 19 #define _STLP_ISTREAM_C 21 #ifndef _STLP_INTERNAL_ISTREAM 25 #ifndef _STLP_INTERNAL_LIMITS 29 #ifndef _STLP_INTERNAL_NUM_GET_H 33 #if defined ( _STLP_NESTED_TYPE_PARAM_BUG ) 35 # define __BIS_int_type__ int 36 # define __BIS_pos_type__ streampos 37 # define __BIS_off_type__ streamoff 39 # define __BIS_int_type__ _STLP_TYPENAME_ON_RETURN_TYPE basic_istream<_CharT, _Traits>::int_type 40 # define __BIS_pos_type__ _STLP_TYPENAME_ON_RETURN_TYPE basic_istream<_CharT, _Traits>::pos_type 41 # define __BIS_off_type__ _STLP_TYPENAME_ON_RETURN_TYPE basic_istream<_CharT, _Traits>::off_type 51 template <
class _Traits>
63 template <
class _Traits>
77 template <
class _Traits>
93 template <
class _Traits>
111 template <
class _Traits>
127 template <
class _Traits>
144 template <
class _Traits>
166 template <
class _CharT,
class _Traits>
171 const typename _Traits::int_type __eof =
_Traits::eof();
184 template <
class _CharT,
class _Traits,
class _Number>
189 _Sentry __sentry( __that );
196 0, __that, __err,
__val);
208 template <
class _CharT,
class _Traits>
212 if ( this->fail() ) {
216 unsigned short __uval =
__STATIC_CAST(
unsigned short, __lval);
219 if ((__tmp != __lval) && ((
long)__uval != __lval))
220 this->setstate(ios_base::failbit);
226 template <
class _CharT,
class _Traits>
230 if ( this->fail() ) {
234 unsigned int __uval = __lval;
237 if ((__tmp != __lval) && ((
long)__uval != __lval))
238 this->setstate(ios_base::failbit);
244 template <
class _CharT,
class _Traits>
250 template <
class _CharT,
class _Traits>
256 template <
class _CharT,
class _Traits>
262 template <
class _CharT,
class _Traits>
268 #if defined (_STLP_LONG_LONG) 269 template <
class _CharT,
class _Traits>
275 template <
class _CharT,
class _Traits>
281 template <
class _CharT,
class _Traits>
286 template <
class _CharT,
class _Traits>
291 #if !defined (_STLP_NO_LONG_DOUBLE) 292 template <
class _CharT,
class _Traits>
298 #if !defined (_STLP_NO_BOOL) 299 template <
class _CharT,
class _Traits>
306 template <
class _CharT,
class _Traits>
314 template <
class _CharT,
class _Traits>
324 __tmp = this->rdbuf()->sgetc();
327 this->_M_handle_exception(ios_base::badbit);
329 if (this->_S_eof(__tmp))
330 this->setstate(ios_base::eofbit);
337 template <
class _CharT,
class _Traits>
346 __tmp = this->rdbuf()->sbumpc();
349 this->_M_handle_exception(ios_base::badbit);
352 if (!this->_S_eof(__tmp))
357 this->setstate(ios_base::eofbit | ios_base::failbit);
362 template <
class _CharT,
class _Traits>
371 __tmp = this->rdbuf()->sbumpc();
374 this->_M_handle_exception(ios_base::badbit);
377 if (!this->_S_eof(__tmp)) {
379 __c = _Traits::to_char_type(__tmp);
383 if (this->_M_gcount == 0)
384 this->setstate(ios_base::eofbit | ios_base::failbit);
394 template <
class _CharT,
class _Traits>
402 __c = this->rdbuf()->sbumpc();
405 this->_M_handle_exception(ios_base::badbit);
409 if (!this->_S_eof(
__c))
412 this->setstate(ios_base::eofbit);
420 template <
class _CharT,
class _Traits>
435 this->_M_handle_exception(ios_base::badbit);
438 if (this->_S_eof(__tmp))
439 this->setstate(ios_base::badbit);
442 this->setstate(ios_base::failbit);
447 template <
class _CharT,
class _Traits>
458 if (this->_S_eof(__buf->
sungetc()))
459 this->setstate(ios_base::badbit);
462 this->_M_handle_exception(ios_base::badbit);
465 this->setstate(ios_base::badbit);
468 this->setstate(ios_base::failbit);
475 template <
class _CharT,
class _Traits>
482 this->setstate(ios_base::badbit);
492 template <
class _CharT,
class _Traits>
502 template <
class _CharT,
class _Traits>
508 if (!this->fail() && __buf) {
510 this->setstate(ios_base::failbit);
516 template <
class _CharT,
class _Traits>
522 if (!this->fail() && __buf)
529 template <
class _CharT,
class _Traits>
533 sentry __sentry(*
this);
536 typename _Traits::int_type __tmp;
539 __tmp = this->rdbuf()->sbumpc();
542 this->_M_handle_exception(ios_base::badbit);
546 if (!this->_S_eof(__tmp))
547 __c = _Traits::to_char_type(__tmp);
549 this->setstate(ios_base::eofbit | ios_base::failbit);
577 template <
class _CharT,
class _Traits,
class _Is_Delim>
581 _Is_Delim __is_delim,
582 bool __extract_delim,
bool __append_null,
594 __status |= ios_base::failbit;
600 if (
__n < _Num || __is_getline)
601 __status |= ios_base::eofbit;
603 }
else if (__is_delim(_Traits::to_char_type(
__c))) {
604 if (__extract_delim) {
606 }
else if ( !
__pushback(__buf, _Traits::to_char_type(
__c)) ) {
607 __status |= ios_base::failbit;
612 *__s++ = _Traits::to_char_type(
__c);
633 template <
class _CharT,
class _Traits,
class _Is_Delim,
class _Scan_Delim>
637 _Is_Delim __is_delim, _Scan_Delim __scan_delim,
638 bool __extract_delim,
bool __append_null,
646 const _CharT* __first = __buf->
_M_gptr();
654 const _CharT* __p = __scan_delim(__first,
__last);
662 if (__p !=
__last && __p - __first <= __request) {
663 if (__extract_delim) {
671 else if (
__n == _Num) {
675 if (__chunk ==
__last - __first) {
677 __status |= ios_base::eofbit;
680 __status |= ios_base::failbit;
689 __status |= ios_base::eofbit;
714 __extract_delim,__append_null,__is_getline);
719 template <
class _CharT,
class _Traits>
744 if (this->_M_gcount == 0)
745 this->setstate(ios_base::failbit);
752 template <
class _CharT,
class _Traits>
762 this->_M_gcount = __buf->
egptr() != __buf->
gptr()
773 if (this->_M_gcount == 0)
774 this->setstate(ios_base::failbit);
781 template <
class _CharT,
class _Traits>
787 if (__sentry && !this->
eof()) {
794 false,
false,
false);
799 false,
false,
false);
802 this->setstate(ios_base::failbit);
805 this->setstate(ios_base::eofbit | ios_base::failbit);
813 template <
class _CharT,
class _Traits>
819 if (__sentry && !this->
eof() && __nmax >= 0) {
826 this->_M_setstate_nothrow(ios_base::eofbit);
828 else if (__avail != 0) {
835 false,
false,
false);
840 false,
false,
false);
846 this->setstate(ios_base::eofbit | ios_base::failbit);
848 this->setstate(ios_base::failbit);
857 template <
class _CharT,
class _Traits>
859 sentry __sentry(*
this);
876 this->setstate(ios_base::failbit);
886 template <
class _CharT,
class _Traits,
class _Is_Delim>
890 _Is_Delim __is_delim,
891 bool __extract_delim,
bool __set_failbit) {
902 __status |= __set_failbit ? ios_base::eofbit | ios_base::failbit
906 else if (__is_delim(_Traits::to_char_type(
__c))) {
908 if (!__extract_delim)
910 __status |= ios_base::failbit;
926 template <
class _CharT,
class _Traits,
class _Is_Delim,
class _Scan_Delim>
930 _Is_Delim __is_delim, _Scan_Delim __scan_delim,
931 bool __extract_delim,
bool __set_failbit) {
932 bool __at_eof =
false;
933 bool __found_delim =
false;
936 while (__buf->
_M_egptr() != __buf->
_M_gptr() && !__at_eof && !__found_delim) {
943 __found_delim =
true;
956 __that->
setstate(__set_failbit ? ios_base::eofbit | ios_base::failbit
981 template <
class _CharT,
class _Traits,
class _Max_Chars,
class _Is_Delim>
986 _Is_Delim __is_delim,
987 bool __extract_delim,
bool __set_failbit) {
993 while (__max_chars(_Num,
__n) > 0) {
997 __status |= __set_failbit ? ios_base::eofbit | ios_base::failbit
1002 else if (__is_delim(_Traits::to_char_type(
__c))) {
1003 if (__extract_delim)
1006 __status |= ios_base::failbit;
1023 template <
class _CharT,
class _Traits,
class _Max_Chars,
class _Is_Delim,
class _Scan_Delim>
1028 _Max_Chars __max_chars,
1029 _Is_Delim __is_delim, _Scan_Delim __scan_delim,
1030 bool __extract_delim,
bool __set_failbit) {
1032 bool __at_eof =
false;
1033 bool __done =
false;
1040 if (__avail >= __m) {
1047 if (__extract_delim && __p !=
__last) {
1056 const _CharT* __p = __scan_delim(__buf->
_M_gptr(), __buf->
_M_egptr());
1062 if (__extract_delim) {
1084 __that->
setstate(__set_failbit ? ios_base::eofbit | ios_base::failbit
1085 : ios_base::eofbit);
1096 __is_delim, __extract_delim, __set_failbit);
1100 template <
class _CharT,
class _Traits>
1104 this->_M_gcount = 0;
1115 __maxss, _Const_streamsize(__maxss),
1121 __maxss, _Const_streamsize(__maxss),
1122 _Const_bool(
false),
false,
false);
1133 _Const_bool(
false),
false,
false);
1140 template <
class _CharT,
class _Traits>
1144 this->_M_gcount = 0;
1156 __maxss, _Const_streamsize(__maxss),
1162 __maxss, _Const_streamsize(__maxss),
1185 template <
class _CharT,
class _Traits>
1189 this->setstate(ios_base::badbit);
1190 else if (__buf->
gptr() != __buf->
egptr())
1194 false, __set_failbit);
1198 false, __set_failbit);
1211 template <
class _CharT,
class _Traits,
class _Is_Delim>
1215 _Is_Delim __is_delim,
1216 bool __extract_delim,
bool __rethrow) {
1229 __status |= ios_base::eofbit;
1233 else if (__is_delim(_Traits::to_char_type(
__c))) {
1234 if (!__extract_delim && !
__pushback(__src, _Traits::to_char_type(
__c)))
1235 __status |= ios_base::failbit;
1240 bool __failed =
false;
1253 if (__failed && !
__pushback(__src, _Traits::to_char_type(
__c)))
1254 __status |= ios_base::failbit;
1268 if (__rethrow && __extracted == 0)
1280 template <
class _CharT,
class _Traits,
class _Is_Delim,
class _Scan_Delim>
1284 _Scan_Delim __scan_delim, _Is_Delim __is_delim,
1285 bool __extract_delim,
bool __rethrow) {
1291 _CharT* __first = __src->
_M_gptr();
1294 bool __do_handle_exceptions =
false;
1308 __do_handle_exceptions =
true;
1318 __avail = __src->
_M_egptr() - __first;
1323 __status |= ios_base::eofbit;
1328 __extract_delim, __rethrow);
1331 __do_handle_exceptions =
false;
1337 if (__rethrow && __do_handle_exceptions && __extracted == 0)
1348 template <
class _CharT,
class _Traits>
1353 this->_M_gcount = 0;
1359 this->_M_gcount = __src->
egptr() != __src->
gptr()
1369 if (this->_M_gcount == 0)
1370 this->setstate(ios_base::failbit);
1376 template <
class _CharT,
class _Traits>
1382 _Sentry __sentry(*
this);
1385 if (__src && __dest)
1397 this->setstate(ios_base::failbit);
1406 template <
class _CharT,
class _Traits>
1415 template <
class _CharT,
class _Traits>
1421 #undef __BIS_int_type__ 1422 #undef __BIS_pos_type__ 1423 #undef __BIS_off_type__
_Traits::char_type char_type
const char_type * operator()(const char_type *__first, const char_type *__last) const
_Scan_for_char_val(char_type __val)
GLint GLint GLsizei width
static bool _STLP_CALL _S_eof(int_type __c)
_Traits::char_type char_type
_Is_wspace_null(const ctype< argument_type > *__c_type)
char_type * egptr() const
basic_streambuf< _CharT, _Traits > * rdbuf() const
char_type * first_argument_type
char_type * first_argument_type
#define __STATIC_CAST(__x, __y)
const char_type * operator()(const char_type *__first, const char_type *__last) const
void _M_handle_exception(ios_base::iostate __flag)
_Traits::int_type int_type
streamsize _STLP_CALL __copy_buffered(basic_istream< _CharT, _Traits > *__that, basic_streambuf< _CharT, _Traits > *__src, basic_streambuf< _CharT, _Traits > *__dest, _Scan_Delim __scan_delim, _Is_Delim __is_delim, bool __extract_delim, bool __rethrow)
bool operator()(argument_type __c) const
const ctype< char_type > * _M_ctype
char_type * _M_egptr() const
const ctype< argument_type > * _M_ctype
pos_type pubseekpos(pos_type __sp, ios_base::openmode __mod=ios_base::in|ios_base::out)
char_type * second_argument_type
int_type sputc(char_type __c)
#define eq(received, expected, label, type)
char_type * first_argument_type
_STLP_MOVE_TO_STD_NAMESPACE _InputIter find_if(_InputIter __first, _InputIter __last, _Predicate __pred)
char_type * first_argument_type
void _STLP_CALL _M_ignore_buffered(basic_istream< _CharT, _Traits > *__that, basic_streambuf< _CharT, _Traits > *__buf, _Is_Delim __is_delim, _Scan_Delim __scan_delim, bool __extract_delim, bool __set_failbit)
_Traits::char_type argument_type
ios_base::iostate _STLP_CALL __get_num(basic_istream< _CharT, _Traits > &__that, _Number &__val)
_Scan_for_int_val(int_type __val)
#define _STLP_MOVE_TO_PRIV_NAMESPACE
char_traits< char > ::off_type off_type
_Scan_for_not_wspace(const ctype< char_type > *__c_type)
char_type * second_argument_type
virtual ~basic_iostream()
_Traits::char_type char_type
char_type * _M_gptr() const
#define _STLP_DEFAULT_CONSTRUCTED(_TTp)
_Traits::char_type argument_type
_STLP_INLINE_LOOP _InputIter __last
const char_type * operator()(const char_type *__first, const char_type *__last) const
_Is_not_wspace(const ctype< argument_type > *__c_type)
#define _STLP_MOVE_TO_STD_NAMESPACE
_STLP_STATIC_ASSERT(sizeof(nl_catd_type)<=sizeof(int)) class _STLP_CLASS_DECLSPEC _Catalog_nl_catd_map
const ctype< argument_type > * _M_ctype
char_traits< char > ::int_type int_type
_STLP_MOVE_TO_PRIV_NAMESPACE streamsize _STLP_CALL __read_unbuffered(basic_istream< _CharT, _Traits > *__that, basic_streambuf< _CharT, _Traits > *__buf, streamsize _Num, _CharT *__s, _Is_Delim __is_delim, bool __extract_delim, bool __append_null, bool __is_getline)
_Scan_for_wspace(const ctype< char_type > *__ctype)
_Self & putback(char_type __c)
char_type * second_argument_type
_STLP_INLINE_LOOP _InputIter const _Tp & __val
basic_iostream(basic_streambuf< _CharT, _Traits > *__buf)
bool _STLP_CALL __pushback(basic_streambuf< _CharT, _Traits > *__buf, _CharT __c)
_Self & getline(char_type *__s, streamsize __n, char_type delim)
void _STLP_CALL _M_ignore_unbuffered(basic_istream< _CharT, _Traits > *__that, basic_streambuf< _CharT, _Traits > *__buf, _Is_Delim __is_delim, bool __extract_delim, bool __set_failbit)
streamsize readsome(char_type *__s, streamsize __n)
char_type * second_argument_type
const char_type * operator()(const char_type *__first, const char_type *__last) const
_Self & seekg(pos_type __pos)
pos_type pubseekoff(off_type __offset, ios_base::seekdir __way, ios_base::openmode __mod=ios_base::in|ios_base::out)
const char_type * operator()(const char_type *__first, const char_type *__last) const
void _M_skip_whitespace(bool __set_failbit)
void setstate(iostate __state)
void _M_formatted_get(_CharT &__c)
const ctype< char_type > * _M_ctype
_Self & read(char_type *__s, streamsize __n)
_STLP_MOVE_TO_PRIV_NAMESPACE streamsize _STLP_CALL __copy_unbuffered(basic_istream< _CharT, _Traits > *__that, basic_streambuf< _CharT, _Traits > *__src, basic_streambuf< _CharT, _Traits > *__dest, _Is_Delim __is_delim, bool __extract_delim, bool __rethrow)
_Self & operator>>(__istream_fn __f)
streamsize sputn(const char_type *__s, streamsize __n)
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)
char_type * first_argument_type
char_type * second_argument_type
_Traits::char_type char_type
_Traits::char_type char_type
#define _STLP_END_NAMESPACE
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
__kernel_ptrdiff_t ptrdiff_t
int_type sputbackc(char_type __c)
const ctype< char_type > * _M_ctype
#define _STLP_BEGIN_NAMESPACE
bool operator()(argument_type __c) const
char_traits< char > ::pos_type pos_type
_Scan_wspace_null(const ctype< char_type > *__c_type)
streamsize _STLP_CALL __read_buffered(basic_istream< _CharT, _Traits > *__that, basic_streambuf< _CharT, _Traits > *__buf, streamsize _Num, _CharT *__s, _Is_Delim __is_delim, _Scan_Delim __scan_delim, bool __extract_delim, bool __append_null, bool __is_getline)
_Traits::int_type int_type