OGS
FileTools.h File Reference

Detailed Description

Filename manipulation routines.

Author
Lars Bilke
Date
Apr. 2010

Definition in file FileTools.h.

#include <fstream>
#include <string>
#include <vector>
#include "Logging.h"
Include dependency graph for FileTools.h:

Go to the source code of this file.

Namespaces

 BaseLib
 

Functions

bool BaseLib::isProjectDirectorySet ()
 Returns true if the project directory is set. More...
 
bool BaseLib::IsFileExisting (const std::string &strFilename)
 Returns true if given file exists. More...
 
std::tuple< std::string, std::string::size_type, std::string::size_type > BaseLib::getParenthesizedString (std::string const &in, char const open_char, char const close_char, std::string::size_type pos)
 
std::string BaseLib::constructFormattedFileName (std::string const &format_specification, std::string const &mesh_name, int const timestep, double const t, int const iteration)
 
template<typename T >
void BaseLib::writeValueBinary (std::ostream &out, T const &val)
 write value as binary into the given output stream More...
 
template<typename T >
BaseLib::swapEndianness (T const &v)
 
double BaseLib::swapEndianness (double const &v)
 
template<typename T >
BaseLib::readBinaryValue (std::istream &in)
 
template<typename T >
std::vector< T > BaseLib::readBinaryArray (std::string const &filename, std::size_t const n)
 
std::string BaseLib::extractBaseName (std::string const &pathname)
 
std::string BaseLib::extractBaseNameWithoutExtension (std::string const &pathname)
 
std::string BaseLib::getFileExtension (const std::string &path)
 
bool BaseLib::hasFileExtension (std::string const &extension, std::string const &filename)
 
std::string BaseLib::copyPathToFileName (const std::string &file_name, const std::string &source)
 
std::string BaseLib::dropFileExtension (std::string const &filename)
 
std::string BaseLib::extractPath (std::string const &pathname)
 
std::string BaseLib::joinPaths (std::string const &pathA, std::string const &pathB)
 
std::string const & BaseLib::getProjectDirectory ()
 Returns the directory where the prj file resides. More...
 
void BaseLib::setProjectDirectory (std::string const &dir)
 Sets the project directory. More...
 
void BaseLib::removeFile (std::string const &filename)
 
void BaseLib::removeFiles (std::vector< std::string > const &files)