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


C++ path::empty方法代码示例

本文整理汇总了C++中bfs::path::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ path::empty方法的具体用法?C++ path::empty怎么用?C++ path::empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bfs::path的用法示例。


在下文中一共展示了path::empty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: openBamFile

void BamReaderPool::openBamFile(const bfs::path& file) {
	if (file.empty()) {
		throw BamReaderPoolException("No BAM file specified.");
	}
	std::lock_guard<std::mutex> lock(poolmtx_); // GUARD
	closeBamFile_nolock();
	if (!open_) {
		// try to open all readers
		for (BamTools::BamReader& reader : readers_) {
			if (!reader.Open(file.c_str())) {
				throw BamReaderPoolException(
						"Unable to open BAM file " + file.string() + ":\n\t"
								+ reader.GetErrorString());
			}
		}
		// try to open index
		for (BamTools::BamReader& reader : readers_) {
			if (!reader.LocateIndex()) {
				throw BamReaderPoolException(
						"Unable to open BAM index file " + file.string() + ":\n\t"
								+ reader.GetErrorString());
			}
		}
		// all are open, now push them onto the queue
		for (BamTools::BamReader& reader : readers_) {
			pushReader(reader);
		}
		file_ = file;
		open_ = true;
	} else {
		throw BamReaderPoolException("Failed to close BAM reader pool.");
	}
}
开发者ID:bailey-lab,项目名称:bibseq,代码行数:33,代码来源:BamReaderPool.cpp

示例2: find_codedb_path

bfs::path find_codedb_path(const bfs::path& p) {
  if (p.empty()) return p;

  if (bfs::exists(p / ".codedb")) return p / ".codedb";

  return find_codedb_path(p.parent_path());
}
开发者ID:PlastecProfiles,项目名称:CodeDB,代码行数:7,代码来源:codedb.cpp

示例3: request_new_project_path

	bfs::path request_new_project_path( bfs::path default_path )
	{
		if( default_path.empty() )
			default_path = path::DEFAULT_PROJECTS_DIR;

		return bfs::path( QFileDialog::getExistingDirectory( nullptr
															, QObject::tr("New AOS Designer Project Location")
															, QString::fromStdString( default_path.string() )
															).toStdString() );
	}
开发者ID:Klaim,项目名称:aos-designer,代码行数:10,代码来源:dialogs.cpp

示例4: request_project_path

	bfs::path request_project_path( bfs::path default_path )
	{
		if( default_path.empty() )
			default_path = path::DEFAULT_PROJECTS_DIR;

		return bfs::path( QFileDialog::getOpenFileName( nullptr
														, QObject::tr( "Open AOS Designer Project" )
														, QString::fromStdString( default_path.string() )
														, QObject::tr( "AOS Designer Project (*.aosp)" )
														).toStdString() );
	}
开发者ID:Klaim,项目名称:aos-designer,代码行数:11,代码来源:dialogs.cpp

示例5: Path

/**
* @brief Dumps class data to the file.
*
* Method dumps class data to the file in the same format as input file has.
*
* @param filePath Path of the file to create (empty means overwrite input file).
*/
void condor2nav::CFileParserINI::Dump(const bfs::path &filePath /* = "" */) const
{
  COStream ostream{filePath.empty() ? Path() : filePath};
  // dump global scope
  for(const auto &v : _valuesMap)
    ostream << v.first << "=" << v.second << std::endl;

  // dump chapters
  for(auto it=_chaptersList.begin(); it!=_chaptersList.end(); ++it) {
    if(it != _chaptersList.begin() || _valuesMap.size())
      ostream << std::endl;

    ostream << "[" << it->name << "]" << std::endl;
    for(const auto &v : it->valuesMap)
      ostream << v.first << "=" << v.second << std::endl;
  }
}
开发者ID:mpusz,项目名称:Condor2Nav,代码行数:24,代码来源:fileParserINI.cpp

示例6: while

/** 
 * @brief Creates specified directory
 * 
 * Function creates given directory recursively.
 * 
 * @param dirName Directory name to created.
 *
 * @exception std::runtime_error Operation did not succeed
 */
void condor2nav::DirectoryCreate(const bfs::path &dirName)
{
  bool activeSync = false;
  const std::string str = dirName.string();
  if(str.size() > 2 && str[0] == '\\' && str[1] != '\\')
    activeSync = true;

  if(!dirName.empty()) {
    if(!activeSync) {
      bfs::create_directories(dirName);
    }
    else {
      auto path = dirName;
      std::vector<bfs::path> dirs;
      while(path.parent_path() != "\\") {
        dirs.emplace_back(path);
        path = path.parent_path();
      }
      auto &activeSync = CActiveSync::Instance();
      std::for_each(dirs.crbegin(), dirs.crend(),
                    [&](const bfs::path &d){ activeSync.DirectoryCreate(d); });
    }
  }
}
开发者ID:mpusz,项目名称:Condor2Nav,代码行数:33,代码来源:tools.cpp


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