.TH "std::basic_istream< _CharT, _Traits >::sentry" 3cxx "Wed Jul 28 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::basic_istream< _CharT, _Traits >::sentry \- Performs setup work for input streams\&. .SH SYNOPSIS .br .PP .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\&. .PP Definition at line 686 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 dependent types\&. .PP Definition at line 693 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\&. .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 Definition at line 46 of file istream\&.tcc\&. .PP References std::basic_ios< _CharT, _Traits >::good(), and std::ios_base::goodbit\&. .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\&. .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)\&. .PP Definition at line 734 of file istream\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.