Namespace contains useful File related utility functions.
More...
|
static std::string | read (const fs::path &filename) |
| Read entire file into an std::string. More...
|
|
static std::vector< std::string > | readLines (const fs::path &filename) |
| Read entire file lines into std::vector<std::string> More...
|
|
static void | readChunks (const fs::path &filename, const std::size_t maxChunkSize, const std::function< void(std::vector< std::uint8_t > &&)> &callback) |
| Read file chunk by chunk. More...
|
|
static void | write (const fs::path &filename, const std::string &buffer) |
| Write buffer string to a new file. More...
|
|
Namespace contains useful File related utility functions.
◆ read()
static std::string tgbotxx::FileUtils::read |
( |
const fs::path & |
filename | ) |
|
|
static |
Read entire file into an std::string.
- Exceptions
-
Definition at line 15 of file FileUtils.hpp.
◆ readChunks()
static void tgbotxx::FileUtils::readChunks |
( |
const fs::path & |
filename, |
|
|
const std::size_t |
maxChunkSize, |
|
|
const std::function< void(std::vector< std::uint8_t > &&)> & |
callback |
|
) |
| |
|
static |
Read file chunk by chunk.
- Exceptions
-
Definition at line 45 of file FileUtils.hpp.
◆ readLines()
static std::vector<std::string> tgbotxx::FileUtils::readLines |
( |
const fs::path & |
filename | ) |
|
|
static |
Read entire file lines into std::vector<std::string>
- Exceptions
-
Definition at line 29 of file FileUtils.hpp.
◆ write()
static void tgbotxx::FileUtils::write |
( |
const fs::path & |
filename, |
|
|
const std::string & |
buffer |
|
) |
| |
|
static |
Write buffer string to a new file.
- Exceptions
-
Definition at line 67 of file FileUtils.hpp.