Echo Writes Code

fs.hpp

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
#ifndef CRUCIBLE_WINDOWS_FS_HPP
#define CRUCIBLE_WINDOWS_FS_HPP

#include "crucible/windows/errors.hpp"

#include "crucible/core.hpp"

#include <cstddef>
#include <string>
#include <vector>

namespace crucible::windows::fs {
  [[nodiscard]]
  auto create_directory(std::wstring const &path) -> core::result::Result<windows::errors::Error, core::none::None>;

  [[nodiscard]]
  auto create_file(std::wstring const &path, std::vector<std::byte> const &contents) -> core::result::Result<windows::errors::Error, core::none::None>;

  [[nodiscard]]
  auto delete_directory(std::wstring const &path) -> core::result::Result<windows::errors::Error, core::none::None>;

  [[nodiscard]]
  auto delete_file(std::wstring const &path) -> core::result::Result<windows::errors::Error, core::none::None>;

  [[nodiscard]]
  auto is_directory(std::wstring const &path) -> core::result::Result<windows::errors::Error, bool>;

  [[nodiscard]]
  auto is_file(std::wstring const &path) -> core::result::Result<windows::errors::Error, bool>;

  [[nodiscard]]
  auto read_directory_list(std::wstring const &path) -> core::result::Result<windows::errors::Error, std::vector<std::wstring>>;

  [[nodiscard]]
  auto read_file_data(std::wstring const &path) -> core::result::Result<windows::errors::Error, std::vector<std::byte>>;

  [[nodiscard]]
  auto read_file_size(std::wstring const &path) -> core::result::Result<windows::errors::Error, std::size_t>;
}

#endif // CRUCIBLE_WINDOWS_FS_HPP