24 static bool write(std::ostream& oss, std::string_view data, std::string_view delimiter =
"\n") noexcept;
30 static
bool write_file(std::string_view filename, std::string_view data) noexcept;
44 static std::
string parent_path(std::string_view filepath) noexcept;
49 static std::vector<std::uint8_t>
read_file_to_bytes(const std::filesystem::path& file_path) noexcept;
57 static
bool write_png(const std::filesystem::path& file_path, const std::vector<std::uint8_t>& pixels,
int width,
int height) noexcept;
66 static
bool write_jpg(const std::filesystem::path& file_path, const std::vector<std::uint8_t>& pixels,
int width,
int height,
int quality = 95) noexcept;
74 static
bool write_bmp(const std::filesystem::path& file_path, const std::vector<std::uint8_t>& pixels,
int width,
int height) noexcept;
Handles file writing for text, stdout, and object files.
Definition io_utils.h:17
static bool is_an_absolute_path(std::string_view path) noexcept
Check if a path is an absolute path.
static std::vector< std::uint8_t > read_file_to_bytes(const std::filesystem::path &file_path) noexcept
Read an entire file into memory.
static bool write(std::ostream &oss, std::string_view data, std::string_view delimiter="\n") noexcept
Handles writing to an output stream.
static bool write_jpg(const std::filesystem::path &file_path, const std::vector< std::uint8_t > &pixels, int width, int height, int quality=95) noexcept
Writes image data to a JPEG file.
static bool write_file(std::string_view filename, std::string_view data) noexcept
Write to a file.
static bool write_png(const std::filesystem::path &file_path, const std::vector< std::uint8_t > &pixels, int width, int height) noexcept
Writes pixel data to a PNG image file.
static bool write_bmp(const std::filesystem::path &file_path, const std::vector< std::uint8_t > &pixels, int width, int height) noexcept
Writes a BMP image file from pixel data.
static bool is_valid_path(std::string_view path) noexcept
Check if a path is valid.
static std::string parent_path(std::string_view filepath) noexcept
Get the directory path from a full file path.