QuasarEngine
Cross-platform 3D engine and editor
Loading...
Searching...
No Matches
File.h File Reference

Functions to read and write whole files, and to create directories. More...

#include <cstddef>
#include <filesystem>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  Quasar
 Contains all the engine code.

Functions

std::optional< std::string > Quasar::ReadTextFile (const std::filesystem::path &path)
 Reads a whole text file.
std::optional< std::vector< std::byte > > Quasar::ReadBinaryFile (const std::filesystem::path &path)
 Reads a whole binary file, byte for byte.
bool Quasar::WriteTextFile (const std::filesystem::path &path, std::string_view text)
 Writes a whole text file, replacing its content if it already exists.
bool Quasar::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.
bool Quasar::CreateDirectories (const std::filesystem::path &path)
 Creates a directory and its missing parents.

Detailed Description

Functions to read and write whole files, and to create directories.

Author
Kurogenshi
Date
2026-10-19