blob: d497d7c1a6b6e9492eeac3e4027c28b519469c78 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#ifndef TGBOT_FILETOOLS_H
#define TGBOT_FILETOOLS_H
#include <string>
/**
* @ingroup tools
*/
namespace FileTools {
/**
* Reads whole file to string.
* @param filePath Path to a file
* @throws exception of type std::ifstream::failure if reading fails
* @return string with file contents
*/
std::string read(const std::string& filePath);
/**
* Save file to disk.
* @param filePath Path to a file
* @throws exception of type std::ifstream::failure if writing fails
*/
void write(const std::string& content, const std::string& filePath);
};
#endif //TGBOT_FILETOOLS_H
|