12#include <OpenMS/config.h>
35 static bool exists(
const std::string& file);
38 static bool empty(
const std::string& file);
71 static bool rename(
const std::string& from,
const std::string& to,
bool overwrite_existing =
true,
bool verbose =
true);
93 static bool copy(
const std::string& from,
const std::string& to);
100 static bool remove(
const std::string& file);
110 static bool makeDir(
const std::string& dir_name);
130 static std::string
basename(
const std::string& file);
137 static std::string
stemName(
const std::string& file);
153 static std::string
path(
const std::string& file);
182 static bool fileList(
const std::string& dir,
const std::string& file_pattern,
StringList& output,
bool full_path =
false);
200 static std::string
findDoc(
const std::string& filename);
289 bool basename =
true,
290 bool ignore_extension =
true);
307#ifdef OPENMS_WINDOWSPLATFORM
326 static StringList executableExtensions_(
const std::string& ext);
Basic file handling operations.
Definition File.h:26
static std::string findDoc(const std::string &filename)
Resolves a partial file name to a documentation file in the doc-folder.
static std::string findSiblingTOPPExecutable(const std::string &toolName)
Searches for an executable with the given name.
static std::string find(const std::string &filename, StringList directories=StringList())
Looks up the location of the file filename.
std::string source
human-readable origin, e.g. "the OPENMS_DATA_PATH environment variable"
Definition File.h:301
static bool executable(const std::string &file)
Method used to test if a file is executable.
static bool removeDir(const std::string &dir_name)
Removes a directory and all its contents (absolute path). Returns true if successful.
static bool writable(const std::string &file)
Return true if the file is writable.
CopyOptions
Copy directory recursively.
Definition File.h:89
static StringList listDirectories(const std::string &dir)
static bool remove(const std::string &file)
Removes a file (if it exists).
std::string path
the resolved shared-data directory
Definition File.h:300
static std::string toFileURI(const std::string &file)
Convert a local path to an absolute file URI.
static std::string basename(const std::string &file)
static bool fileList(const std::string &dir, const std::string &file_pattern, StringList &output, bool full_path=false)
Retrieves a list of files matching file_pattern in directory dir (returns filenames without paths unl...
static StringList getPathLocations()
Extract list of directories from a concatenated string (usually $PATH).
static MatchingFileListsStatus validateMatchingFileNames(const StringList &sl1, const StringList &sl2, bool basename=true, bool ignore_extension=true)
Helper function to test if filenames provided in two StringLists match.
static bool empty(const std::string &file)
Return true if the file does not exist or the file is empty.
static bool readable(const std::string &file)
Return true if the file exists and is readable.
static std::string extension(const std::string &file)
static UInt64 fileSize(const std::string &file)
The filesize in bytes (or -1 on error, e.g. if the file does not exist)
static bool makeDir(const std::string &dir_name)
static std::string absolutePath(const std::string &file)
Replaces the relative path in the argument with the absolute path.
static std::string getUniqueName(bool include_hostname=true)
Returns a string, consisting of date, time, hostname, process id, and a incrementing number....
static std::string path(const std::string &file)
static const std::string & getOpenMSDataPathSource()
Returns a human-readable description of where getOpenMSDataPath() resolved from.
static bool findExecutable(std::string &exe_filename)
Searches for an executable with the given name (similar to where (Windows) or which (Linux/MacOS)
static bool isOpenMSDataPath_(const std::string &path)
Check if the given path is a valid OPENMS_DATA_PATH.
MatchingFileListsStatus
Definition File.h:266
static bool removeDirRecursively(const std::string &dir_name)
Removes a directory and all its contents recursively (absolute path). Returns true if successful.
static std::string stemName(const std::string &file)
static std::string getExecutablePath()
static bool copyDirRecursively(const std::string &from_dir, const std::string &to_dir, File::CopyOptions option=CopyOptions::OVERWRITE)
static bool exists(const std::string &file)
Method used to test if a file exists.
static bool copy(const std::string &from, const std::string &to)
Copy a file (if it exists). Returns true if successful.
static std::string getOpenMSDataPath()
static const OpenMSDataPath_ & resolveOpenMSDataPath_()
Resolve (once, thread-safe) and return the OpenMS data path together with where it was found.
static Int64 getModificationTime(const std::string &file)
Last modification time of file, in seconds since the Unix epoch (or -1 on error).
static bool isDirectory(const std::string &path)
Return true if the given path specifies a directory.
static StringList getPathLocations(const std::string &path)
Extract list of directories from an explicit concatenated path string.
static bool rename(const std::string &from, const std::string &to, bool overwrite_existing=true, bool verbose=true)
Rename a file.
Bundles the resolved OpenMS data path with a human-readable description of where it was found (for di...
Definition File.h:299
int64_t Int64
Signed integer type (64bit)
Definition Types.h:40
uint64_t UInt64
Unsigned integer type (64bit)
Definition Types.h:47
std::vector< std::string > StringList
Vector of String.
Definition TypeAliases.h:39
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19