Contains common functions related to file manipulation.
More...
#include <cstdio>
#include <cstring>
#include <fstream>
#include <functional>
#include <map>
#include <memory>
#include <sstream>
#include <string>
Go to the source code of this file.
Contains common functions related to file manipulation.
◆ loadStringFromFile()
| static __JAFFAR_COMMON__INLINE__ bool jaffarCommon::file::loadStringFromFile |
( |
std::string & |
dst, |
|
|
const std::string & |
fileName |
|
) |
| |
|
static |
Reads an entire file into a string
- Parameters
-
| [out] | dst | The output string onto which to save the read file |
| [in] | fileName | The name of the file to read |
- Returns
- Whether the load operation succeded (true) or failed (fail)
◆ saveStringToFile()
| static __JAFFAR_COMMON__INLINE__ bool jaffarCommon::file::saveStringToFile |
( |
const std::string & |
src, |
|
|
const std::string & |
fileName |
|
) |
| |
|
static |
Write a string into a file
- Parameters
-
| [in] | src | The source string to save into the file |
| [in] | fileName | The name of the file to write to |
- Returns
- Whether the save operation succeded (true) or failed (fail)
◆ slurp()
| static __JAFFAR_COMMON__INLINE__ std::string jaffarCommon::file::slurp |
( |
std::ifstream & |
in | ) |
|
|
static |