本文整理汇总了C++中boost::iends_with方法的典型用法代码示例。如果您正苦于以下问题:C++ boost::iends_with方法的具体用法?C++ boost::iends_with怎么用?C++ boost::iends_with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost
的用法示例。
在下文中一共展示了boost::iends_with方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OVKVoiceArchive
shared_ptr<VoiceArchive> VoiceCache::findArchive(int file_no) const {
std::ostringstream oss;
oss << "z" << std::setw(4) << std::setfill('0') << file_no;
fs::path file =
sound_system_.system().findFile(oss.str(), KOE_ARCHIVE_FILETYPES);
if (file.empty()) {
return shared_ptr<VoiceArchive>();
}
string file_str = file.file_string();
if (iends_with(file_str, "ovk")) {
return shared_ptr<VoiceArchive>(new OVKVoiceArchive(file, file_no));
} else if (iends_with(file_str, "nwk")) {
return shared_ptr<VoiceArchive>(new NWKVoiceArchive(file, file_no));
} else if (iends_with(file_str, "koe")) {
return shared_ptr<VoiceArchive>(new KOEPACVoiceArchive(file, file_no));
}
return shared_ptr<VoiceArchive>();
}
示例2: buildObjOfFile
GraphicsObjectData* GraphicsSystem::buildObjOfFile(
const std::string& filename) {
// Get the path to get the file type (which won't be in filename)
fs::path full_path = system().findFile(filename, OBJ_FILETYPES);
if (full_path.empty()) {
ostringstream oss;
oss << "Could not find Object compatible file \"" << filename << "\".";
throw rlvm::Exception(oss.str());
}
string file_str = full_path.string();
if (iends_with(file_str, "g00") || iends_with(file_str, "pdt")) {
return new GraphicsObjectOfFile(system(), filename);
} else if (iends_with(file_str, "anm")) {
return new AnmGraphicsObjectData(system(), filename);
} else {
ostringstream oss;
oss << "Don't know how to handle object file: \"" << filename << "\"";
throw rlvm::Exception(oss.str());
}
}
示例3: OVKVoiceSample
shared_ptr<VoiceSample> VoiceCache::findUnpackedSample(
int file_no, int index) const {
// Loose voice files are packed into directories, like:
// /KOE/0008/z000800073.ogg. We only need to search for the filename though.
std::ostringstream oss;
oss << "z"
<< std::setw(4) << std::setfill('0') << file_no
<< std::setw(5) << std::setfill('0') << index;
fs::path file =
sound_system_.system().findFile(oss.str(), KOE_LOOSE_FILETYPES);
string file_str = file.file_string();
if (iends_with(file_str, "ogg")) {
return shared_ptr<VoiceSample>(new OVKVoiceSample(file));
}
return shared_ptr<VoiceSample>();
}