本文整理汇总了C++中ProgramOptions::getVerbose方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramOptions::getVerbose方法的具体用法?C++ ProgramOptions::getVerbose怎么用?C++ ProgramOptions::getVerbose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramOptions
的用法示例。
在下文中一共展示了ProgramOptions::getVerbose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addFileToList
void Parser::addFileToList ( const std::string &addfile, ProgramOptions &options, Map &fileList ) {
fs::path pathToFile = fs::system_complete ( addfile );
std::string filename = pathToFile.filename().string();
uintmax_t fileSize = fs::file_size ( pathToFile );
std::string filePath = pathToFile.string();
File *file = new File ( fs::file_size ( pathToFile ), filePath, filename );
if ( fileList.count ( filename ) ) { //check if filename is a valid key
innerMap &filemap = fileList[ filename ];
if ( filemap.count ( fileSize ) ) { //check if file_size is a valid key
filemap[ fileSize ].push_back ( file );
} else { //create new vector for the Files and insert it with the file_size as the key
boost::ptr_vector<File> *newFileList = new boost::ptr_vector<File>;
newFileList->push_back ( file );
filemap.insert ( innerMap::value_type ( fileSize, *newFileList ) );
}
} else {
boost::ptr_vector<File> *newFileList = new boost::ptr_vector<File>;
newFileList->push_back ( file );
innerMap *newInnerMap = new innerMap;
newInnerMap->insert ( innerMap::value_type ( fileSize, *newFileList ) );
fileList.insert ( Map::value_type ( filename, *newInnerMap ) );
}
if ( options.getVerbose() || options.getPrintToConsoleOnly() )
std::cout << "Added file " << filename << " (Size: " << fileSize /1024/1024 << "mb) from Directory: " << filePath << std::endl;
}