FileTools.cpp File Reference

Detailed Description

Filename manipulation routines implementation.

Lars Bilke
Apr. 2010

Definition in file FileTools.cpp.

#include "FileTools.h"
#include <boost/algorithm/string.hpp>
#include <typeindex>
#include <unordered_map>
#include "Error.h"
#include "filesystem.h"
Include dependency graph for FileTools.cpp:

Go to the source code of this file.




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::containsKeyword (std::string const &str, std::string const &keyword)
template<typename T >
bool BaseLib::substituteKeyword (std::string &result, std::string &parenthesized_string, std::string::size_type begin, std::string::size_type end, std::string const &keyword, T &data)
std::string BaseLib::constructFormattedFileName (std::string const &format_specification, std::string const &mesh_name, int const timestep, double const t, int const iteration)
double BaseLib::swapEndianness (double const &v)
std::string BaseLib::dropFileExtension (std::string const &filename)
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::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)


std::string anonymous_namespace{FileTools.cpp}::project_directory
 The directory where the prj file resides. More...
bool anonymous_namespace{FileTools.cpp}::project_directory_is_set = false
 Whether the project directory has already been set. More...