本文整理汇总了C++中FileParser::startFileParsing方法的典型用法代码示例。如果您正苦于以下问题:C++ FileParser::startFileParsing方法的具体用法?C++ FileParser::startFileParsing怎么用?C++ FileParser::startFileParsing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileParser
的用法示例。
在下文中一共展示了FileParser::startFileParsing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main (int argc, char* argv[]) {
int numThreads = 0;
std::string path = ".";
char *paramKey = NULL;
int paramValue = 1;
FileIndexer fi;
FileParser fp;
if(argc == 2) {
path = argv[1];
} else if(argc == 4) {
paramKey = argv[1];
paramValue = atoi(argv[2]);
if (strcmp(paramKey, "-t")) {
paramValue = 1;
cout<<"please use -t as argument for setting number of threads, default is 1"<<endl;
} else if (paramValue > 10) {
paramValue = 10;
cout<<"The number of threads can be upto 10 in this app, default is 1"<<endl;
} else if(paramValue <= 0) {
paramValue = 1;
}
path = argv[3];
} else {
cout<<"suggested command: ./ssfi -t <number_of_threads_upto_10> <Input_File_Path>"<<endl;
}
numThreads = paramValue;
if(!fi.setFilePath(path))
{
cout<< "setting the path failed"<<endl;
return 0;
}
std::list<fs::path> paths;
fi.getFileList(paths);
fp.startFileParsing(paths, numThreads);
return 0;
}