FileTools.h File Reference

Detailed Description

Filename manipulation routines.

Lars Bilke
Apr. 2010

Definition in file FileTools.h.

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

Go to the source code of this file.


namespace  BaseLib


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)
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::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.
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)