📄 istream.cc
字号:
if(ipfx)
{
#ifndef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
use_facet<num_get<charT,istreambuf_iterator<charT,traits> > >(this->getloc())
#else
use_facet(this->getloc(),(num_get<charT,istreambuf_iterator<charT,traits> >*)0)
#endif
.get(istreambuf_iterator<charT,traits>(*this),istreambuf_iterator<charT,traits>(),*this,err,n);
}
#ifndef _RWSTD_NO_EXCEPTIONS
} // end of try block
#endif
#ifndef _RWSTD_NO_EXCEPTIONS
catch(...)
{
bool flag = false;
try {
this->setstate(ios_base::badbit);
}
catch( ios_base::failure ) { flag= true; }
if ( flag ) throw;
}
#endif // _RWSTD_NO_EXCEPTIONS
if ( err ) this->setstate(err);
return *this;
}
/*
* istream_type& operator>>(int&)
*/
template<class charT, class traits>
basic_istream<charT, traits>&
basic_istream<charT, traits>::operator>>(int& n)
{
ios_base::iostate err = 0;
#ifndef _RWSTD_NO_EXCEPTIONS
try {
#endif
_TYPENAME basic_istream<charT, traits>::sentry ipfx(*this);
if(ipfx)
{
long l;
#ifndef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
use_facet<num_get<charT,istreambuf_iterator<charT,traits> > >(this->getloc())
#else
use_facet(this->getloc(),(num_get<charT,istreambuf_iterator<charT,traits> >*)0)
#endif
.get(istreambuf_iterator<charT,traits>(*this),istreambuf_iterator<charT,traits>(),*this,err,l);
if ((err & (ios_base::failbit | ios_base::badbit)) == ios_base::goodbit)
{ if (this->flags() & (ios_base::hex | ios_base::oct))
{
unsigned int tmp_n = (unsigned int)l;
if ( tmp_n != l )
err |= ios_base::failbit;
else
n = tmp_n;
}
else
{
int tmp_n = (int)l;
if ( tmp_n != l )
err |= ios_base::failbit;
else
n = tmp_n;
}
}
}
#ifndef _RWSTD_NO_EXCEPTIONS
} // end of try block
#endif
#ifndef _RWSTD_NO_EXCEPTIONS
catch(...)
{
bool flag = false;
try {
this->setstate(ios_base::badbit);
}
catch( ios_base::failure ) { flag= true; }
if ( flag ) throw;
}
#endif
if ( err ) this->setstate(err);
return *this;
}
/*
* istream_type& operator>>(unsigned int&)
*/
template<class charT, class traits>
basic_istream<charT, traits>&
basic_istream<charT, traits>::operator>>(unsigned int& n)
{
ios_base::iostate err = 0;
#ifndef _RWSTD_NO_EXCEPTIONS
try {
#endif
_TYPENAME basic_istream<charT, traits>::sentry ipfx(*this);
if(ipfx)
{
#ifndef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
use_facet<num_get<charT,istreambuf_iterator<charT,traits> > >(this->getloc())
#else
use_facet(this->getloc(),(num_get<charT,istreambuf_iterator<charT,traits> >*)0)
#endif
.get(istreambuf_iterator<charT,traits>(*this),istreambuf_iterator<charT,traits>(),*this,err,n);
}
#ifndef _RWSTD_NO_EXCEPTIONS
} // end of try block
#endif
#ifndef _RWSTD_NO_EXCEPTIONS
catch(...)
{
bool flag = false;
try {
this->setstate(ios_base::badbit);
}
catch( ios_base::failure ) { flag= true; }
if ( flag ) throw;
}
#endif
if ( err ) this->setstate(err);
return *this;
}
/*
* istream_type& operator>>(long&)
*/
template<class charT, class traits>
basic_istream<charT, traits>&
basic_istream<charT, traits>::operator>>(long& n)
{
ios_base::iostate err = 0;
#ifndef _RWSTD_NO_EXCEPTIONS
try {
#endif
_TYPENAME basic_istream<charT, traits>::sentry ipfx(*this);
if(ipfx)
{
#ifndef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
use_facet<num_get<charT,istreambuf_iterator<charT,traits> > >(this->getloc())
#else
use_facet(this->getloc(),(num_get<charT,istreambuf_iterator<charT,traits> >*)0)
#endif
.get(istreambuf_iterator<charT,traits>(*this),istreambuf_iterator<charT,traits>(),*this,err,n);
}
#ifndef _RWSTD_NO_EXCEPTIONS
} // end of try block
#endif
#ifndef _RWSTD_NO_EXCEPTIONS
catch(...)
{
bool flag = false;
try {
this->setstate(ios_base::badbit);
}
catch( ios_base::failure ) { flag= true; }
if ( flag ) throw;
}
#endif
if ( err ) this->setstate(err);
return *this;
}
/*
* istream_type& operator>>(unsigned long&)
*/
template<class charT, class traits>
basic_istream<charT, traits>&
basic_istream<charT, traits>::operator>>(unsigned long& n)
{
ios_base::iostate err = 0;
#ifndef _RWSTD_NO_EXCEPTIONS
try {
#endif
_TYPENAME basic_istream<charT, traits>::sentry ipfx(*this);
if(ipfx)
{
#ifndef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
use_facet<num_get<charT,istreambuf_iterator<charT,traits> > >(this->getloc())
#else
use_facet(this->getloc(),(num_get<charT,istreambuf_iterator<charT,traits> >*)0)
#endif
.get(istreambuf_iterator<charT,traits>(*this),istreambuf_iterator<charT,traits>(),*this,err,n);
}
#ifndef _RWSTD_NO_EXCEPTIONS
} // end of try block
#endif
#ifndef _RWSTD_NO_EXCEPTIONS
catch(...)
{
bool flag = false;
try {
this->setstate(ios_base::badbit);
}
catch( ios_base::failure ) { flag= true; }
if ( flag ) throw;
}
#endif
if ( err ) this->setstate(err);
return *this;
}
/*
* istream_type& operator>>(float&)
*/
template<class charT, class traits>
basic_istream<charT, traits>&
basic_istream<charT, traits>::operator>>(float& f)
{
ios_base::iostate err = 0;
#ifndef _RWSTD_NO_EXCEPTIONS
try {
#endif
_TYPENAME basic_istream<charT, traits>::sentry ipfx(*this);
if(ipfx)
{
#ifndef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
use_facet<num_get<charT,istreambuf_iterator<charT,traits> > >(this->getloc())
#else
use_facet(this->getloc(),(num_get<charT,istreambuf_iterator<charT,traits> >*)0)
#endif
.get(istreambuf_iterator<charT,traits>(*this),istreambuf_iterator<charT,traits>(),*this,err,f);
}
#ifndef _RWSTD_NO_EXCEPTIONS
}
#endif
#ifndef _RWSTD_NO_EXCEPTIONS
catch(...)
{
bool flag = false;
try {
this->setstate(ios_base::badbit);
}
catch( ios_base::failure ) { flag= true; }
if ( flag ) throw;
}
#endif
if ( err ) this->setstate(err);
return *this;
}
/*
* istream_type& operator>>(double&)
*/
template<class charT, class traits>
basic_istream<charT, traits>&
basic_istream<charT, traits>::operator>>(double& f)
{
ios_base::iostate err = 0;
#ifndef _RWSTD_NO_EXCEPTIONS
try {
#endif
_TYPENAME basic_istream<charT, traits>::sentry ipfx(*this);
if(ipfx)
{
#ifndef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
use_facet<num_get<charT,istreambuf_iterator<charT,traits> > >(this->getloc())
#else
use_facet(this->getloc(),(num_get<charT,istreambuf_iterator<charT,traits> >*)0)
#endif
.get(istreambuf_iterator<charT,traits>(*this),istreambuf_iterator<charT,traits>(),*this,err,f);
}
#ifndef _RWSTD_NO_EXCEPTIONS
} // end of try block
#endif
#ifndef _RWSTD_NO_EXCEPTIONS
catch(...)
{
bool flag = false;
try {
this->setstate(ios_base::badbit);
}
catch( ios_base::failure ) { flag= true; }
if ( flag ) throw;
}
#endif
if ( err ) this->setstate(err);
return *this;
}
/*
* istream_type& operator>>(long double&)
*/
template<class charT, class traits>
basic_istream<charT, traits>&
basic_istream<charT, traits>::operator>>(long double& f)
{
ios_base::iostate err = 0;
#ifndef _RWSTD_NO_EXCEPTIONS
try {
#endif
_TYPENAME basic_istream<charT, traits>::sentry ipfx(*this);
if(ipfx)
{
#ifndef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
use_facet<num_get<charT,istreambuf_iterator<charT,traits> > >(this->getloc())
#else
use_facet(this->getloc(),(num_get<charT,istreambuf_iterator<charT,traits> >*)0)
#endif
.get(istreambuf_iterator<charT,traits>(*this),istreambuf_iterator<charT,traits>(),*this,err,f);
}
#ifndef _RWSTD_NO_EXCEPTIONS
} // end of try block
#endif
#ifndef _RWSTD_NO_EXCEPTIONS
catch(...)
{
bool flag = false;
try {
this->setstate(ios_base::badbit);
}
catch( ios_base::failure ) { flag= true; }
if ( flag ) throw;
}
#endif
if ( err ) this->setstate(err);
return *this;
}
/*
* istream_type& operator>>(_RWSTD_LONG_LONG&)
*/
#ifdef _RWSTD_LONG_LONG
template<class charT, class traits>
basic_istream<charT, traits>&
basic_istream<charT, traits>::operator>>(_RWSTD_LONG_LONG& ll)
{
ios_base::iostate err = 0;
#ifndef _RWSTD_NO_EXCEPTIONS
try {
#endif
_TYPENAME basic_istream<charT, traits>::sentry ipfx(*this);
if(ipfx) {
#ifndef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
use_facet<num_get<charT,istreambuf_iterator<charT,traits> > >(this->getloc())
#else
use_facet(this->getloc(),(num_get<charT,istreambuf_iterator<charT,traits> >*)0)
#endif
.get(istreambuf_iterator<charT,traits>(*this),istreambuf_iterator<charT,traits>(),*this,err,ll);
}
#ifndef _RWSTD_NO_EXCEPTIONS
}
#endif
#ifndef _RWSTD_NO_EXCEPTIONS
catch(...)
{
bool flag = false;
try {
this->setstate(ios_base::badbit);
}
catch( ios_base::failure ) { flag= true; }
if ( flag ) throw;
}
#endif
if ( err ) this->setstate(err);
return *this;
}
/*
* istream_type& operator>>(unsigned _RWSTD_LONG_LONG&)
*/
template<class charT, class traits>
basic_istream<charT, traits>&
basic_istream<charT, traits>::operator>>(unsigned _RWSTD_LONG_LONG& ull)
{
ios_base::iostate err = 0;
#ifndef _RWSTD_NO_EXCEPTIONS
try {
#endif
_TYPENAME basic_istream<charT, traits>::sentry ipfx(*this);
if(ipfx) {
#ifndef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
use_facet<num_get<charT,istreambuf_iterator<charT,traits> > >(this->getloc())
#else
use_facet(this->getloc(),(num_get<charT,istreambuf_iterator<charT,traits> >*)0)
#endif
.get(istreambuf_iterator<charT,traits>(*this),istreambuf_iterator<charT,traits>(),*this,err,ull);
}
#ifndef _RWSTD_NO_EXCEPTIONS
}
#endif
#ifndef _RWSTD_NO_EXCEPTIONS
catch(...)
{
bool flag = false;
try {
this->setstate(ios_base::badbit);
}
catch( ios_base::failure ) { flag= true; }
if ( flag ) throw;
}
#endif
if ( err ) this->setstate(err);
return *this;
}
#endif // _RWSTD_LONG_LONG
/*
* istream_type& operator>>(void*&)
*/
template<class charT, class traits>
basic_istream<charT, traits>&
basic_istream<charT, traits>::operator>>(void*& p)
{
ios_base::iostate err = 0;
#ifndef _RWSTD_NO_EXCEPTIONS
try {
#endif
_TYPENAME basic_istream<charT, traits>::sentry ipfx(*this);
if(ipfx)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -