Foundation
Loading...
Searching...
No Matches
Filesystem.hpp
Go to the documentation of this file.
1#pragma once
2#include <Core/Core.hpp>
3#include <Bits/Chrono.hpp>
4#include <filesystem>
5namespace Foundation::Native
6{
10 using Path = std::filesystem::path;
22 size_t GetFileSize(Path const& path);
27 size_t ReadFile(Path const& path, ByteArray& data);
32 size_t WriteFile(Path const& path, Bytes data);
33} // namespace Foundation::Native
34
36{
37 inline auto format_as(path const& p) { return p.string(); }
38} // namespace std::filesystem
std::span with relaxed constructors for pointer-aliasing types and common containers.
Definition Container.hpp:59
std::unique_ptr< T, StlDeleter< T > > UniquePtr
std::unique_ptr with custom deleter that uses a Foundation::Core::Allocator to deallocate memory.
Definition Allocator.hpp:161
Platform-dependent application abstractions.
Definition Application.cpp:5
size_t GetFileSize(Path const &path)
Definition Filesystem.cpp:5
size_t WriteFile(Path const &path, Bytes data)
Writes the entire contents of a byte vector to a file.
Definition Filesystem.cpp:18
Core::Vector< char > ByteArray
Vector of bytes. Alias of Core::Vector<char>
Definition Filesystem.hpp:14
std::filesystem::path Path
OS specific filesystem path. Alias of std::filesystem::path.
Definition Filesystem.hpp:10
size_t ReadFile(Path const &path, ByteArray &data)
Reads the entire contents of a file into a byte vector.
Definition Filesystem.cpp:9
Definition Filesystem.hpp:36
auto format_as(path const &p)
Definition Filesystem.hpp:37