本文整理汇总了C++中Display::displayHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ Display::displayHandle方法的具体用法?C++ Display::displayHandle怎么用?C++ Display::displayHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::displayHandle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char * argv[])
{
DataStore dataStore;
Display display;
string path;
vector<string>options;
vector<string>pattern;
vector<string> files;
Executive executive;
if (argc == 1)
path = ".";
else
{
path = argv[1];
std::string pathTest = FileSystem::Path::getFullFileSpec(path);
DWORD ftyp = GetFileAttributesA(pathTest.c_str()); //checks if user has provided path or not
if (ftyp == INVALID_FILE_ATTRIBUTES)
path = ".";
}
pattern = executive.processArgumentsPattern(argv, argc);
options = executive.processArgumentOptions(argv, argc);
if (pattern.size() == 0)
pattern.push_back("*.*");
FileManager fileManager(options, pattern);
fileManager.search(path, dataStore);
map <string, list<DataStore::PathIter>> mapVal = dataStore.dispMap();
int number_of_directories = fileManager.number_of_dir();
int number_of_file = fileManager.number_of_files();
display.displayHandle(options, number_of_file, number_of_directories, mapVal, files, dataStore);
int flag = 1;
while (flag)
{
//options.clear();
pattern.clear();
dataStore.clear();
cin.clear();
fflush(stdin);
cout << endl << "================================================================================";
cout << "================================================================================" << endl;
cout << "**************User Inputs**************" << endl;
cout << endl << "================================================================================";
cout << "================================================================================" << endl;
cout << endl << "Please enter the text you want to search OR press enter to exit" << endl << endl;
string input = "";
//cin>> input;
input = cin.get();
if (input == "\n") //.empty())
{
cout << "\n Exiting as no text is entered!!" << endl;
break;
}
cout << "\n Please enter file pattern(s) in which text needs to be searched" << endl;
cin.clear();
fflush(stdin);
string newPattern = "";
getline(cin,newPattern);
istringstream iss(newPattern);
vector<string> tokens{ istream_iterator < string > {iss},
istream_iterator < string > {} };
regex r("[A-Za-z\\*]+\\.[A-Za-z\\*]+$");
for (string tok : tokens)
{
if (regex_match(tok, r))
pattern.push_back(tok);
}
if (pattern.size() == 0)
pattern.push_back("*.*");
string a = "/f<" + input + ">";
//options.push_back("/d");
std::vector<string>::iterator iter = options.begin();
while (iter != options.end())
{
if (*iter == a)
iter = options.erase(iter);
else
iter++;
}
options.push_back(a);
map<string, int> m;
//.........这里部分代码省略.........