ReXGlue SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
file_stat.h
Go to the documentation of this file.
1
10
11
#pragma once
12
13
#include <optional>
14
#include <string>
15
16
#include <
rex/bit.h
>
17
#include <
rex/types.h
>
18
19
namespace
rex::filesystem {
20
21
using
rex::HasFlags
;
22
using
rex::operator|;
23
using
rex::operator&;
24
using
rex::operator^;
25
using
rex::operator~;
26
using
rex::operator|=;
27
using
rex::operator&=;
28
using
rex::operator^=;
29
31
enum class
FileAttributes
: u16 {
32
kNone = 0x0000,
33
kReadOnly = 0x0001,
34
kHidden = 0x0002,
35
kSystem = 0x0004,
36
kDirectory = 0x0010,
37
kArchive = 0x0020,
38
kDevice = 0x0040,
39
kNormal
= 0x0080,
40
kTemporary = 0x0100,
41
kCompressed = 0x0800,
42
kEncrypted = 0x4000,
43
};
44
45
struct
FileStat
{
46
std::string
name
;
47
std::string
path
;
48
std::string
absolute_path
;
49
FileAttributes
attributes = FileAttributes::kNone;
50
u64 size = 0;
51
u64
allocation_size
= 0;
52
u64
create_time
= 0;
53
u64
access_time
= 0;
54
u64
write_time
= 0;
55
};
56
57
inline
constexpr
u32 kBytesPerSector = 0x200;
58
60
struct
FileTimes
{
61
// NOLINTNEXTLINE(readability-redundant-member-init): designated initializers omit this field
62
std::optional<u64>
create
= {};
63
// NOLINTNEXTLINE(readability-redundant-member-init): designated initializers omit this field
64
std::optional<u64>
access
= {};
65
std::optional<u64>
write
;
66
};
67
68
struct
VolumeStat
{
69
std::string
name
;
70
u32
attributes
= 0;
71
u32 component_name_max_length = 0;
72
u32 total_allocation_units = 0;
73
u32 available_allocation_units = 0;
74
u32 sectors_per_allocation_unit = 0;
75
u32 bytes_per_sector = 0;
76
};
77
78
}
// namespace rex::filesystem
79
80
template
<>
81
inline
constexpr
bool
rex::is_flags_enum<rex::filesystem::FileAttributes>
=
true
;
bit.h
rex::filesystem::FileAttributes
FileAttributes
Definition
file_stat.h:31
rex::filesystem::FileAttributes::kNormal
@ kNormal
Definition
file_stat.h:39
rex::is_flags_enum
constexpr bool is_flags_enum
Definition
bit.h:422
rex::HasFlags
constexpr bool HasFlags(E value, E flags)
Definition
bit.h:483
rex::filesystem::FileStat
Definition
file_stat.h:45
rex::filesystem::FileStat::name
std::string name
Definition
file_stat.h:46
rex::filesystem::FileStat::path
std::string path
Definition
file_stat.h:47
rex::filesystem::FileStat::access_time
u64 access_time
Definition
file_stat.h:53
rex::filesystem::FileStat::write_time
u64 write_time
Definition
file_stat.h:54
rex::filesystem::FileStat::allocation_size
u64 allocation_size
Definition
file_stat.h:51
rex::filesystem::FileStat::absolute_path
std::string absolute_path
Definition
file_stat.h:48
rex::filesystem::FileStat::create_time
u64 create_time
Definition
file_stat.h:52
rex::filesystem::FileTimes
Definition
file_stat.h:60
rex::filesystem::FileTimes::create
std::optional< u64 > create
Definition
file_stat.h:62
rex::filesystem::FileTimes::access
std::optional< u64 > access
Definition
file_stat.h:64
rex::filesystem::FileTimes::write
std::optional< u64 > write
Definition
file_stat.h:65
rex::filesystem::VolumeStat
Definition
file_stat.h:68
rex::filesystem::VolumeStat::attributes
u32 attributes
Definition
file_stat.h:70
rex::filesystem::VolumeStat::name
std::string name
Definition
file_stat.h:69
types.h
Integer types, byte order wrappers and size literals.
rex
filesystem
file_stat.h
Generated by
1.18.0