• Boost filesystem Tutorial Digest


    1. Boost.Filesystem file_size function returns a uintmax_t containing the size of the file named by the argument. The declaration looks like this:

    uintmax_t file_size(const path& p);

    2. For now, all you have to know is that class path has constructors that take const char* and many other useful types.

    3. Using status queries to determine file existence and type, such as exists, is_directory and is_regular_file. And a file's status can be regular file, directory file and other type.

    4. Directory_entry. A directory_entry object stores a path object, a file_status object for non-symbolic link status, and a file_status object for symbolic link status.

    5. directory_entry. After a directory_iterator is constructed, and every time operator ++ is called, it reads a directory element and stores information about it in a object of type directory_entry.

    Two end iterators are always equal.

    Directory iteration shall not yield directory entries for the current (dot) and parent (dot dot) directories.

    6. recursive_directory_iterator. Objects of type recursive_directory_iterator provide standard library compliant iteration over the content of a directory, including recursion into its sub-directories.

    The behavior of a recursive_directory_iterator is the same as a directory_iterator unless otherwise specified.

    Incrementing a recursive_director_iterator pointing to a directory causes that directory itself to be iterated ovee, as specified by the operator++ and increment functions.

    When a recursive_directory_iterator reaches the end of the directory currently being iterated over, or when pop() is called, m_level is decremented, and iteration of the parent directory continues.

    7. copy(directory_iterator(p), directory_iterator(), ostream_iterator<directory_entry>(cout, " "));

    copy(InputIterator first, InputIterator last, OutputIterator result)

    directory_itertor() return last.

    vector<int> vec_it1, vec_it2;

    copy(vec_it1.begin(), vec_it1.end(), vec_it2.begin());

    copy(vec_it1.begin(), vec_it1.end(), back_inserter(vec_it2));

    8. Building boost from visual studio 2012

    Properties > Linker > General > Additional Library Directories添加包含的库目录

    例如:D:oostoost_1_54_0stagelib

    这在[2] 没有提到, 但缺少这个步骤的话会报错

    Reference

    [1] http://www.boost.org/doc/libs/1_55_0/libs/filesystem/doc/tutorial.html

    [2] http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html#build-from-the-visual-studio-ide

    [3] http://blog.csdn.net/xzz_hust/article/details/9365511

  • 相关阅读:
    关于App_Offline.htm的应用实例(及CIM_DataFile的用法)注意Windows下
    Office2007多个文档打开时,开启多个窗口(独立进程)
    Asp.Net环境下web Pages,web Forms 及MVC的优越及缺点
    批量生成表Create SQL 示例 Generate SQL Create Scripts for existing tables with Query
    Different between datetime and timestamp, and its setting
    SqlConnection ,SqlTransaction,SqlCommand的常用法
    ASP.NET下从Server端下载文件到Client端C#
    C#中Remote文件复制简例子
    DOS BAT用法简例子
    改善SQL Procedure性能的几点方法
  • 原文地址:https://www.cnblogs.com/zhouzhuo/p/3656362.html
Copyright © 2020-2023  润新知