本文整理汇总了C++中ArgParser::getInputFile方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgParser::getInputFile方法的具体用法?C++ ArgParser::getInputFile怎么用?C++ ArgParser::getInputFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgParser
的用法示例。
在下文中一共展示了ArgParser::getInputFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extractInitialCore
// extracts a vector<expr> that represents a core input extracted with Utils::read_core_file method
// return 0 if successful (core in resulting clause), or a positive integer if unsuccessful (with empty resultingClause).
void CoreParser::extractInitialCore(expr& ast, ArgParser parser, vector<expr>& resultingCore) {
vector<string> initialCore;
read_core_file(parser.getInputFile(), initialCore);
vector<expr> core;
unsigned i;
for (i = 0; i < initialCore.size(); ++i) {
int index = -1;
try {
index = std::stoi(initialCore[i].substr(initialCore[i].find('c', 0)+1, initialCore[i].size() - 1)); // line should be of the form "C<num>" where C is a char and <num> is an integer between 0 and the number of clauses in the ast
}
catch (std::invalid_argument& e) {
resultingCore.clear();
throw PropsitionalCoreParserException((string(__func__) + ": ERROR in parsing clause named " + initialCore[i] + "at line " + std::to_string(i) + " in core file, clause not named in the form 'C<num>' (for a given number num)").c_str(),3);
}
if (0 > index || ast.num_args() <= index) {
resultingCore.clear();
throw PropsitionalCoreParserException((string(__func__) + ": ERROR index "+ std::to_string(index) + ", at line " + std::to_string(i) + " in core file is out of bounds of formula.").c_str(),4);
}
resultingCore.push_back(ast.arg(index));
}
}