OGS
FileTools.h File Reference

Detailed Description

Filename manipulation routines.

Author
Lars Bilke
Date
Apr. 2010

Definition in file FileTools.h.

#include <cstddef>
#include <iosfwd>
#include <limits>
#include <string>
#include <tuple>
#include <vector>
Include dependency graph for FileTools.h:

Go to the source code of this file.

Namespaces

namespace  BaseLib
 

Functions

bool BaseLib::isProjectDirectorySet ()
 Returns true if the project directory is set.
 
bool BaseLib::IsFileExisting (const std::string &strFilename)
 Returns true if given file exists.
 
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)
 
std::vector< double > BaseLib::readDoublesFromBinaryFile (const std::string &filename)
 
template<typename T >
void BaseLib::writeValueBinary (std::ostream &out, T const &val)
 write value as binary into the given output stream
 
template<typename T >
BaseLib::swapEndianness (T const &v)
 
double BaseLib::swapEndianness (double const &v)
 
template<typename T >
BaseLib::readBinaryValue (std::istream &in)
 
template float BaseLib::readBinaryValue< float > (std::istream &)
 
template double BaseLib::readBinaryValue< double > (std::istream &)
 
template<typename T >
std::vector< T > BaseLib::readBinaryVector (std::string const &filename, std::size_t const start_element, std::size_t const num_elements)
 
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::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.
 
void BaseLib::setProjectDirectory (std::string const &dir)
 Sets the project directory.
 
void BaseLib::unsetProjectDirectory ()
 Unsets the project directory.
 
void BaseLib::removeFile (std::string const &filename)
 
void BaseLib::removeFiles (std::vector< std::string > const &files)
 
bool BaseLib::createOutputDirectory (std::string const &dir)