tgbotxx  1.1.6.9
Telegram Bot C++ Library
tgbotxx::FileUtils Namespace Reference

Namespace contains useful File related utility functions. More...

Functions

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...
 

Detailed Description

Namespace contains useful File related utility functions.

Function Documentation

◆ read()

static std::string tgbotxx::FileUtils::read ( const fs::path &  filename)
static

Read entire file into an std::string.

Exceptions
Exceptionon failure

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
Exceptionon failure

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
Exceptionon failure

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
Exceptionon failure

Definition at line 67 of file FileUtils.hpp.