hamigaki.png

前のページ 上に戻る ホーム 次のページ

リファレンス

Header <hamigaki/filesystem/consts.hpp>
Header <hamigaki/filesystem/device_number.hpp>
Header <hamigaki/filesystem/file_status.hpp>
Header <hamigaki/filesystem/timestamp.hpp>
Header <hamigaki/filesystem/operations.hpp>
namespace hamigaki {
  namespace filesystem {
    enum file_type;

    struct file_attributes;
    struct file_permissions;
  }
}
namespace hamigaki {
  namespace filesystem {
    struct device_number;
  }
}
namespace hamigaki {
  namespace filesystem {
    class file_status;
    bool status_known(const file_status&);
    bool exists(const file_status&);
    bool is_regular(const file_status&);
    bool is_directory(const file_status&);
    bool is_symlink(const file_status&);
    bool is_other(const file_status&);
  }
}
namespace hamigaki {
  namespace filesystem {
    struct timestamp;
  }
}
namespace hamigaki {
  namespace filesystem {

    // status functions
    file_status status(const boost::filesystem::path&, int&);
    file_status status(const boost::filesystem::path&);
    file_status symlink_status(const boost::filesystem::path&, int&);
    file_status symlink_status(const boost::filesystem::path&);

    // predicate functions
    bool exists(const boost::filesystem::path&);
    bool is_regular(const boost::filesystem::path&);
    bool is_directory(const boost::filesystem::path&);
    bool is_other(const boost::filesystem::path&);
    bool is_symlink(const boost::filesystem::path&);

    // attribute functions
    boost::filesystem::path symlink_target(const boost::filesystem::path&);
    void last_write_time(const boost::filesystem::path&, const timestamp&);
    void last_access_time(const boost::filesystem::path&, const timestamp&);
    void creation_time(const boost::filesystem::path&, const timestamp&);

    // operations functions
    int create_hard_link(const boost::filesystem::path&, 
                         const boost::filesystem::path&, int&);
    void create_hard_link(const boost::filesystem::path&, 
                          const boost::filesystem::path&);
    int create_file_symlink(const boost::filesystem::path&, 
                            const boost::filesystem::path&, int&);
    void create_file_symlink(const boost::filesystem::path&, 
                             const boost::filesystem::path&);
    int create_directory_symlink(const boost::filesystem::path&, 
                                 const boost::filesystem::path&, int&);
    void create_directory_symlink(const boost::filesystem::path&, 
                                  const boost::filesystem::path&);
    int create_symlink(const boost::filesystem::path&, 
                       const boost::filesystem::path&, int&);
    void create_symlink(const boost::filesystem::path&, 
                        const boost::filesystem::path&);
    void change_attributes(const boost::filesystem::path&, 
                           file_attributes::value_type, int&);
    void change_attributes(const boost::filesystem::path&, 
                           file_attributes::value_type);
    void change_permissions(const boost::filesystem::path&, 
                            file_permissions::value_type, int&);
    void change_permissions(const boost::filesystem::path&, 
                            file_permissions::value_type);
    int change_owner(const boost::filesystem::path&, 
                     const boost::optional<boost::intmax_t>&, 
                     const boost::optional<boost::intmax_t>&, int&);
    void change_owner(const boost::filesystem::path&, 
                      const boost::optional<boost::intmax_t>&, 
                      const boost::optional<boost::intmax_t>&);
    int change_symlink_owner(const boost::filesystem::path&, 
                             const boost::optional<boost::intmax_t>&, 
                             const boost::optional<boost::intmax_t>&, int&);
    void change_symlink_owner(const boost::filesystem::path&, 
                              const boost::optional<boost::intmax_t>&, 
                              const boost::optional<boost::intmax_t>&);
    unsigned long remove_all(const boost::filesystem::path&);

    // MS Windows specific functions
    int create_shell_link(const boost::filesystem::path&, 
                          const boost::filesystem::path&, int&);
    void create_shell_link(const boost::filesystem::path&, 
                           const boost::filesystem::path&);
  }
}

