cae  0.0.0
Cross-API graphics engine
Loading...
Searching...
No Matches
File.hpp
Go to the documentation of this file.
1///
2/// @file File.hpp
3/// @brief This file contains file utility functions
4/// @namespace utl
5///
6
7#pragma once
8
9#include <filesystem>
10#include <vector>
11
12namespace utl
13{
14 ///
15 /// @param path Path to the file
16 /// @return A vector of chars containing the file contents
17 /// @brief Read a file and return its contents as a vector of chars
18 ///
19 [[nodiscard]] std::vector<char> fileToVector(const std::filesystem::path &path);
20
21 ///
22 /// @param path Path to the file
23 /// @return A string containing the file contents
24 /// @brief Read a file and return its contents as a string
25 ///
26 [[nodiscard]] std::string fileToString(const std::filesystem::path &path);
27} // namespace utl
std::string fileToString(const std::filesystem::path &path)
Read a file and return its contents as a string.
Definition file.cpp:27
std::vector< char > fileToVector(const std::filesystem::path &path)
Read a file and return its contents as a vector of chars.
Definition file.cpp:6