Maze Builder Docs 8.2.1
Loading...
Searching...
No Matches
io_utils.h
Go to the documentation of this file.
1#ifndef IO_UTILS_H
2#define IO_UTILS_H
3
4#include <filesystem>
5#include <ostream>
6#include <string>
7#include <string_view>
8
11namespace mazes
12{
16 {
17 public:
23 static bool write(std::ostream& oss, const std::string& data, std::string_view delimiter = "\n") noexcept;
24
29 static bool write_file(const std::string& filename, const std::string& data) noexcept;
30
34 static std::string get_full_directory_path(const std::string& filepath) noexcept;
35 }; // io_utils
36}
37
38#endif // IO_UTILS_H
Handles file writing for text, stdout, and object files.
Definition io_utils.h:16
static std::string get_full_directory_path(const std::string &filepath) noexcept
Get the directory path from a full file path.
static bool write(std::ostream &oss, const std::string &data, std::string_view delimiter="\n") noexcept
Handles writing to an output stream.
static bool write_file(const std::string &filename, const std::string &data) noexcept
Write to a file.