MeteoIODoc 2.11.0
mio::ofilestream Class Reference

Detailed Description

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.

Author
Patrick Leibersperger
Date
2023-11-21

#include <FStream.h>

Public Member Functions

 ofilestream ()
 
 ofilestream (const char *filename, std::ios_base::openmode mode=std::ios_base::out)
 Constructor. More...
 
 ofilestream (const char *filename, const Config &cfgreader, std::ios_base::openmode mode=std::ios_base::out)
 Constructor. More...
 
 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. More...
 

Static Public Member Functions

static void createDirectoriesOfFile (const char *filename)
 
static bool getDefault ()
 
static std::string getLimitBaseDir ()
 

Friends

void IOManager::setOfstreamDefault (const Config &i_cfg)
 

Constructor & Destructor Documentation

◆ ofilestream() [1/5]

mio::ofilestream::ofilestream ( )
inline

◆ ofilestream() [2/5]

mio::ofilestream::ofilestream ( const char *  filename,
std::ios_base::openmode  mode = std::ios_base::out 
)

Constructor.

Parameters
filenamefile to write
modemode to open the file in

◆ ofilestream() [3/5]

mio::ofilestream::ofilestream ( const char *  filename,
const Config cfgreader,
std::ios_base::openmode  mode = std::ios_base::out 
)

Constructor.

Parameters
filenamefile to write
cfgreaderinstance of Config, to read the inishell config keywords
modemode to open the file in

◆ ofilestream() [4/5]

mio::ofilestream::ofilestream ( const std::string  filename,
std::ios_base::openmode  mode = std::ios_base::out 
)

◆ ofilestream() [5/5]

mio::ofilestream::ofilestream ( const std::string  filename,
const Config cfgreader,
std::ios_base::openmode  mode = std::ios_base::out 
)

Member Function Documentation

◆ createDirectoriesOfFile()

void mio::ofilestream::createDirectoriesOfFile ( const char *  filename)
static

◆ getDefault()

bool mio::ofilestream::getDefault ( )
static

◆ getLimitBaseDir()

std::string mio::ofilestream::getLimitBaseDir ( )
static

◆ open()

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

Parameters
filenamefile to write
modemode to open the file in

Friends And Related Function Documentation

◆ IOManager::setOfstreamDefault

void IOManager::setOfstreamDefault ( const Config i_cfg)
friend

The documentation for this class was generated from the following files: