Files
Sourcetrail/src/lib/utility/file/FileSystem.h
T
Eberhard Graether 52fb2ae6f6 logic: Follow symbolic links to directoris within source paths
* Follow symbolic links to files and references by default now
* Fixed crash on self-referencing symbolic links

bug id = 205
2016-09-28 15:26:43 +02:00

44 lines
1.4 KiB
C++

#ifndef FILE_SYSTEM_H
#define FILE_SYSTEM_H
#include <string>
#include <vector>
#include "utility/file/FileInfo.h"
#include "utility/TimePoint.h"
class FileSystem
{
public:
static std::vector<std::string> getFileNamesFromDirectory(
const std::string& path, const std::vector<std::string>& extensions);
static FileInfo getFileInfoForPath(FilePath filePath);
static std::vector<FileInfo> getFileInfosFromPaths(
const std::vector<FilePath>& paths, const std::vector<std::string>& fileExtensions, bool followSymLinks = true);
static TimePoint getLastWriteTime(const FilePath& filePath);
static std::string getTimeStringNow();
static bool exists(const FilePath& path);
static bool remove(const FilePath& path);
static bool rename(const FilePath& from, const FilePath& to);
static bool copyFile(const FilePath& from, const FilePath& to);
static bool copy_directory(const FilePath& from, const FilePath& to);
static void createDirectory(const FilePath& path);
static std::vector<FilePath> getSubDirectories(const FilePath& path);
static std::string fileName(const std::string& path);
static std::string absoluteFilePath(const std::string& path);
static std::string extension(const std::string& path);
static std::string filePathWithoutExtension(const std::string& path);
static bool equivalent(const std::string& pathA, const std::string& pathB);
};
#endif // FILE_SYSTEM_H