URL: https://graphicscomputing.fr/cgp/reference/functions/files/
Description: Read text and binary files, check that a path exists, find the project folder.

# Files and paths

Read text and binary files, check that a path exists, find the project folder.

- `void assert_file_exist(std::string const& filename)` - Raises an error, with hints on the working directory, if the file cannot be opened.
- `bool check_file_exist(std::string const& filename)` - Returns true if the file can be opened for reading, false otherwise.
- `bool check_path_exist(std::string const& pathname)` - Returns true if a file or directory exists at the given path, false otherwise.
- `size_t file_get_size(std::string const& filename)` - Size of a file in bytes; the file must exist (error otherwise).
- `std::string project_path_find(std::string const& executable_path, std::string const& directory_to_find = "shaders/")` - Relative path to the project root that contains directory_to_find (shaders/ by default), searched from the current and executable directories; exits the program if not found.
- `void read_from_file(std::string const& filename, T& data)` - Reads data from a file with read_from_stream; the file must exist (error otherwise).
- `void read_from_file(std::string const& filename, std::vector<std::vector<T>>& data)` - Reads a file line by line, appending one inner vector of values per line.
- `std::vector<char> read_from_file_binary(std::string const& filename)` - Reads the whole file as a vector of bytes, stopping with an error if the file cannot be accessed or is empty.
- `std::istream& read_from_stream(std::istream& stream, std::array<T,N>& data)` - Reads the N elements of a std::array from the stream, stopping early if the stream fails.
- `std::istream& read_from_stream(std::istream& stream, T& data)` - Reads one value from the stream with operator>>.
- `std::istream& read_from_stream(std::istream& stream, std::vector<T>& data)` - Reads values until the end of the stream and appends them to the vector.
- `std::istream& read_from_stream_per_line(std::istream& stream, std::vector<T>& data)` - Reads the stream line by line, parsing each line into one element appended to the vector.
- `std::istream& read_line_from_stream(std::istream& stream, T& data)` - Reads one line of the stream and parses it into data.
- `std::string read_text_file(std::string const& filename)` - Entire content of a text file as a string; the file must exist (error otherwise).
