.TH "std::basic_istream< _CharT, _Traits >::sentry" 3cxx "Thu Aug 2 2012" "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 "\fBoperator bool\fP () const " .br .ti -1c .RI "\fBsentry\fP (\fBbasic_istream\fP< _CharT, _Traits > &__is, bool __noskipws=false)" .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 'exception-safe prefix and suffix operations,' although only prefix actions are currently required by the standard\&. .PP Definition at line 632 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 636 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 \fIis\fP The input stream to guard\&. .br \fInoskipws\fP Whether to consume whitespace or not\&. .RE .PP If the stream state is good (\fIis\&.good()\fP is true), then the following actions are performed, otherwise the sentry state is false ('not okay') 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 \fInoskipws\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 ('okay')\&. .PP Definition at line 47 of file istream\&.tcc\&. .PP References std::__ctype_abstract_base< _CharT >::is(), std::basic_streambuf< _CharT, _Traits >::sgetc(), std::skipws(), and std::basic_streambuf< _CharT, _Traits >::snextc()\&. .SH "Member Function Documentation" .PP .SS "template \fBstd::basic_istream\fP< _CharT, _Traits >::sentry::operator bool () const\fC [inline]\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 673 of file istream\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.