HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
access_mode.hpp
1
2#pragma once
3
4#include "../macros.hpp"
5#include "../utility/utility.hpp"
6#include <utility>
7
8hi_export_module(hikogui.file.access_mode);
9
10hi_export namespace hi { inline namespace v1 {
11
17hi_export enum class access_mode {
18 read = 0x1,
19 write = 0x2,
20 rename = 0x4,
21 read_lock = 0x10,
22 write_lock = 0x20,
23 open = 0x100,
24 create = 0x200,
25 truncate = 0x400,
26 random = 0x1000,
27 sequential = 0x2000,
28 no_reuse = 0x4000,
29 write_through = 0x8000,
30 create_directories = 0x10000,
31
34 truncate_or_create_for_write = create_directories | open | create | truncate | write
35};
36
37hi_export [[nodiscard]] constexpr access_mode operator|(access_mode const& lhs, access_mode const& rhs) noexcept
38{
39 return static_cast<access_mode>(std::to_underlying(lhs) | std::to_underlying(rhs));
40}
41
42hi_export [[nodiscard]] constexpr access_mode operator&(access_mode const& lhs, access_mode const& rhs) noexcept
43{
44 return static_cast<access_mode>(std::to_underlying(lhs) & std::to_underlying(rhs));
45}
46
47hi_export [[nodiscard]] constexpr bool to_bool(access_mode const& rhs) noexcept
48{
49 return to_bool(std::to_underlying(rhs));
50}
51
52}}
access_mode
The mode in which way to open a file.
Definition access_mode.hpp:17
@ truncate
After the file has been opened, truncate it.
@ read_lock
Lock the file for reading, i.e. shared-lock.
@ sequential
Hint that the data should be prefetched.
@ create
Create file if it does not exist, or fail.
@ open
Open file if it exist, or fail.
@ random
Hint the data should not be prefetched.
@ open_for_read_and_write
Default open a file for reading and writing.
@ open_for_read
Default open a file for reading.
@ write_through
Hint that writes should be send directly to disk.
@ write_lock
Lock the file for writing, i.e. exclusive-lock.
@ no_reuse
Hint that the data should not be cached.
@ rename
Allow renaming an open file.
@ read
Allow read access to a file.
@ write
Allow write access to a file.
@ create_directories
Create directory hierarchy, if the file could not be created.
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20