STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
basic_istream< _Elem, _Traits > Class Template Reference
Inheritance diagram for basic_istream< _Elem, _Traits >:
basic_ios< _Elem, _Traits > ios_base _Iosb< int > basic_ifstream< _Elem, _Traits > basic_iostream< _Elem, _Traits > basic_istringstream< _Elem, _Traits, _Alloc > istrstream basic_fstream< _Elem, _Traits > basic_stringstream< _Elem, _Traits, _Alloc > strstream

Classes

class  _Sentry_base
 
class  sentry
 

Public Types

typedef basic_istream< _Elem, _Traits > _Myt
 
typedef basic_ios< _Elem, _Traits > _Myios
 
typedef basic_streambuf< _Elem, _Traits > _Mysb
 
typedef istreambuf_iterator< _Elem, _Traits > _Iter
 
typedef ctype< _Elem > _Ctype
 
typedef num_get< _Elem, _Iter_Nget
 
typedef _Traits::int_type int_type
 
typedef _Traits::pos_type pos_type
 
typedef _Traits::off_type off_type
 
- Public Types inherited from basic_ios< _Elem, _Traits >
typedef basic_ios< _Elem, _Traits > _Myt
 
typedef basic_ostream< _Elem, _Traits > _Myos
 
typedef basic_streambuf< _Elem, _Traits > _Mysb
 
typedef ctype< _Elem > _Ctype
 
typedef _Elem char_type
 
typedef _Traits traits_type
 
typedef _Traits::int_type int_type
 
typedef _Traits::pos_type pos_type
 
typedef _Traits::off_type off_type
 
- Public Types inherited from ios_base
enum  event { erase_event, imbue_event, copyfmt_event }
 
typedef void(__CLRCALL_OR_CDECLevent_callback) (event, ios_base &, int)
 
- Public Types inherited from _Iosb< int >
enum  _Dummy_enum
 
enum  _Fmtflags
 
enum  _Iostate
 
enum  _Openmode
 
enum  _Seekdir
 
enum  
 

Public Member Functions

__CLR_OR_THIS_CALL basic_istream (_Mysb *_Strbuf, bool _Isstd=false)
 
__CLR_OR_THIS_CALL basic_istream (_Uninitialized)
 
__CLR_OR_THIS_CALL basic_istream (const _Myt &)=delete
 
_Myt &__CLR_OR_THIS_CALL operator= (const _Myt &)=delete
 
virtual __CLR_OR_THIS_CALL ~basic_istream () _NOEXCEPT
 
bool __CLR_OR_THIS_CALL _Ipfx (bool _Noskip=false)
 
bool __CLR_OR_THIS_CALL ipfx (bool _Noskip=false)
 
void __CLR_OR_THIS_CALL isfx ()
 
_Myt &__CLR_OR_THIS_CALL operator>> (_Myt &(__cdecl *_Pfn)(_Myt &))
 
_Myt &__CLR_OR_THIS_CALL operator>> (_Myios &(__cdecl *_Pfn)(_Myios &))
 
_Myt &__CLR_OR_THIS_CALL operator>> (ios_base &(__cdecl *_Pfn)(ios_base &))
 
