NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
file_info.hpp
浏览该文件的文档.
1#ifndef NEFORCE_CORE_FILE_FILE_INFO_HPP__
2#define NEFORCE_CORE_FILE_FILE_INFO_HPP__
3
11
14NEFORCE_BEGIN_NAMESPACE__
15
21
30class NEFORCE_API file_info {
31public:
33
34#ifdef NEFORCE_PLATFORM_WINDOWS
35 using size_type = ::DWORD;
36#else
37 using size_type = size_t;
38#endif
39
40private:
41 native_handle_type handle_;
42
43public:
51
52 file_info(const file_info&) = delete;
53 file_info& operator=(const file_info&) = delete;
54
62 NEFORCE_NODISCARD file_attri attributes() const noexcept;
63
70 bool set_attributes(file_attri attr) noexcept;
71
79 NEFORCE_NODISCARD size_type size() const noexcept;
80
87 NEFORCE_NODISCARD uint64_t size64() const noexcept;
88
97 bool size(size_type& out_size) const noexcept;
98
106 NEFORCE_NODISCARD datetime last_access_time() const noexcept;
107
117 bool set_last_access_time(const datetime& dt) noexcept;
118
126 NEFORCE_NODISCARD datetime last_write_time() const noexcept;
127
137 bool set_last_write_time(const datetime& dt) noexcept;
138
139#ifdef NEFORCE_PLATFORM_WINDOWS
147 NEFORCE_NODISCARD datetime creation_time() const noexcept;
148
158 bool set_creation_time(const datetime& dt) noexcept;
159#endif
160
161#ifdef NEFORCE_PLATFORM_WINDOWS
171 bool set_all_times(const datetime& create, const datetime& access, const datetime& write) noexcept;
172#else
181 bool set_all_times(const datetime& access, const datetime& write) noexcept;
182#endif
183};
184 // File
186
187NEFORCE_END_NAMESPACE__
188#endif // NEFORCE_CORE_FILE_FILE_INFO_HPP__
日期时间类
bool set_last_write_time(const datetime &dt) noexcept
设置最后修改时间
NEFORCE_NODISCARD datetime last_write_time() const noexcept
获取最后修改时间
NEFORCE_NODISCARD uint64_t size64() const noexcept
获取文件大小
NEFORCE_NODISCARD size_type size() const noexcept
获取文件大小
bool set_last_access_time(const datetime &dt) noexcept
设置最后访问时间
file_info(native_handle_type handle) noexcept
构造函数
bool set_attributes(file_attri attr) noexcept
设置文件属性
NEFORCE_NODISCARD datetime last_access_time() const noexcept
获取最后访问时间
_NEFORCE native_handle_type native_handle_type
原生文件句柄类型
size_t size_type
大小类型
NEFORCE_NODISCARD file_attri attributes() const noexcept
获取文件属性
bool set_all_times(const datetime &access, const datetime &write) noexcept
同时设置访问和修改时间
日期时间处理库
文件操作常量定义
unsigned long long uint64_t
64位无符号整数类型
file_attri
文件属性和标志枚举
uint64_t size_t
无符号大小类型
NEFORCE_ALWAYS_INLINE_INLINE thread::native_handle_type handle() noexcept
获取当前线程句柄