QuasarEngine
Cross-platform 3D engine and editor
Toggle main menu visibility
Loading...
Searching...
No Matches
File.h
Go to the documentation of this file.
1
#pragma once
2
7
8
#include <cstddef>
9
#include <filesystem>
10
#include <optional>
11
#include <span>
12
#include <string>
13
#include <string_view>
14
#include <vector>
15
16
namespace
Quasar
17
{
25
std::optional<std::string>
ReadTextFile
(
const
std::filesystem::path& path);
26
33
std::optional<std::vector<std::byte>>
ReadBinaryFile
(
const
std::filesystem::path& path);
34
42
bool
WriteTextFile
(
const
std::filesystem::path& path, std::string_view text);
43
50
bool
WriteBinaryFile
(
const
std::filesystem::path& path, std::span<const std::byte> data);
51
56
bool
CreateDirectories
(
const
std::filesystem::path& path);
57
}
Quasar
Contains all the engine code.
Quasar::WriteBinaryFile
bool WriteBinaryFile(const std::filesystem::path &path, std::span< const std::byte > data)
Writes a whole binary file, byte for byte, replacing its content if it already exists.
Quasar::ReadBinaryFile
std::optional< std::vector< std::byte > > ReadBinaryFile(const std::filesystem::path &path)
Reads a whole binary file, byte for byte.
Quasar::CreateDirectories
bool CreateDirectories(const std::filesystem::path &path)
Creates a directory and its missing parents.
Quasar::WriteTextFile
bool WriteTextFile(const std::filesystem::path &path, std::string_view text)
Writes a whole text file, replacing its content if it already exists.
Quasar::ReadTextFile
std::optional< std::string > ReadTextFile(const std::filesystem::path &path)
Reads a whole text file.
quasar
io
File.h
Generated by
1.18.0