_Myt &__CLR_OR_THIS_CALL operator>> (bool &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (short &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (unsigned short &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (int &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (unsigned int &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (long &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (unsigned long &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (long long &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (unsigned long long &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (float &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (double &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (long double &_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (void *&_Val)
 
_Myt &__CLR_OR_THIS_CALL operator>> (_Mysb *_Strbuf)
 
int_type __CLR_OR_THIS_CALL get ()
 
_Myt &__CLR_OR_THIS_CALL get (_Elem *_Str, streamsize _Count)
 
_Myt &__CLR_OR_THIS_CALL get (_Elem *_Str, streamsize _Count, _Elem _Delim)
 
_Myt &__CLR_OR_THIS_CALL get (_Elem &_Ch)
 
_Myt &__CLR_OR_THIS_CALL get (_Mysb &_Strbuf)
 
_Myt &__CLR_OR_THIS_CALL get (_Mysb &_Strbuf, _Elem _Delim)
 
_Myt &__CLR_OR_THIS_CALL getline (_Elem *_Str, streamsize _Count)
 
_Myt &__CLR_OR_THIS_CALL getline (_Elem *_Str, streamsize _Count, _Elem _Delim)
 
_Myt &__CLR_OR_THIS_CALL ignore (streamsize _Count=1, int_type _Metadelim=_Traits::eof())
 
_Myt &__CLR_OR_THIS_CALL read (_Elem *_Str, streamsize _Count)
 
streamsize __CLR_OR_THIS_CALL readsome (_Elem *_Str, streamsize _Count)
 
int_type __CLR_OR_THIS_CALL peek ()
 
_Myt &__CLR_OR_THIS_CALL putback (_Elem _Ch)
 
_Myt &__CLR_OR_THIS_CALL unget ()
 
streamsize __CLR_OR_THIS_CALL gcount () const
 
int __CLR_OR_THIS_CALL sync ()
 
_Myt &__CLR_OR_THIS_CALL seekg (pos_type _Pos)
 
_Myt &__CLR_OR_THIS_CALL seekg (off_type _Off, ios_base::seekdir _Way)
 
pos_type __CLR_OR_THIS_CALL tellg ()
 
template<>
basic_istream< unsigned short, char_traits< unsigned short > > &__CLR_OR_THIS_CALL operator>> (unsigned short &_Ch)
 
- Public Member Functions inherited from basic_ios< _Elem, _Traits >
__CLR_OR_THIS_CALL basic_ios (_Mysb *_Strbuf)
 
virtual __CLR_OR_THIS_CALL ~basic_ios () _NOEXCEPT
 
void __CLR_OR_THIS_CALL clear (iostate _State=goodbit, bool _Reraise=false)
 
void __CLR_OR_THIS_CALL setstate (iostate _State, bool _Reraise=false)
 
_Myt &__CLR_OR_THIS_CALL copyfmt (const _Myt &_Right)
 
_Myos *__CLR_OR_THIS_CALL tie () const
 
_Myos *__CLR_OR_THIS_CALL tie (_Myos *_Newtie)
 
_Mysb *__CLR_OR_THIS_CALL rdbuf () const
 
_Mysb *__CLR_OR_THIS_CALL rdbuf (_Mysb *_Strbuf)
 
locale __CLR_OR_THIS_CALL imbue (const locale &_Loc)
 
_Elem __CLR_OR_THIS_CALL fill () const
 
_Elem __CLR_OR_THIS_CALL fill (_Elem _Newfill)
 
char __CLR_OR_THIS_CALL narrow (_Elem _Ch, char _Dflt= '\0') const
 
_Elem __CLR_OR_THIS_CALL widen (char _Byte) const
 
void __CLR_OR_THIS_CALL move (_Myt &_Right)
 
void __CLR_OR_THIS_CALL move (_Myt &&_Right)
 
void __CLR_OR_THIS_CALL swap (_Myt &_Right) _NOEXCEPT
 
void __CLR_OR_THIS_CALL set_rdbuf (_Mysb *_Strbuf)
 
__CLR_OR_THIS_CALL basic_ios (const _Myt &)=delete
 
_Myt &__CLR_OR_THIS_CALL operator= (const _Myt &)=delete
 
- Public Member Functions inherited from ios_base
 _IOS_BITMASK (_Fmtflags, fmtflags)
 
 _IOS_BITMASK (_Iostate, iostate)
 
 _IOS_BITMASK (_Openmode, openmode)
 
 _IOS_BITMASK (_Seekdir, seekdir)
 
__CLR_OR_THIS_CALL operator bool () const
 
bool __CLR_OR_THIS_CALL operator! () const
 
void __CLR_OR_THIS_CALL clear (iostate _State, bool _Reraise)
 
void __CLR_OR_THIS_CALL clear (iostate _State=goodbit)
 
iostate __CLR_OR_THIS_CALL rdstate () const
 
void __CLR_OR_THIS_CALL setstate (iostate _State, bool _Exreraise)
 
void __CLR_OR_THIS_CALL setstate (iostate _State)
 
bool __CLR_OR_THIS_CALL good () const
 
bool __CLR_OR_THIS_CALL eof () const
 
bool __CLR_OR_THIS_CALL fail () const
 
bool __CLR_OR_THIS_CALL bad () const
 
iostate __CLR_OR_THIS_CALL exceptions () const
 
void __CLR_OR_THIS_CALL exceptions (iostate _Newexcept)
 
fmtflags __CLR_OR_THIS_CALL flags () const
 
fmtflags __CLR_OR_THIS_CALL flags (fmtflags _Newfmtflags)
 
fmtflags __CLR_OR_THIS_CALL setf (fmtflags _Newfmtflags)
 
fmtflags __CLR_OR_THIS_CALL setf (fmtflags _Newfmtflags, fmtflags _Mask)
 
void __CLR_OR_THIS_CALL unsetf (fmtflags _Mask)
 
streamsize __CLR_OR_THIS_CALL precision () const
 
streamsize __CLR_OR_THIS_CALL precision (streamsize _Newprecision)
 
streamsize __CLR_OR_THIS_CALL width () const
 
streamsize __CLR_OR_THIS_CALL width (streamsize _Newwidth)
 
locale __CLR_OR_THIS_CALL getloc () const
 
locale __CLR_OR_THIS_CALL imbue (const locale &_Loc)
 
long &__CLR_OR_THIS_CALL iword (int _Idx)
 
void *&__CLR_OR_THIS_CALL pword (int _Idx)
 
void __CLR_OR_THIS_CALL register_callback (event_callback _Pfn, int _Idx)
 
ios_base &__CLR_OR_THIS_CALL copyfmt (const ios_base &_Other)
 
void __CLR_OR_THIS_CALL swap (ios_base &_Right)
 
virtual __CLR_OR_THIS_CALL ~ios_base () _NOEXCEPT
 
 ios_base (const ios_base &)=delete
 
ios_baseoperator= (const ios_base &)=delete
 

Protected Member Functions

__CLR_OR_THIS_CALL basic_istream (_Myt &&_Right)
 
_Myt &__CLR_OR_THIS_CALL operator= (_Myt &&_Right)
 
void __CLR_OR_THIS_CALL swap (_Myt &_Right)
 
- Protected Member Functions inherited from basic_ios< _Elem, _Traits >
void __CLR_OR_THIS_CALL init (_Mysb *_Strbuf=0, bool _Isstd=false)
 
__CLR_OR_THIS_CALL basic_ios ()
 
- Protected Member Functions inherited from ios_base
__CLR_OR_THIS_CALL ios_base ()
 
void __CLR_OR_THIS_CALL _Init ()
 

Private Attributes

streamsize _Chcount
 

Additional Inherited Members

- Static Public Member Functions inherited from ios_base
static int __CLRCALL_OR_CDECL xalloc ()
 
static bool __CLRCALL_OR_CDECL sync_with_stdio (bool _Newsync=true)
 
static _MRTIMP2_PURE_NPURE void __CLRCALL_PURE_OR_CDECL _Addstd (ios_base *)
 
- Public Attributes inherited from ios_base
size_t _Stdstr
 
- Static Public Attributes inherited from _Iosb< int >
static constexpr _Fmtflags skipws
 
static constexpr _Fmtflags unitbuf
 
static constexpr _Fmtflags uppercase
 
static constexpr _Fmtflags showbase
 
static constexpr _Fmtflags showpoint
 
static constexpr _Fmtflags showpos
 
static constexpr _Fmtflags left
 
static constexpr _Fmtflags right
 
static constexpr _Fmtflags internal
 
static constexpr _Fmtflags dec
 
static constexpr _Fmtflags oct
 
static constexpr _Fmtflags hex
 
static constexpr _Fmtflags scientific
 
static constexpr _Fmtflags fixed
 
static constexpr _Fmtflags hexfloat
 
static constexpr _Fmtflags boolalpha
 
static constexpr _Fmtflags _Stdio
 
static constexpr _Fmtflags adjustfield
 
static constexpr _Fmtflags basefield
 
static constexpr _Fmtflags floatfield
 
static constexpr _Iostate goodbit
 
static constexpr _Iostate eofbit
 
static constexpr _Iostate failbit
 
static constexpr _Iostate badbit
 
static constexpr _Openmode in
 
static constexpr _Openmode out
 
static constexpr _Openmode ate
 
static constexpr _Openmode app
 
static constexpr _Openmode trunc
 
static constexpr _Openmode _Nocreate
 
static constexpr _Openmode _Noreplace
 
static constexpr _Openmode binary
 
static constexpr _Seekdir beg
 
static constexpr _Seekdir cur
 
static constexpr _Seekdir end
 

Member Typedef Documentation

template<class _Elem, class _Traits>
typedef ctype<_Elem> basic_istream< _Elem, _Traits >::_Ctype
template<class _Elem, class _Traits>
typedef istreambuf_iterator<_Elem, _Traits> basic_istream< _Elem, _Traits >::_Iter
template<class _Elem, class _Traits>
typedef basic_ios<_Elem, _Traits> basic_istream< _Elem, _Traits >::_Myios
template<class _Elem, class _Traits>
typedef basic_streambuf<_Elem, _Traits> basic_istream< _Elem, _Traits >::_Mysb
template<class _Elem, class _Traits>
typedef basic_istream<_Elem, _Traits> basic_istream< _Elem, _Traits >::_Myt
template<class _Elem, class _Traits>
typedef num_get<_Elem, _Iter> basic_istream< _Elem, _Traits >::_Nget
template<class _Elem, class _Traits>
typedef _Traits::int_type basic_istream< _Elem, _Traits >::int_type
template<class _Elem, class _Traits>
typedef _Traits::off_type basic_istream< _Elem, _Traits >::off_type
template<class _Elem, class _Traits>
typedef _Traits::pos_type basic_istream< _Elem, _Traits >::pos_type

Constructor & Destructor Documentation

template<class _Elem, class _Traits>
__CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::basic_istream ( _Mysb _Strbuf,
bool  _Isstd = false 
)
inlineexplicit
44  : _Chcount(0)
45  { // construct from stream buffer pointer
46  _Myios::init(_Strbuf, _Isstd);
47  }
void __CLR_OR_THIS_CALL init(_Mysb *_Strbuf=0, bool _Isstd=false)
Definition: ios:167
streamsize _Chcount
Definition: istream:879
template<class _Elem, class _Traits>
__CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::basic_istream ( _Uninitialized  )
inline
50  { // construct uninitialized
51  this->_Addstd(this);
52  }
static _MRTIMP2_PURE_NPURE void __CLRCALL_PURE_OR_CDECL _Addstd(ios_base *)
template<class _Elem, class _Traits>
__CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::basic_istream ( _Myt &&  _Right)
inlineprotected
56  : _Chcount(_Right._Chcount)
57  { // construct by moving _Right
58  _Myios::init();
60  _Right._Chcount = 0;
61  }
void __CLR_OR_THIS_CALL init(_Mysb *_Strbuf=0, bool _Isstd=false)
Definition: ios:167
void __CLR_OR_THIS_CALL move(_Myt &_Right)
Definition: ios:134
streamsize _Chcount
Definition: istream:879
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits>
__CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::basic_istream ( const _Myt )
delete
template<class _Elem, class _Traits>
virtual __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::~basic_istream ( )
inlinevirtual
80  { // destroy the object
81  }

Member Function Documentation

template<class _Elem, class _Traits>
bool __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::_Ipfx ( bool  _Noskip = false)
inline
133  { // test stream state and skip whitespace as needed
134  if (this->good())
135  { // state okay, flush tied stream and skip whitespace
136  if (_Myios::tie() != 0)
137  _Myios::tie()->flush();
138 
139  if (!_Noskip && this->flags() & ios_base::skipws)
140  { // skip whitespace
141  const _Ctype& _Ctype_fac = _USE(this->getloc(), _Ctype);
142 
144  int_type _Meta = _Myios::rdbuf()->sgetc();
145 
146  for (; ; _Meta = _Myios::rdbuf()->snextc())
147  if (_Traits::eq_int_type(_Traits::eof(), _Meta))
148  { // end of file, quit
150  break;
151  }
152  else if (!_Ctype_fac.is(_Ctype::space,
153  _Traits::to_char_type(_Meta)))
154  break; // not whitespace, quit
156  }
157 
158  if (this->good())
159  return (true);
160  }
162  return (false);
163  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:153
Definition: xlocale:2061
static constexpr _Iostate failbit
Definition: xiosbase:88
_Myt &__CLR_OR_THIS_CALL flush()
Definition: ostream:565
#define _USE(loc, fac)
Definition: xlocale:499
bool __CLR_OR_THIS_CALL good() const
Definition: xiosbase:336
static constexpr _Fmtflags skipws
Definition: xiosbase:55
#define _TRY_IO_BEGIN
Definition: ostream:29
ctype< _Elem > _Ctype
Definition: istream:28
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:375
_Traits::int_type int_type
Definition: istream:83
int_type __CLR_OR_THIS_CALL snextc()
Definition: streambuf:165
#define _CATCH_IO_END
Definition: ostream:30
_Myos *__CLR_OR_THIS_CALL tie() const
Definition: ios:77
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
streamsize __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::gcount ( ) const
inline
820  { // get count from last extraction
821  return (_Chcount);
822  }
streamsize _Chcount
Definition: istream:879
template<class _Elem, class _Traits>
int_type __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::get ( )
inline
511  { // extract a metacharacter
512  int_type _Meta = 0;
513  ios_base::iostate _State = ios_base::goodbit;
514  _Chcount = 0;
515  const sentry _Ok(*this, true);
516 
517  if (!_Ok)
518  _Meta = _Traits::eof(); // state not okay, return EOF
519  else
520  { // state okay, extract a character
522  _Meta = _Myios::rdbuf()->sgetc();
523 
524  if (_Traits::eq_int_type(_Traits::eof(), _Meta))
525  _State |= ios_base::eofbit | ios_base::failbit; // end of file
526  else
527  { // got a character, count it
528  _Myios::rdbuf()->sbumpc();
529  ++_Chcount;
530  }
532  }
533 
534  _Myios::setstate(_State);
535  return (_Meta);
536  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:153
static constexpr _Iostate failbit
Definition: xiosbase:88
#define _TRY_IO_BEGIN
Definition: ostream:29
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
int_type __CLR_OR_THIS_CALL sbumpc()
Definition: streambuf:147
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
_Traits::int_type int_type
Definition: istream:83
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
streamsize _Chcount
Definition: istream:879
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::get ( _Elem *  _Str,
streamsize  _Count 
)
inline
539  { // get up to _Count characters into NTCS
540  return (get(_Str, _Count, _Myios::widen('\n')));
541  }
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: ios:128
_Diff _Count
Definition: algorithm:1941
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::get ( _Elem *  _Str,
streamsize  _Count,
_Elem  _Delim 
)
inline
545  { // get up to _Count characters into NTCS, stop before _Delim
546  ios_base::iostate _State = ios_base::goodbit;
547  _Chcount = 0;
548  const sentry _Ok(*this, true);
549 
550  if (_Ok && 0 < _Count)
551  { // state okay, extract characters
553  int_type _Meta = _Myios::rdbuf()->sgetc();
554 
555  for (; 0 < --_Count; _Meta = _Myios::rdbuf()->snextc())
556  if (_Traits::eq_int_type(_Traits::eof(), _Meta))
557  { // end of file, quit
558  _State |= ios_base::eofbit;
559  break;
560  }
561  else if (_Traits::to_char_type(_Meta) == _Delim)
562  break; // got a delimiter, quit
563  else
564  { // got a character, add it to string
565  *_Str++ = _Traits::to_char_type(_Meta);
566  ++_Chcount;
567  }
569  }
570 
572  ? _State | ios_base::failbit : _State);
573  *_Str = _Elem(); // add terminating null character
574  return (*this);
575  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:153
static constexpr _Iostate failbit
Definition: xiosbase:88
#define _TRY_IO_BEGIN
Definition: ostream:29
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
_Traits::int_type int_type
Definition: istream:83
int_type __CLR_OR_THIS_CALL snextc()
Definition: streambuf:165
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_Diff _Count
Definition: algorithm:1941
streamsize _Chcount
Definition: istream:879
_Check_return_ _In_z_ unsigned char const * _Delim
Definition: mbstring.h:934
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::get ( _Elem &  _Ch)
inline
578  { // get a character
579  int_type _Meta = get();
580  if (!_Traits::eq_int_type(_Traits::eof(), _Meta))
581  _Ch = _Traits::to_char_type(_Meta);
582  return (*this);
583  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Traits::int_type int_type
Definition: istream:83
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::get ( _Mysb _Strbuf)
inline
586  { // extract up to newline and insert into stream buffer
587  return (get(_Strbuf, _Myios::widen('\n')));
588  }
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: ios:128
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::get ( _Mysb _Strbuf,
_Elem  _Delim 
)
inline
591  { // extract up to delimiter and insert into stream buffer
592  ios_base::iostate _State = ios_base::goodbit;
593  _Chcount = 0;
594  const sentry _Ok(*this, true);
595 
596  if (_Ok)
597  { // state okay, use facet to extract
599  int_type _Meta = _Myios::rdbuf()->sgetc();
600 
601  for (; ; _Meta = _Myios::rdbuf()->snextc())
602  if (_Traits::eq_int_type(_Traits::eof(), _Meta))
603  { // end of file, quit
604  _State |= ios_base::eofbit;
605  break;
606  }
607  else
608  { // got a character, insert it into stream buffer
609  _TRY_BEGIN
610  _Elem _Ch = _Traits::to_char_type(_Meta);
611  if (_Ch == _Delim
612  || _Traits::eq_int_type(_Traits::eof(),
613  _Strbuf.sputc(_Ch)))
614  break;
615  _CATCH_ALL
616  break;
617  _CATCH_END
618  ++_Chcount;
619  }
621  }
622 
623  if (_Chcount == 0)
624  _State |= ios_base::failbit;
625  _Myios::setstate(_State);
626  return (*this);
627  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:153
static constexpr _Iostate failbit
Definition: xiosbase:88
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
#define _TRY_IO_BEGIN
Definition: ostream:29
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
_Traits::int_type int_type
Definition: istream:83
int_type __CLR_OR_THIS_CALL snextc()
Definition: streambuf:165
#define _CATCH_ALL
Definition: xstddef:28
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
streamsize _Chcount
Definition: istream:879
_Check_return_ _In_z_ unsigned char const * _Delim
Definition: mbstring.h:934
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::getline ( _Elem *  _Str,
streamsize  _Count 
)
inline
630  { // get up to _Count characters into NTCS, discard newline
631  return (getline(_Str, _Count, _Myios::widen('\n')));
632  }
_Myt &__CLR_OR_THIS_CALL getline(_Elem *_Str, streamsize _Count)
Definition: istream:629
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: ios:128
_Diff _Count
Definition: algorithm:1941
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::getline ( _Elem *  _Str,
streamsize  _Count,
_Elem  _Delim 
)
inline
636  { // get up to _Count characters into NTCS, discard _Delim
637  ios_base::iostate _State = ios_base::goodbit;
638  _Chcount = 0;
639  const sentry _Ok(*this, true);
640 
641  if (_Ok && 0 < _Count)
642  { // state okay, use facet to extract
643  int_type _Metadelim = _Traits::to_int_type(_Delim);
644 
646  int_type _Meta = _Myios::rdbuf()->sgetc();
647 
648  for (; ; _Meta = _Myios::rdbuf()->snextc())
649  if (_Traits::eq_int_type(_Traits::eof(), _Meta))
650  { // end of file, quit
651  _State |= ios_base::eofbit;
652  break;
653  }
654  else if (_Meta == _Metadelim)
655  { // got a delimiter, discard it and quit
656  ++_Chcount;
657  _Myios::rdbuf()->sbumpc();
658  break;
659  }
660  else if (--_Count <= 0)
661  { // buffer full, quit
662  _State |= ios_base::failbit;
663  break;
664  }
665  else
666  { // got a character, add it to string
667  *_Str++ = _Traits::to_char_type(_Meta);
668  ++_Chcount;
669  }
671  }
672 
673  *_Str = _Elem(); // add terminating null character
674  _Myios::setstate(_Chcount == 0 ? _State | ios_base::failbit : _State);
675  return (*this);
676  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:153
static constexpr _Iostate failbit
Definition: xiosbase:88
#define _TRY_IO_BEGIN
Definition: ostream:29
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
int_type __CLR_OR_THIS_CALL sbumpc()
Definition: streambuf:147
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
_Traits::int_type int_type
Definition: istream:83
int_type __CLR_OR_THIS_CALL snextc()
Definition: streambuf:165
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_Diff _Count
Definition: algorithm:1941
streamsize _Chcount
Definition: istream:879
_Check_return_ _In_z_ unsigned char const * _Delim
Definition: mbstring.h:934
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::ignore ( streamsize  _Count = 1,
int_type  _Metadelim = _Traits::eof() 
)
inline
680  { // ignore up to _Count characters, discarding delimiter
681  ios_base::iostate _State = ios_base::goodbit;
682  _Chcount = 0;
683  const sentry _Ok(*this, true);
684 
685  if (_Ok && 0 < _Count)
686  { // state okay, use facet to extract
688  for (; ; )
689  { // get a metacharacter if more room in buffer
690  int_type _Meta;
692  && --_Count < 0)
693  break; // buffer full, quit
694  else if (_Traits::eq_int_type(_Traits::eof(),
695  _Meta = _Myios::rdbuf()->sbumpc()))
696  { // end of file, quit
697  _State |= ios_base::eofbit;
698  break;
699  }
700  else
701  { // got a character, count it
702  ++_Chcount;
703  if (_Meta == _Metadelim)
704  break; // got a delimiter, quit
705  }
706  }
708  }
709 
710  _Myios::setstate(_State);
711  return (*this);
712  }
#define _TRY_IO_BEGIN
Definition: ostream:29
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
_Traits::int_type int_type
Definition: istream:83
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_Diff _Count
Definition: algorithm:1941
streamsize _Chcount
Definition: istream:879
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
Definition: limits:102
template<class _Elem, class _Traits>
bool __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::ipfx ( bool  _Noskip = false)
inline
166  { // test stream state and skip whitespace as needed (retained)
167  return (_Ipfx(_Noskip));
168  }
bool __CLR_OR_THIS_CALL _Ipfx(bool _Noskip=false)
Definition: istream:132
template<class _Elem, class _Traits>
void __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::isfx ( )
inline
171  { // perform any wrapup (retained)
172  }
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator= ( _Myt &&  _Right)
inlineprotected
64  { // move from _Right
65  this->swap(_Right);
66  return (*this);
67  }
void __CLR_OR_THIS_CALL swap(_Myt &_Right)
Definition: istream:69
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator= ( const _Myt )
delete
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( _Myt __cdecl *_Pfn)(_Myt &)
inline
194  { // call basic_istream manipulator
195  return ((*_Pfn)(*this));
196  }
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( _Myios __cdecl *_Pfn)(_Myios &)
inline
199  { // call basic_ios manipulator
200  (*_Pfn)(*(_Myios *)this);
201  return (*this);
202  }
basic_ios< _Elem, _Traits > _Myios
Definition: istream:25
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( ios_base __cdecl *_Pfn)(ios_base &)
inline
205  { // call ios_base manipulator
206  (*_Pfn)(*(ios_base *)this);
207  return (*this);
208  }
Definition: xiosbase:198
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( bool _Val)
inline
211  { // extract a boolean
212  ios_base::iostate _State = ios_base::goodbit;
213  const sentry _Ok(*this);
214 
215  if (_Ok)
216  { // state okay, use facet to extract
217  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
218 
220  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
221  *this, _State, _Val);
223  }
224 
225  _Myios::setstate(_State);
226  return (*this);
227  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( short &  _Val)
inline
230  { // extract a short
231  ios_base::iostate _State = ios_base::goodbit;
232  const sentry _Ok(*this);
233 
234  if (_Ok)
235  { // state okay, use facet to extract
236  long _Tmp = 0;
237  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
238 
240  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
241  *this, _State, _Tmp);
243 
244  if (_State & ios_base::failbit
245  || _Tmp < SHRT_MIN || SHRT_MAX < _Tmp)
246  _State |= ios_base::failbit;
247  else
248  _Val = (short)_Tmp;
249  }
250 
251  _Myios::setstate(_State);
252  return (*this);
253  }
static constexpr _Iostate failbit
Definition: xiosbase:88
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
#define SHRT_MIN
Definition: limits.h:31
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
#define SHRT_MAX
Definition: limits.h:32
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( unsigned short &  _Val)
inline
265  { // extract an unsigned short
266  ios_base::iostate _State = ios_base::goodbit;
267  const sentry _Ok(*this);
268 
269  if (_Ok)
270  { // state okay, use facet to extract
271  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
272 
274  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
275  *this, _State, _Val);
277  }
278 
279  _Myios::setstate(_State);
280  return (*this);
281  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( int _Val)
inline
284  { // extract an int
285  ios_base::iostate _State = ios_base::goodbit;
286  const sentry _Ok(*this);
287 
288  if (_Ok)
289  { // state okay, use facet to extract
290  long _Tmp = 0;
291  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
292 
294  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
295  *this, _State, _Tmp);
297 
298  if (_State & ios_base::failbit
299  || _Tmp < INT_MIN || INT_MAX < _Tmp)
300  _State |= ios_base::failbit;
301  else
302  _Val = _Tmp;
303  }
304 
305  _Myios::setstate(_State);
306  return (*this);
307  }
static constexpr _Iostate failbit
Definition: xiosbase:88
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
#define INT_MIN
Definition: limits.h:34
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
#define INT_MAX
Definition: limits.h:35
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( unsigned int _Val)
inline
310  { // extract an unsigned int
311  ios_base::iostate _State = ios_base::goodbit;
312  const sentry _Ok(*this);
313  if (_Ok)
314  { // state okay, use facet to extract
315  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
316 
318  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
319  *this, _State, _Val);
321  }
322 
323  _Myios::setstate(_State);
324  return (*this);
325  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( long _Val)
inline
328  { // extract a long
329  ios_base::iostate _State = ios_base::goodbit;
330  const sentry _Ok(*this);
331 
332  if (_Ok)
333  { // state okay, use facet to extract
334  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
336  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
337  *this, _State, _Val);
339  }
340 
341  _Myios::setstate(_State);
342  return (*this);
343  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( unsigned long _Val)
inline
346  { // extract an unsigned long
347  ios_base::iostate _State = ios_base::goodbit;
348  const sentry _Ok(*this);
349 
350  if (_Ok)
351  { // state okay, use facet to extract
352  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
353 
355  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
356  *this, _State, _Val);
358  }
359 
360  _Myios::setstate(_State);
361  return (*this);
362  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( long long _Val)
inline
365  { // extract a long long
366  ios_base::iostate _State = ios_base::goodbit;
367  const sentry _Ok(*this);
368 
369  if (_Ok)
370  { // state okay, use facet to extract
371  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
372 
374  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
375  *this, _State, _Val);
377  }
378 
379  _Myios::setstate(_State);
380  return (*this);
381  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( unsigned long long _Val)
inline
384  { // extract an unsigned long long
385  ios_base::iostate _State = ios_base::goodbit;
386  const sentry _Ok(*this);
387  if (_Ok)
388  { // state okay, use facet to extract
389  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
390 
392  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
393  *this, _State, _Val);
395  }
396 
397  _Myios::setstate(_State);
398  return (*this);
399  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( float &  _Val)
inline
402  { // extract a float
403  ios_base::iostate _State = ios_base::goodbit;
404  const sentry _Ok(*this);
405 
406  if (_Ok)
407  { // state okay, use facet to extract
408  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
409 
411  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
412  *this, _State, _Val);
414  }
415 
416  _Myios::setstate(_State);
417  return (*this);
418  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( double &  _Val)
inline
421  { // extract a double
422  ios_base::iostate _State = ios_base::goodbit;
423  const sentry _Ok(*this);
424  if (_Ok)
425  { // state okay, use facet to extract
426  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
427 
429  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
430  *this, _State, _Val);
432  }
433 
434  _Myios::setstate(_State);
435  return (*this);
436  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( long double &  _Val)
inline
439  { // extract a long double
440  ios_base::iostate _State = ios_base::goodbit;
441  const sentry _Ok(*this);
442 
443  if (_Ok)
444  { // state okay, use facet to extract
445  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
447  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
448  *this, _State, _Val);
450  }
451 
452  _Myios::setstate(_State);
453  return (*this);
454  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( void *&  _Val)
inline
457  { // extract a void pointer
458  ios_base::iostate _State = ios_base::goodbit;
459  const sentry _Ok(*this);
460 
461  if (_Ok)
462  { // state okay, use facet to extract
463  const _Nget& _Nget_fac = _USE(this->getloc(), _Nget);
464 
466  _Nget_fac.get(_Iter(_Myios::rdbuf()), _Iter(0),
467  *this, _State, _Val);
469  }
470 
471  _Myios::setstate(_State);
472  return (*this);
473  }
#define _USE(loc, fac)
Definition: xlocale:499
num_get< _Elem, _Iter > _Nget
Definition: istream:29
#define _TRY_IO_BEGIN
Definition: ostream:29
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
istreambuf_iterator< _Elem, _Traits > _Iter
Definition: istream:27
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_FwdIt const _Ty _Val
Definition: algorithm:1938
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::operator>> ( _Mysb _Strbuf)
inline
476  { // extract until end-of-file into a stream buffer
477  ios_base::iostate _State = ios_base::goodbit;
478  bool _Copied = false;
479  const sentry _Ok(*this);
480 
481  if (_Ok && _Strbuf != 0)
482  { // state okay, extract characters
484  int_type _Meta = _Myios::rdbuf()->sgetc();
485 
486  for (; ; _Meta = _Myios::rdbuf()->snextc())
487  if (_Traits::eq_int_type(_Traits::eof(), _Meta))
488  { // end of file, quit
489  _State |= ios_base::eofbit;
490  break;
491  }
492  else
493  { // got a character, insert it into buffer
494  _TRY_BEGIN
495  if (_Traits::eq_int_type(_Traits::eof(),
496  _Strbuf->sputc(_Traits::to_char_type(_Meta))))
497  break;
498  _CATCH_ALL
499  break;
500  _CATCH_END
501  _Copied = true;
502  }
504  }
505 
506  _Myios::setstate(!_Copied ? _State | ios_base::failbit : _State);
507  return (*this);
508  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:153
static constexpr _Iostate failbit
Definition: xiosbase:88
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
#define _TRY_IO_BEGIN
Definition: ostream:29
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
_Traits::int_type int_type
Definition: istream:83
int_type __CLR_OR_THIS_CALL snextc()
Definition: streambuf:165
#define _CATCH_ALL
Definition: xstddef:28
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<>
basic_istream< unsigned short, char_traits< unsigned short > > &__CLR_OR_THIS_CALL basic_istream< unsigned short, char_traits< unsigned short > >::operator>> ( unsigned short &  _Ch)
inline
904  { // extract a character
905  return (_STD operator>>(*this, _Ch));
906  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
template<class _Elem, class _Traits>
int_type __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::peek ( )
inline
756  { // return next character, unconsumed
757  ios_base::iostate _State = ios_base::goodbit;
758  _Chcount = 0;
759  int_type _Meta = 0;
760  const sentry _Ok(*this, true);
761 
762  if (!_Ok)
763  _Meta = _Traits::eof(); // state not okay, return EOF
764  else
765  { // state okay, read a character
767  if (_Traits::eq_int_type(_Traits::eof(),
768  _Meta = _Myios::rdbuf()->sgetc()))
769  _State |= ios_base::eofbit;
771  }
772 
773  _Myios::setstate(_State);
774  return (_Meta);
775  }
#define _TRY_IO_BEGIN
Definition: ostream:29
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
_Traits::int_type int_type
Definition: istream:83
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
streamsize _Chcount
Definition: istream:879
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::putback ( _Elem  _Ch)
inline
778  { // put back a character
779  _Chcount = 0;
780  ios_base::iostate _State = ios_base::goodbit;
781  ios_base::iostate _Oldstate = _Myios::rdstate();
782  _Myios::clear(_Oldstate & ~ios_base::eofbit);
783  const sentry _Ok(*this, true);
784 
785  if (_Ok)
786  { // state okay, put character back
788  if (_Traits::eq_int_type(_Traits::eof(),
789  _Myios::rdbuf()->sputbackc(_Ch)))
790  _State |= ios_base::badbit | _Oldstate;
792  }
793 
794  _Myios::setstate(_State);
795  return (*this);
796  }
iostate __CLR_OR_THIS_CALL rdstate() const
Definition: xiosbase:312
#define _TRY_IO_BEGIN
Definition: ostream:29
void __CLR_OR_THIS_CALL clear(iostate _State=goodbit, bool _Reraise=false)
Definition: ios:41
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
static constexpr _Iostate badbit
Definition: xiosbase:89
streamsize _Chcount
Definition: istream:879
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::read ( _Elem *  _Str,
streamsize  _Count 
)
inline
715  { // read up to _Count characters into buffer
716  ios_base::iostate _State = ios_base::goodbit;
717  _Chcount = 0;
718  const sentry _Ok(*this, true);
719 
720  if (_Ok && 0 < _Count)
721  { // state okay, use facet to extract
723  const streamsize _Num = _Myios::rdbuf()->sgetn(_Str, _Count);
724  _Chcount += _Num;
725  if (_Num != _Count)
726  _State |= ios_base::eofbit | ios_base::failbit; // short read
728  }
729 
730  _Myios::setstate(_State);
731  return (*this);
732  }
static constexpr _Iostate failbit
Definition: xiosbase:88
long long streamsize
Definition: iosfwd:23
#define _TRY_IO_BEGIN
Definition: ostream:29
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
_Diff _Count
Definition: algorithm:1941
streamsize __CLR_OR_THIS_CALL sgetn(_Elem *_Ptr, streamsize _Count)
Definition: streambuf:159
streamsize _Chcount
Definition: istream:879
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
streamsize __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::readsome ( _Elem *  _Str,
streamsize  _Count 
)
inline
736  { // read up to _Count characters into buffer, without blocking
737  ios_base::iostate _State = ios_base::goodbit;
738  _Chcount = 0;
739  const sentry _Ok(*this, true);
740  streamsize _Num;
741 
742  if (!_Ok)
743  _State |= ios_base::failbit; // no buffer, fail
744  else if ((_Num = _Myios::rdbuf()->in_avail()) < 0)
745  _State |= ios_base::eofbit; // no characters available
746  else if (0 < _Count && 0 < _Num)
747  { // read available
748  read(_Str, _Num < _Count ? _Num : _Count);
749  }
750 
751  _Myios::setstate(_State);
752  return (gcount());
753  }
static constexpr _Iostate failbit
Definition: xiosbase:88
long long streamsize
Definition: iosfwd:23
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
streamsize __CLR_OR_THIS_CALL gcount() const
Definition: istream:819
_Myt &__CLR_OR_THIS_CALL read(_Elem *_Str, streamsize _Count)
Definition: istream:714
static constexpr _Iostate goodbit
Definition: xiosbase:86
_Diff _Count
Definition: algorithm:1941
streamsize _Chcount
Definition: istream:879
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::seekg ( pos_type  _Pos)
inline
840  { // set input stream position to _Pos
841  ios_base::iostate _State = ios_base::goodbit;
842  ios_base::iostate _Oldstate = _Myios::rdstate();
843  _Myios::clear(_Oldstate & ~ios_base::eofbit);
844  const sentry _Ok(*this, true);
845 
846  if (!this->fail()
847  && (off_type)_Myios::rdbuf()->pubseekpos(_Pos,
848  ios_base::in) == _BADOFF)
850  return (*this);
851  }
iostate __CLR_OR_THIS_CALL rdstate() const
Definition: xiosbase:312
static constexpr _Iostate failbit
Definition: xiosbase:88
void __CLR_OR_THIS_CALL clear(iostate _State=goodbit, bool _Reraise=false)
Definition: ios:41
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
_CRTDATA2 _PGLOBAL const streamoff _BADOFF
bool __CLR_OR_THIS_CALL fail() const
Definition: xiosbase:346
static constexpr _Iostate goodbit
Definition: xiosbase:86
_Traits::off_type off_type
Definition: istream:85
static constexpr _Openmode in
Definition: xiosbase:95
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::seekg ( off_type  _Off,
ios_base::seekdir  _Way 
)
inline
854  { // change input stream position by _Off, according to _Way
855  ios_base::iostate _State = ios_base::goodbit;
856  ios_base::iostate _Oldstate = _Myios::rdstate();
857  _Myios::clear(_Oldstate & ~ios_base::eofbit);
858  const sentry _Ok(*this, true);
859 
860  if (!this->fail()
861  && (off_type)_Myios::rdbuf()->pubseekoff(_Off, _Way,
862  ios_base::in) == _BADOFF)
864  return (*this);
865  }
iostate __CLR_OR_THIS_CALL rdstate() const
Definition: xiosbase:312
static constexpr _Iostate failbit
Definition: xiosbase:88
void __CLR_OR_THIS_CALL clear(iostate _State=goodbit, bool _Reraise=false)
Definition: ios:41
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
_CRTDATA2 _PGLOBAL const streamoff _BADOFF
bool __CLR_OR_THIS_CALL fail() const
Definition: xiosbase:346
static constexpr _Iostate goodbit
Definition: xiosbase:86
_Traits::off_type off_type
Definition: istream:85
static constexpr _Openmode in
Definition: xiosbase:95
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
void __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::swap ( _Myt _Right)
inlineprotected
70  { // swap with _Right
72  _STD swap(_Chcount, _Right._Chcount);
73  }
void __CLR_OR_THIS_CALL swap(_Myt &_Right)
Definition: istream:69
void __CLR_OR_THIS_CALL swap(_Myt &_Right) _NOEXCEPT
Definition: ios:154
streamsize _Chcount
Definition: istream:879
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits>
int __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::sync ( )
inline
825  { // synchronize with input source
826  const sentry _Ok(*this, true);
827 
828  if (_Myios::rdbuf() == 0)
829  return (-1);
830  else if (_Myios::rdbuf()->pubsync() == -1)
831  { // sync failed
833  return (-1);
834  }
835  else
836  return (0);
837  }
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
static constexpr _Iostate badbit
Definition: xiosbase:89
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55
template<class _Elem, class _Traits>
pos_type __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::tellg ( )
inline
868  { // return input stream position
869  const sentry _Ok(*this, true);
870 
871  if (!this->fail())
872  return (_Myios::rdbuf()->pubseekoff(0,
874  else
875  return (pos_type(_BADOFF));
876  }
static constexpr _Seekdir cur
Definition: xiosbase:112
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_CRTDATA2 _PGLOBAL const streamoff _BADOFF
bool __CLR_OR_THIS_CALL fail() const
Definition: xiosbase:346
_Traits::pos_type pos_type
Definition: istream:84
static constexpr _Openmode in
Definition: xiosbase:95
template<class _Elem, class _Traits>
_Myt& __CLR_OR_THIS_CALL basic_istream< _Elem, _Traits >::unget ( )
inline
799  { // put back last read character
800  _Chcount = 0;
801  ios_base::iostate _State = ios_base::goodbit;
802  ios_base::iostate _Oldstate = _Myios::rdstate();
803  _Myios::clear(_Oldstate & ~ios_base::eofbit);
804  const sentry _Ok(*this, true);
805 
806  if (_Ok)
807  { // state okay, put character back
809  if (_Traits::eq_int_type(_Traits::eof(),
810  _Myios::rdbuf()->sungetc()))
811  _State |= ios_base::badbit | _Oldstate;
813  }
814 
815  _Myios::setstate(_State);
816  return (*this);
817  }
iostate __CLR_OR_THIS_CALL rdstate() const
Definition: xiosbase:312
#define _TRY_IO_BEGIN
Definition: ostream:29
void __CLR_OR_THIS_CALL clear(iostate _State=goodbit, bool _Reraise=false)
Definition: ios:41
_Mysb *__CLR_OR_THIS_CALL rdbuf() const
Definition: ios:89
_In_ size_t _Deref_pre_opt_z_ char const _In_ size_t _Inout_ mbstate_t * _State
Definition: wchar.h:78
static constexpr _Iostate goodbit
Definition: xiosbase:86
#define _CATCH_IO_END
Definition: ostream:30
static constexpr _Iostate badbit
Definition: xiosbase:89
streamsize _Chcount
Definition: istream:879
static constexpr _Iostate eofbit
Definition: xiosbase:87
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55

Member Data Documentation

template<class _Elem, class _Traits>
streamsize basic_istream< _Elem, _Traits >::_Chcount
private

The documentation for this class was generated from the following files: