FileIOHelpers.h File Reference
#include "Logger.h"
#include "Math/ExtendedMath.h"
#include <fstream>
#include <string>
#include <vector>

Go to the source code of this file.

Namespaces

 helpers
 

Functions

bool helpers::writeToFile (std::string filename, std::string filecontent)
 Writes a string to a file. More...
 
void helpers::writeCommandLineToFile (const std::string filename, const int argc, char *const argv[])
 Writes a string to a file. More...
 
bool helpers::addToFile (std::string filename, std::string filecontent)
 Adds a string to an existing file. More...
 
bool helpers::fileExists (std::string strFilename)
 Function to check if a file exists, is used to check if a run has already need done. More...
 
bool helpers::openFile (std::fstream &file, std::string filename, std::fstream::openmode mode)
 Provides a simple interface for opening a file. More...
 
std::vector< doublehelpers::readArrayFromFile (std::string filename, int &n, int &m)
 
void helpers::more (std::string filename, unsigned nLines=constants::unsignedMax)
 
bool helpers::createDirectory (std::string)
 
std::string helpers::getPath ()
 
template<typename T >
bool helpers::readOptionalVariable (std::istream &is, const std::string &name, T &variable)
 Reads optional variables in the restart file. More...
 
template<typename T >
helpers::readFromFile (const std::string fileName, const std::string varName, const T defaultValue)