本文整理汇总了C++中DataStore::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ DataStore::begin方法的具体用法?C++ DataStore::begin怎么用?C++ DataStore::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStore
的用法示例。
在下文中一共展示了DataStore::begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
DataStore ds;
int argc = 4;
char* argv[] = { "C://filename.cpp", "/s", "*.cpp", "*.h" };
FileManager fm(ds, argc, argv);
fm.processInput();
fm.search();
DataStore::iterator iter = ds.begin();
using pathref = DataStore::pathIterator;
std::cout << "\n FILE NAME \t\t PATH \n";
std::cout << "------------------------------------------------\n\n";
for (iter = ds.begin(); iter != ds.end(); iter++)
{
std::cout << iter->first << "\n";
std::list<pathref> itss = iter->second;
std::list<pathref>::iterator itssr;
for (itssr = itss.begin(); itssr != itss.end(); itssr++)
{
std::cout << "\t\t\t" << (*(*itssr)) << "\n";
}
}
std::cout << "\n\n";
Catalogue c(ds);
c.processTextInput("include");
std::set<std::string> inputSet = c.getFileSet();
for (auto element : inputSet) {
unsigned found = element.find_last_of("/\\");
std::string path = element.substr(0, found);
std::string file = element.substr(found + 1);
std::cout << "File : " << file << "\n";
std::cout << "Path : " << path << "\n\n";
}
std::cout << "\n\n";
}
示例2: main
int main()
{
std::cout << "\n Testing DataStore";
DataStore ds;
ds.save("one");
ds.save("two");
ds.save("three");
DataStore::iterator iter = ds.begin();
std::cout << "\n " << (*iter).c_str();
for (auto item : ds)
{
std::cout << "\n " << item.c_str();
}
std::cout << "\n\n";
}