当前位置: 首页>>代码示例>>C++>>正文


C++ boost::iends_with方法代码示例

本文整理汇总了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>();
}
开发者ID:KitsuneFox89,项目名称:rlvm,代码行数:21,代码来源:VoiceCache.cpp

示例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());
  }
}
开发者ID:weimingtom,项目名称:rlvm,代码行数:21,代码来源:GraphicsSystem.cpp

示例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>();
}
开发者ID:KitsuneFox89,项目名称:rlvm,代码行数:19,代码来源:VoiceCache.cpp


注:本文中的boost::iends_with方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。