|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
文件属性与时间管理类 更多...
#include <file_info.hpp>
Public 类型 | |
| using | native_handle_type = _NEFORCE native_handle_type |
| 原生文件句柄类型 | |
| using | size_type = size_t |
| 大小类型 | |
Public 成员函数 | |
| file_info (native_handle_type handle) noexcept | |
| 构造函数 | |
| NEFORCE_NODISCARD file_attri | attributes () const noexcept |
| 获取文件属性 | |
| bool | set_attributes (file_attri attr) noexcept |
| 设置文件属性 | |
| NEFORCE_NODISCARD size_type | size () const noexcept |
| 获取文件大小 | |
| NEFORCE_NODISCARD uint64_t | size64 () const noexcept |
| 获取文件大小 | |
| bool | size (size_type &out_size) const noexcept |
| 获取文件大小 | |
| NEFORCE_NODISCARD datetime | last_access_time () const noexcept |
| 获取最后访问时间 | |
| bool | set_last_access_time (const datetime &dt) noexcept |
| 设置最后访问时间 | |
| NEFORCE_NODISCARD datetime | last_write_time () const noexcept |
| 获取最后修改时间 | |
| bool | set_last_write_time (const datetime &dt) noexcept |
| 设置最后修改时间 | |
| bool | set_all_times (const datetime &access, const datetime &write) noexcept |
| 同时设置访问和修改时间 | |
|
explicitnoexcept |
|
noexcept |
获取文件属性
返回文件的属性信息。 如果获取失败,返回file_attri::OTHERS。
|
noexcept |
获取最后访问时间
返回文件最后一次被读取或执行的时间。 如果获取失败,返回epoch时间。
引用了 last_access_time().
被这些函数引用 last_access_time().
|
noexcept |
获取最后修改时间
返回文件内容最后一次被修改的时间。 如果获取失败,返回epoch时间。
引用了 last_write_time().
被这些函数引用 last_write_time().
同时设置访问和修改时间
| access | 最后访问时间 |
| write | 最后修改时间 |
一次性设置文件的访问时间和修改时间。
被这些函数引用 set_last_write_time().
|
noexcept |
设置文件属性
| attr | 要设置的属性标志 |
引用了 set_attributes().
被这些函数引用 set_attributes().
|
noexcept |
|
noexcept |
设置最后修改时间
| dt | 要设置的时间 |
修改文件的最后修改时间。
引用了 set_all_times() , 以及 set_last_write_time().
被这些函数引用 set_last_write_time().
|
noexcept |
|
noexcept |
获取文件大小
| out_size | 输出文件大小 |
获取文件大小并返回操作状态,可检测文件是否超过32位范围。 对于超过32位范围的文件,返回false。
引用了 size().
|
noexcept |