HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
file_win32.hpp
1// Copyright Take Vos 2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
8
9#include "file.hpp"
10
11namespace hi { inline namespace v1 {
12
13namespace detail {
14
15class file_win32 final : public file_impl {
16public:
18 file_win32(std::filesystem::path const &path, hi::access_mode access_mode);
19
20 [[nodiscard]] bool closed() noexcept override
21 {
22 return _file_handle == nullptr;
23 }
24
25 [[nodiscard]] HANDLE file_handle() const noexcept
26 {
27 return _file_handle;
28 }
29
30 void flush() override;
31 void close() override;
32 [[nodiscard]] std::size_t size() const override;
33 std::size_t seek(ssize_t offset, seek_whence whence) override;
34 void rename(std::filesystem::path const& destination, bool overwrite_existing) override;
35 void write(void const *data, std::size_t size) override;
36 [[nodiscard]] std::size_t read(void *data, std::size_t size) override;
37
38private:
39 HANDLE _file_handle = nullptr;
40};
41
42}
43
44}}
Defines the file class.
Rules for working with win32 headers.
seek_whence
The position in the file to seek from.
Definition file.hpp:24
access_mode
The mode in which way to open a file.
Definition file.hpp:35
@ rename
Allow renaming an open file.
@ read
Allow read access to a file.
@ write
Allow write access to a file.
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
Definition file.hpp:72
Definition file_win32.hpp:15