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


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

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


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

示例1: DirectoryCreate

void condor2nav::Download(const std::string &server, const bfs::path &url, const bfs::path &fileName, unsigned timeout /* = 30 */)
{
  DirectoryCreate(fileName.parent_path());
  bfs::ofstream out{fileName, std::ios_base::out | std::ios_base::binary};
  CIStream in{server, url.generic_string(), timeout};
  out << in;
}
开发者ID:mpusz,项目名称:Condor2Nav,代码行数:7,代码来源:tools.cpp

示例2: item_action

void item_action(const bfs::path& ipath)
{
	/* use file_status instead of is_xxx */
	bfs::file_status sts=bfs::status(ipath);
	/* status_error, file_not_found, regular_file, directory_file,
	 * symlink_file, block_file, character_file, fifo_file, socket_file,
	 * type_unknown
	 */
	if (sts.type()==bfs::regular_file)
	{
		std::cout<<ipath.generic_string()<<"\t"<<bfs::file_size(ipath)<<std::endl;
	}
	else if (sts.type()==bfs::directory_file)
	{
		std::cout<<ipath.generic_string()<<std::endl;
	}
	else
	{
		std::cout<<ipath.generic_string()<<std::endl;
	}
}
开发者ID:thuleqaid,项目名称:boost_study,代码行数:21,代码来源:main.cpp

示例3: find

void find(const bfs::path& cdb_path, const options& opt)
{
    config cfg = load_config(cdb_path / "config");

    const bfs::path cdb_root = cdb_path.parent_path();
    const bfs::path search_root = bfs::initial_path();

    std::size_t prefix_size = 0;
    std::string file_match;
    if(opt.m_options.count("-a") == 0 && search_root != cdb_root)
    {
        file_match = "^" + escape_regex(
            search_root.generic_string().substr(cdb_root.string().size() + 1) + "/") + ".*";
        prefix_size = search_root.string().size() - cdb_root.string().size();
    }

    file_lock lock(cdb_path / "lock");
    lock.lock_sharable();

    const char* find_regex_options =
        opt.m_options.count("-i") ? "i" : "";
    const char* file_regex_options =
        cfg.get_value("nocase-file-match") == "on" ? "i" : "";

    bool trim = cfg.get_value("find-trim-ws") == "on";
    unsigned thread_count = get_thread_count(cfg);
    unsigned buffer_count = get_buffer_count(thread_count);

    for(unsigned i = 0; i != opt.m_args.size(); ++i)
    {
        database_ptr db = open_database(cdb_path / "db");

        std::string pattern = opt.m_args[i];
        if(opt.m_options.count("-v"))
            pattern = escape_regex(pattern);

        mt_search mts(*db, trim, prefix_size, buffer_count);

        auto worker = [&]
        {
            mts.search_db(compile_regex(pattern, 0, find_regex_options),
                          compile_regex(file_match, 0, file_regex_options));
        };

        boost::thread_group workers;
        for(unsigned i = 0; i != thread_count-1; ++i)
            workers.create_thread(worker);

        worker();

        workers.join_all();
    }
}
开发者ID:noj,项目名称:CodeDB,代码行数:53,代码来源:find.cpp

示例4: Parse

/**
 * @brief Class constructor.
 *
 * condor2nav::CFileParserINI class constructor.
 *
 * @param server The server from which to download the INI file.
 * @param url The path on the server to the INI file.
 */
condor2nav::CFileParserINI::CFileParserINI(const std::string &server, const bfs::path &url) :
  _filePath{server + url.generic_string()}
{
  CIStream inputStream{server, url.generic_string()};
  Parse(inputStream);
}
开发者ID:mpusz,项目名称:Condor2Nav,代码行数:14,代码来源:fileParserINI.cpp


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