|
MeteoIODoc 20261119.86f8ff36
Environmental timeseries pre-processing
|
A class that extends std::ofstream, adding some output functionality. Limiting the write access of the software, writing non-existing output directories, and adding a timestamp to output filenames.
#include <FStream.h>
Public Member Functions | |
| ofilestream () | |
| ofilestream (const char *filename, std::ios_base::openmode mode=std::ios_base::out) | |
| Constructor. | |
| ofilestream (const char *filename, const Config &cfgreader, std::ios_base::openmode mode=std::ios_base::out) | |
| Constructor. | |
| ofilestream (const std::string filename, std::ios_base::openmode mode=std::ios_base::out) | |
| ofilestream (const std::string filename, const Config &cfgreader, std::ios_base::openmode mode=std::ios_base::out) | |
| void | open (const char *filename, std::ios_base::openmode mode=std::ios_base::out) |
| The actual writing function. | |
Static Public Member Functions | |
| static void | createDirectoriesOfFile (const char *filename) |
| static bool | getDefault () |
| static std::string | prepareWrite (const char *filename, const Config &cfgreader) |
| Prepare the writing of a file, as done by the constructors: check that its directory is within the output sandbox (if enabled), create its directory if missing (if allowed by WRITE_DIRECTORIES) and add a timestamp to its name if old files are kept (KEEP_OLD_FILES, see IOManager) | |
| static std::string | prepareWrite (const char *filename, bool write_directories) |
| Prepare the writing of a file, see prepareWrite(const char*, const Config&) | |
Friends | |
| void | IOManager::setOfstreamDefault (const Config &i_cfg) |
|
inline |
| mio::ofilestream::ofilestream | ( | const char * | filename, |
| std::ios_base::openmode | mode = std::ios_base::out |
||
| ) |
Constructor.
| filename | file to write |
| mode | mode to open the file in |
| mio::ofilestream::ofilestream | ( | const char * | filename, |
| const Config & | cfgreader, | ||
| std::ios_base::openmode | mode = std::ios_base::out |
||
| ) |
Constructor.
| filename | file to write |
| cfgreader | instance of Config, to read the inishell config keywords |
| mode | mode to open the file in |
| mio::ofilestream::ofilestream | ( | const std::string | filename, |
| std::ios_base::openmode | mode = std::ios_base::out |
||
| ) |
| mio::ofilestream::ofilestream | ( | const std::string | filename, |
| const Config & | cfgreader, | ||
| std::ios_base::openmode | mode = std::ios_base::out |
||
| ) |
|
static |
|
static |
| void mio::ofilestream::open | ( | const char * | filename, |
| std::ios_base::openmode | mode = std::ios_base::out |
||
| ) |
The actual writing function.
works the same as std::ofstream::open, but with the additional functionality
| filename | file to write |
| mode | mode to open the file in |
|
static |
Prepare the writing of a file, see prepareWrite(const char*, const Config&)
| filename | file to write |
| write_directories | create the directory of the file if missing? (see getDefault()) |
|
static |
Prepare the writing of a file, as done by the constructors: check that its directory is within the output sandbox (if enabled), create its directory if missing (if allowed by WRITE_DIRECTORIES) and add a timestamp to its name if old files are kept (KEEP_OLD_FILES, see IOManager)
This is also used by the other output streams (such as OGZstream), so that they behave the same.
| filename | file to write |
| cfgreader | instance of Config, to read WRITE_DIRECTORIES in the [Output] section |
|
friend |