MeteoIODoc 2.11.0
FileUtils.cc File Reference
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <fstream>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include <cerrno>
#include <cstring>
#include <meteoio/FileUtils.h>
#include <meteoio/IOUtils.h>
#include <meteoio/FStream.h>
#include <regex>

Namespaces

namespace  mio
 
namespace  mio::FileUtils
 

Functions

static void make_directory (const std::string &path)
 
void mio::FileUtils::readDirectoryPrivate (const std::string &path, const std::string &sub_path, std::list< std::string > &dirlist, const std::string &pattern="", const bool &isRecursive=false)
 
void mio::FileUtils::copy_file (const std::string &src, const std::string &dest)
 Copies a files from one location to another. More...
 
std::string mio::FileUtils::cleanPath (std::string in_path, const bool &resolve=false, const bool &silent=false)
 Replace "\" by "/" in a string so that a path string is cross plateform, optionally resolve links, convert relative paths to absolute paths, etc. More...
 
std::string mio::FileUtils::getExtension (const std::string &filename)
 returns the extension part of a given filename. More...
 
std::string mio::FileUtils::removeExtension (const std::string &filename)
 remove the extension part of a given filename. More...
 
std::string mio::FileUtils::getPath (const std::string &filename, const bool &resolve=false)
 returns the path preceeding a given filename. More...
 
std::string mio::FileUtils::getFilename (const std::string &path)
 extract the file name from a path+filename string. More...
 
std::string mio::FileUtils::getDateTime ()
 returns the current date and time as a string. More...
 
bool mio::FileUtils::validFileAndPath (const std::string &filename)
 
bool mio::FileUtils::isAbsolutePath (const std::string &in_path)
 checks if a path is an absolute path More...
 
void mio::FileUtils::readDirectory (const std::string &path, std::list< std::string > &dirlist, const std::string &pattern="", const bool &isRecursive=false)
 Build a list of file in a given directory. More...
 
std::list< std::string > mio::FileUtils::readDirectory (const std::string &path, const std::string &pattern, const bool &isRecursive)
 
bool mio::FileUtils::directoryExists (const std::string &path)
 
bool mio::FileUtils::isWindowsPath (const std::string &path)
 
void mio::FileUtils::createDirectories (const std::string &path)
 creates the directory tree for the given path, including missing intermediate directories (gives only rw permissions), only takes paths delimited with '/' More...
 
std::string mio::FileUtils::getCWD ()
 returns the current working directory. More...
 
bool mio::FileUtils::fileExists (const std::string &filename)
 
char mio::FileUtils::getEoln (std::istream &fin)
 
void mio::FileUtils::skipLines (std::istream &fin, const size_t &nbLines, const char &eoln)
 
std::map< std::string, std::string > mio::FileUtils::readKeyValueHeader (std::istream &fin, const size_t &linecount, const std::string &delimiter, const bool &keep_case)
 

Function Documentation

◆ make_directory()

static void make_directory ( const std::string &  path)
static