.TH "std::basic_istream< _CharT, _Traits >::sentry" 3cxx "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::basic_istream< _CharT, _Traits >::sentry \- Performs setup work for input streams\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Types" .in +1c .ti -1c .RI "\fBtypedef\fP \fB__istream_type::__ctype_type\fP \fB__ctype_type\fP" .br .ti -1c .RI "\fBtypedef\fP _Traits::int_type \fB__int_type\fP" .br .ti -1c .RI "\fBtypedef\fP \fBbasic_istream\fP< _CharT, _Traits > \fB__istream_type\fP" .br .ti -1c .RI "\fBtypedef\fP \fBbasic_streambuf\fP< _CharT, _Traits > \fB__streambuf_type\fP" .br .ti -1c .RI "\fBtypedef\fP _Traits \fBtraits_type\fP" .br .RI "Easy access to dependent types\&. " .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBsentry\fP (\fBbasic_istream\fP< _CharT, _Traits > &\fB__is\fP, bool \fB__noskipws\fP=\fBfalse\fP)" .br .RI "The constructor performs all the work\&. " .ti -1c .RI "\fBoperator bool\fP () \fBconst\fP" .br .RI "Quick status checking\&. " .in -1c .SH "Detailed Description" .PP .SS "template<\fBtypename\fP _CharT, \fBtypename\fP _Traits> .br class std::basic_istream< _CharT, _Traits >::sentry"Performs setup work for input streams\&. Objects of this class are created before all of the standard extractors are run\&. It is responsible for \fIexception-safe prefix and suffix operations,\fP although only prefix actions are currently required by the standard\&. .SH "Member Typedef Documentation" .PP .SS "template<\fBtypename\fP _CharT , \fBtypename\fP _Traits > \fBtypedef\fP _Traits \fBstd::basic_istream\fP< _CharT, _Traits >::sentry::traits_type" .PP Easy access to dependent types\&. .SH "Constructor & Destructor Documentation" .PP .SS "template<\fBtypename\fP _CharT , \fBtypename\fP _Traits > \fBstd::basic_istream\fP< _CharT, _Traits >::sentry::sentry (\fBbasic_istream\fP< _CharT, _Traits > & __is, bool __noskipws = \fC\fBfalse\fP\fP)\fC [explicit]\fP" .PP The constructor performs all the work\&. .PP \fBParameters\fP .RS 4 \fI__is\fP The input stream to guard\&. .br \fI__noskipws\fP Whether to consume whitespace or not\&. .RE .PP If the stream state is good (\fI__is\&.good()\fP is true), then the following actions are performed, otherwise the sentry state is false (\fInot okay\fP) and failbit is set in the stream state\&. .PP The sentry's preparatory actions are: .PP .IP "1." 4 if the stream is tied to an output stream, \fCis\&.tie()->flush()\fP is called to synchronize the output sequence .IP "2." 4 if \fI__noskipws\fP is false, and \fCios_base::skipws\fP is set in \fCis\&.flags()\fP, the sentry extracts and discards whitespace characters from the stream\&. The currently imbued locale is used to determine whether each character is whitespace\&. .PP .PP If the stream state is still good, then the sentry state becomes true (\fIokay\fP)\&. .PP References \fBstd::ios_base::badbit\fP, \fBstd::ios_base::eofbit\fP, \fBstd::ios_base::failbit\fP, \fBstd::ios_base::goodbit\fP, and \fBstd::ios_base::skipws\fP\&. .SH "Member Function Documentation" .PP .SS "template<\fBtypename\fP _CharT , \fBtypename\fP _Traits > \fBstd::basic_istream\fP< _CharT, _Traits >::sentry::operator bool () const\fC [inline]\fP, \fC [explicit]\fP" .PP Quick status checking\&. .PP \fBReturns\fP .RS 4 The sentry state\&. .RE .PP For ease of use, sentries may be converted to booleans\&. The return value is that of the sentry state (true == okay)\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.