.TH "std::basic_istream< _CharT, _Traits >::sentry" 3 "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::basic_istream< _CharT, _Traits >::sentry \- Performs setup work for input streams\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .SS "Public Types" .in +1c .ti -1c .RI "typedef \fB__istream_type::__ctype_type\fP \fB__ctype_type\fP" .br .ti -1c .RI "typedef _Traits::int_type \fB__int_type\fP" .br .ti -1c .RI "typedef \fBbasic_istream\fP< _CharT, _Traits > \fB__istream_type\fP" .br .ti -1c .RI "typedef \fBbasic_streambuf\fP< _CharT, _Traits > \fB__streambuf_type\fP" .br .ti -1c .RI "typedef _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 > &__is, bool __noskipws=false)" .br .RI "The constructor performs all the work\&. " .ti -1c .RI "\fBoperator bool\fP () const" .br .RI "Quick status checking\&. " .in -1c .SH "Detailed Description" .PP .SS "template .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 typedef _Traits \fBstd::basic_istream\fP< _CharT, _Traits >::sentry::traits_type" .PP Easy access to dependent types\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBstd::basic_istream\fP< _CharT, _Traits >::sentry::sentry (\fBbasic_istream\fP< _CharT, _Traits > & __is, bool __noskipws = \fRfalse\fP)\fR [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, \fRis\&.tie()->flush()\fP is called to synchronize the output sequence .IP "2." 4 if \fI__noskipws\fP is false, and \fRios_base::skipws\fP is set in \fRis\&.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::basic_ios< _CharT, _Traits >::good()\fP, and \fBstd::ios_base::goodbit\fP\&. .SH "Member Function Documentation" .PP .SS "template \fBstd::basic_istream\fP< _CharT, _Traits >::sentry::operator bool () const\fR [inline]\fP, \fR [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\&.