header_utils
Loading...
Searching...
No Matches

Functions

std::string ghassanpl::formats::text::load_file (std::filesystem::path const &from, std::error_code &ec)
 Returns the contents of a text file as a string.
 
std::string ghassanpl::formats::text::load_file (std::filesystem::path const &from)
 Returns the contents of a text file as a string.
 
expected< std::string, std::error_code > ghassanpl::formats::text::try_load_file (std::filesystem::path const &from)
 Returns the contents of a text file as a string.
 
bool ghassanpl::formats::text::save_file (std::filesystem::path const &to, std::string_view string, std::error_code &ec)
 
void ghassanpl::formats::text::save_file (std::filesystem::path const &to, std::string_view string)
 

Detailed Description

Function Documentation

◆ load_file() [1/2]

std::string ghassanpl::formats::text::load_file ( std::filesystem::path const from)
inline

Returns the contents of a text file as a string.

Exceptions
std::runtime_errorif file not found

Definition at line 32 of file json_helpers.h.

◆ load_file() [2/2]

std::string ghassanpl::formats::text::load_file ( std::filesystem::path const from,
std::error_code &  ec 
)
inline

Returns the contents of a text file as a string.

Parameters
ecis filled with the error if any happens

Definition at line 24 of file json_helpers.h.

◆ save_file() [1/2]

void ghassanpl::formats::text::save_file ( std::filesystem::path const to,
std::string_view  string 
)
inline

Definition at line 57 of file json_helpers.h.

◆ save_file() [2/2]

bool ghassanpl::formats::text::save_file ( std::filesystem::path const to,
std::string_view  string,
std::error_code &  ec 
)
inline

Definition at line 49 of file json_helpers.h.

◆ try_load_file()

expected< std::string, std::error_code > ghassanpl::formats::text::try_load_file ( std::filesystem::path const from)
inline

Returns the contents of a text file as a string.

Definition at line 42 of file json_helpers.h.