status functions

  1. file_status status(const boost::filesystem::path& p, int& ec);
    Effects: パスpのファイル状態情報を調べる。ファイルが見つからない場合は、ファイルの種類はfile_not_foundになる。それ以外のエラーが発生した場合は、ファイルの種類はstatus_unknownになり、ecにシステム依存のエラーコードを設定する。
    Returns: パスpのファイル状態情報
  2. file_status status(const boost::filesystem::path& p);
    Effects:
    int ec;
    file_status stat(status(p, ec));
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
    Returns: stat
  3. file_status symlink_status(const boost::filesystem::path& p, int& ec);
    Effects: パスpがシンボリックである場合、シンボリックリンク自体のファイル状態情報を返す。それ以外の場合は、status(p)と同じ効果とする。
    Returns: パスpのファイル状態情報
  4. file_status symlink_status(const boost::filesystem::path& p);
    Effects:
    int ec;
    file_status stat(symlink_status(p, ec));
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
    Returns: stat

predicate functions

  1. bool exists(const boost::filesystem::path& p);
    Returns: exists(status(p))
  2. bool is_regular(const boost::filesystem::path& p);
    Returns: is_regular(status(p))
  3. bool is_directory(const boost::filesystem::path& p);
    Returns: is_directory(status(p))
  4. bool is_other(const boost::filesystem::path& p);
    Returns: is_other(status(p))
  5. bool is_symlink(const boost::filesystem::path& p);
    Returns: is_symlink(symlink_status(p))

attribute functions

  1. boost::filesystem::path symlink_target(const boost::filesystem::path& p);
    Returns: パスpのシンボリックリンクのターゲットパス
  2. void last_write_time(const boost::filesystem::path& p, 
                         const timestamp& new_time);
    Effects: パスpのファイル最終更新時間をnew_timeに変更する
  3. void last_access_time(const boost::filesystem::path& p, 
                          const timestamp& new_time);
    Effects: パスpのファイル最終アクセス時間をnew_timeに変更する
  4. void creation_time(const boost::filesystem::path& p, 
                       const timestamp& new_time);
    Effects: パスpのファイル作成時間をnew_timeに変更する

