.TH "std::basic_istream< _CharT, _Traits >::sentry" 3cxx "Sun Jan 6 2013" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::basic_istream< _CharT, _Traits >::sentry \- .SH SYNOPSIS .br .PP .SS "Public Types" .in +1c .ti -1c .RI "typedef .br \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, .br _Traits > \fB__istream_type\fP" .br .ti -1c .RI "typedef \fBbasic_streambuf\fP .br < _CharT, _Traits > \fB__streambuf_type\fP" .br .ti -1c .RI "typedef _Traits \fBtraits_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBsentry\fP (\fBbasic_istream\fP< _CharT, _Traits > &__is, bool __noskipws=false)" .br .ti -1c .RI "\fBoperator bool\fP () const " .br .in -1c .SH "Detailed Description" .PP .SS "templateclass 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\&. .PP Definition at line 655 of file istream\&. .SH "Member Typedef Documentation" .PP .SS "template typedef _Traits \fBstd::basic_istream\fP< _CharT, _Traits >::\fBsentry::traits_type\fP" .PP Easy access to dependant types\&. .PP Definition at line 662 of file istream\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBstd::basic_istream\fP< _CharT, _Traits >::sentry::sentry (\fBbasic_istream\fP< _CharT, _Traits > &__is, bool__noskipws = \fCfalse\fP)\fC [explicit]\fP" .PP The constructor performs all the work\&. \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()->\fBflush()\fP\fP is called to synchronize the output sequence .IP "2." 4 if \fI__noskipws\fP is false, and \fC\fBios_base::skipws\fP\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 Definition at line 49 of file istream\&.tcc\&. .PP References std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::flags(), std::basic_ios< _CharT, _Traits >::good(), std::ios_base::goodbit, std::__ctype_abstract_base< _CharT >::is(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), std::ios_base::skipws, std::basic_streambuf< _CharT, _Traits >::snextc(), and std::basic_ios< _CharT, _Traits >::tie()\&. .SH "Member Function Documentation" .PP .SS "template \fBstd::basic_istream\fP< _CharT, _Traits >::sentry::operator bool () const\fC [inline]\fP, \fC [explicit]\fP" .PP Quick status checking\&. \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)\&. .PP Definition at line 703 of file istream\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.