本文整理汇总了C++中InStream::seekEof方法的典型用法代码示例。如果您正苦于以下问题:C++ InStream::seekEof方法的具体用法?C++ InStream::seekEof怎么用?C++ InStream::seekEof使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InStream
的用法示例。
在下文中一共展示了InStream::seekEof方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readStreamCase
vector<long long> readStreamCase(InStream& in, TResult pe, int testCase, bool& prereadCase)
{
if (!prereadCase)
{
string caseStr = in.readToken();
if (caseStr != "Case")
quitf(pe, "Expected 'Case' but found '%s' [test case %d]", compress(caseStr).c_str(), testCase);
}
string numExpStr;
stringstream ss;
ss << testCase;
ss >> numExpStr;
numExpStr += ":";
string numStr = in.readToken();
if (numExpStr != numStr)
quitf(pe, "Expected '%s' but found '%s' [test case %d]", compress(numExpStr).c_str(), compress(numStr).c_str(), testCase);
vector<long long> result;
while (!in.seekEof())
{
in.readTokenTo(token);
if (token == "Case")
{
prereadCase = true;
break;
}
result.push_back(stringToLongLong(in, token.c_str()));
}
return result;
}
示例2: readStream
vector<long long> readStream(InStream& in, TResult pe)
{
vector<long long> result;
for (int testCase = 1; !in.seekEof(); testCase++)
{
string caseStr = in.readToken();
if (caseStr != "Case")
quitf(pe, "Expected 'Case' but found '%s' [test case %d]", compress(caseStr).c_str(), testCase);
string numExpStr;
stringstream ss;
ss << testCase;
ss >> numExpStr;
numExpStr += ":";
string numStr = in.readToken();
if (numExpStr != numStr)
quitf(pe, "Expected '%s' but found '%s' [test case %d]", compress(numExpStr).c_str(), compress(numStr).c_str(), testCase);
result.push_back(in.readLong());
}
return result;
}