C++ 概念: UnformattedInputFunction
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
[编辑] 要求
UnformattedInputFunction流输入功能,执行以下操作:Original:
An
UnformattedInputFunction is a stream input function that performs the following:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- 构造一个对象具有自动存储时间和basic_istream::sentry参数设置为
noskipws,将执行以下类型的trueOriginal:Constructs an object of type basic_istream::sentry with automatic storage duration and with thenoskipwsargument set to true, which performs the followingThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- 如果eofbitbadbit上设置的输入流,设置
failbit,并在此输入流的异常掩码,如果failbit异常启用抛出ios_base::failure.Original:if eofbit or badbit are set on the input stream, sets thefailbitas well, and if exceptions on failbit are enabled in this input stream's exception mask, throws ios_base::failure.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 刷新了tie()'d输出流(如适用)Original:flushes the tie()'d output stream, if applicableThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
-
- 检查的状态通过调用
sentry::operator bool(),这是相当于basic_ios::good哨兵.Original:Checks the status of the sentry by callingsentry::operator bool(), which is equivalent to basic_ios::good.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 如果返回的哨兵false或哨兵的构造函数抛出一个异常Original:If the sentry returned false or sentry's constructor threw an exception:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- 提取出的字符的数目(gcount的)设置在输入流中为零Original:sets the number of extracted characters (gcount) in the input stream to zeroThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 如果函数被调用写数组的
CharT,写CharT()(空字符)的数组的第一个位置Original:if the function was called to write to an array ofCharT, writesCharT()(the null character) to the first location of the arrayThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
-
- 如果返回的哨兵true,进行输入Original:If the sentry returned true, performs the inputThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- 如果抛出一个异常在输入过程中,设置
badbit输入流中。中启用此流的异常掩码如果badbit的异常,该异常被重新抛出.Original:if an exception is thrown during input, setsbadbitin the input stream. If exceptions on badbit are enabled in this stream's exception mask, the exception is also rethrown.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 如果没有异常被抛出在输入过程中,将输入流中提取的字符数(gcount的).Original:If no exception was thrown during input, sets the number of extracted characters (gcount) in the input stream.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
-
- 在任何情况下,无论是终止异常或返回,哨兵的析构函数被调用之前离开此功能.Original:In any event, whether terminating by exception or returning, the sentry's destructor is called before leaving this function.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 标准库
以下的标准库函数
UnformattedInputFunctions.Original:
The following standard library functions are
UnformattedInputFunctions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- std::getline,不同之处在于,它不修改gcount的.Original:std::getline, except that it does not modify gcount.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - basic_istream::operator>>(basic_streambuf*)
- basic_istream::get
- basic_istream::getline
- basic_istream::ignore
- basic_istream::peek
- basic_istream::read
- basic_istream::readsome
- basic_istream::putback,除了它首先清除
eofbitOriginal:basic_istream::putback, except that it first clearseofbitThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - basic_istream::unget,除了它首先清除
eofbitOriginal:basic_istream::unget, except that it first clearseofbitThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - basic_istream::sync,不同之处在于,它不修改gcount的Original:basic_istream::sync, except that it does not modify gcountThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - basic_istream::tellg,不同之处在于,它不修改gcount的Original:basic_istream::tellg, except that it does not modify gcountThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - basic_istream::seekg,不同之处在于,它首先清除
eofbit和不修改gcount的Original:basic_istream::seekg, except that it first clearseofbitand does not modify gcountThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - std::ws,不同之处在于,它不修改gcount的Original:std::ws, except that it does not modify gcountThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.