SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Toggle main menu visibility
Loading...
Searching...
No Matches
FS.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstddef>
4
#include <filesystem>
5
#include <span>
6
#include <string_view>
7
#include <vector>
8
9
namespace
sourcepp::fs
{
10
11
[[nodiscard]] std::vector<std::byte>
readFileBuffer
(
const
std::filesystem::path& filepath, std::size_t startOffset = 0);
12
13
[[nodiscard]] std::vector<std::byte>
readFileBuffer
(
const
std::filesystem::path& filepath,
bool
& exists, std::size_t startOffset = 0);
14
15
[[nodiscard]] std::string
readFileText
(
const
std::filesystem::path& filepath, std::size_t startOffset = 0);
16
17
[[nodiscard]] std::string
readFileText
(
const
std::filesystem::path& filepath,
bool
& exists, std::size_t startOffset = 0);
18
19
bool
writeFileBuffer
(
const
std::filesystem::path& filepath, std::span<const std::byte> buffer);
20
21
bool
writeFileText
(
const
std::filesystem::path& filepath, std::string_view text);
22
23
}
// namespace sourcepp::fs
sourcepp::fs
Definition
FS.h:9
sourcepp::fs::readFileText
std::string readFileText(const std::filesystem::path &filepath, std::size_t startOffset=0)
Definition
FS.cpp:22
sourcepp::fs::writeFileText
bool writeFileText(const std::filesystem::path &filepath, std::string_view text)
Definition
FS.cpp:46
sourcepp::fs::writeFileBuffer
bool writeFileBuffer(const std::filesystem::path &filepath, std::span< const std::byte > buffer)
Definition
FS.cpp:37
sourcepp::fs::readFileBuffer
std::vector< std::byte > readFileBuffer(const std::filesystem::path &filepath, std::size_t startOffset=0)
Definition
FS.cpp:7
include
sourcepp
FS.h
Generated on
for SourcePP by
1.17.0