blob: 4fb77e8dbfbe3ca1bd751a17ef14f7d2573d4c6f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/common_types.h"
namespace FileSys {
struct ReadOption {
u32 value;
static const ReadOption None;
};
enum ReadOptionFlag : u32 {
ReadOptionFlag_None = (0 << 0),
};
inline constexpr const ReadOption ReadOption::None = {ReadOptionFlag_None};
inline constexpr bool operator==(const ReadOption& lhs, const ReadOption& rhs) {
return lhs.value == rhs.value;
}
inline constexpr bool operator!=(const ReadOption& lhs, const ReadOption& rhs) {
return !(lhs == rhs);
}
static_assert(sizeof(ReadOption) == sizeof(u32));
enum WriteOptionFlag : u32 {
WriteOptionFlag_None = (0 << 0),
WriteOptionFlag_Flush = (1 << 0),
};
struct WriteOption {
u32 value;
constexpr inline bool HasFlushFlag() const {
return value & WriteOptionFlag_Flush;
}
static const WriteOption None;
static const WriteOption Flush;
};
inline constexpr const WriteOption WriteOption::None = {WriteOptionFlag_None};
inline constexpr const WriteOption WriteOption::Flush = {WriteOptionFlag_Flush};
inline constexpr bool operator==(const WriteOption& lhs, const WriteOption& rhs) {
return lhs.value == rhs.value;
}
inline constexpr bool operator!=(const WriteOption& lhs, const WriteOption& rhs) {
return !(lhs == rhs);
}
static_assert(sizeof(WriteOption) == sizeof(u32));
struct FileHandle {
void* handle;
};
} // namespace FileSys
|