operations functions

  1. int create_hard_link(const boost::filesystem::path& old_fp, 
                         const boost::filesystem::path& new_fp, int& ec);
    Effects: パスnew_fpで、パスold_fpへのハードリンクを作成する。成功した場合は、ecには0が設定される。エラーが発生した場合は、ecにシステム依存のエラーコードを設定する。
    Returns: ec
  2. void create_hard_link(const boost::filesystem::path& old_fp, 
                          const boost::filesystem::path& new_fp);
    Effects:
    int ec;
    create_hard_link(old_fp, new_fp, ec);
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
  3. int create_file_symlink(const boost::filesystem::path& old_fp, 
                            const boost::filesystem::path& new_fp, int& ec);
    Effects: パスnew_fpで、ファイルold_fpへのシンボリックリンクを作成する。成功した場合は、ecには0が設定される。エラーが発生した場合は、ecにシステム依存のエラーコードを設定する。
    Returns: ec
  4. void create_file_symlink(const boost::filesystem::path& old_fp, 
                             const boost::filesystem::path& new_fp);
    Effects:
    int ec;
    create_file_symlink(old_fp, new_fp, ec);
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
  5. int create_directory_symlink(const boost::filesystem::path& old_dp, 
                                 const boost::filesystem::path& new_dp, int& ec);
    Effects: パスnew_dpで、ディレクトリold_dpへのシンボリックリンクを作成する。成功した場合は、ecには0が設定される。エラーが発生した場合は、ecにシステム依存のエラーコードを設定する。
    Returns: ec
  6. void create_directory_symlink(const boost::filesystem::path& old_fp, 
                                  const boost::filesystem::path& new_fp);
    Effects:
    int ec;
    create_directory_symlink(old_fp, new_fp, ec);
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
  7. int create_symlink(const boost::filesystem::path& old_fp, 
                       const boost::filesystem::path& new_fp, int& ec);
    Effects: POSIXでは、create_file_symlink(old_fp, new_fp, ec)と同じ効果とする。Windowsでは、パスold_fpがファイルであればcreate_file_symlink(old_fp, new_fp, ec)、ディレクトリであればcreate_directory_symlink(old_fp, new_fp, ec)を呼び出した場合と同じ効果とする。Windowsでパスold_fpが存在しない場合は、ecにはERROR_PATH_NOT_FOUNDが設定される。
    Returns: ec
  8. void create_symlink(const boost::filesystem::path& old_fp, 
                        const boost::filesystem::path& new_fp);
    Effects:
    int ec;
    create_symlink(old_fp, new_fp, ec);
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
  9. void change_attributes(const boost::filesystem::path& p, 
                           file_attributes::value_type attr, int& ec);

    引数attrには、file_attributes構造体内の定数のいずれか、あるいはその組み合わせを指定する。但し、ファイル種別を示すtype_mask部分は無視される。

    Effects: パスpのファイル属性をattrに変更する。成功した場合は、ecには0が設定される。エラーが発生した場合は、ecにシステム依存のエラーコードを設定する。
  10. void change_attributes(const boost::filesystem::path& p, 
                           file_attributes::value_type attr);
    Effects:
    int ec;
    change_attributes(p, attr, ec);
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
  11. void change_permissions(const boost::filesystem::path& p, 
                            file_permissions::value_type perm, int& ec);

    引数permには、file_permissions構造体内の定数のいずれか、あるいはその組み合わせを指定する。但し、ファイル種別を示すtype_mask部分は無視される。

    Effects: パスpのファイル許可属性をpermに変更する。成功した場合は、ecには0が設定される。エラーが発生した場合は、ecにシステム依存のエラーコードを設定する。
  12. void change_permissions(const boost::filesystem::path& p, 
                            file_permissions::value_type perm);
    Effects:
    int ec;
    change_permissions(p, perm, ec);
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
  13. int change_owner(const boost::filesystem::path& p, 
                     const boost::optional<boost::intmax_t>& new_uid, 
                     const boost::optional<boost::intmax_t>& new_gid, int& ec);
    Effects: パスpのオーナーをnew_uidにグループをnew_gidに変更する。成功した場合は、ecには0が設定される。エラーが発生した場合は、ecにシステム依存のエラーコードを設定する。
    Returns: ec
  14. void change_owner(const boost::filesystem::path& p, 
                      const boost::optional<boost::intmax_t>& new_uid, 
                      const boost::optional<boost::intmax_t>& new_gid);
    Effects:
    int ec;
    change_owner(p, new_uid, new_gid, ec);
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
  15. int change_symlink_owner(const boost::filesystem::path& p, 
                             const boost::optional<boost::intmax_t>& new_uid, 
                             const boost::optional<boost::intmax_t>& new_gid, 
                             int& ec);
    Effects: パスpがシンボリックリンクの場合にシンボリック自身に作用することを除き、change_owner(p, new_uid, new_gid, ec)と同じ効果とする。
    Returns: ec
  16. void change_symlink_owner(const boost::filesystem::path& p, 
                              const boost::optional<boost::intmax_t>& new_uid, 
                              const boost::optional<boost::intmax_t>& new_gid);
    Effects:
    int ec;
    change_symlink_owner(p, new_uid, new_gid, ec);
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
  17. unsigned long remove_all(const boost::filesystem::path& p);
    Effects: パスp以下のファイルを再帰的に削除する。
    Notes: シンボリックリンクの削除にターゲットファイルは影響されない。
    Returns: 削除したファイル/ディレクトリの数

MS Windows specific functions

  1. int create_shell_link(const boost::filesystem::path& old_fp, 
                          const boost::filesystem::path& new_fp, int& ec);
    Effects: パスnew_fpで、パスold_fpへのシェルリンク(ショートカットファイル)を作成する。成功した場合は、ecには0が設定される。エラーが発生した場合は、ecにシステム依存のエラーコードを設定する。
    Returns: ec
  2. void create_shell_link(const boost::filesystem::path& old_fp, 
                           const boost::filesystem::path& new_fp);
    Effects:
    int ec;
    create_shell_link(old_fp, new_fp, ec);
    Throws: ecが0でない場合、boost::filesystem::filesystem_error
製作著作 © 2006, 2007 Takeshi Mouri

前のページ 上に戻る ホーム 次のページ