VAPOR3 3.9.4
FileUtils.h
Go to the documentation of this file.
1#pragma once
2
3#include <vapor/common.h>
4#include <string>
5#include <vector>
6#include <initializer_list>
7
8namespace Wasp {
9namespace FileUtils {
10
12
13extern COMMON_API const std::string Separator;
14
15COMMON_API std::string ReadFileToString(const std::string &path);
16COMMON_API std::string HomeDir();
17COMMON_API std::string Basename(const std::string &path);
18COMMON_API std::string Dirname(const std::string &path);
19COMMON_API std::string Realpath(const std::string &path);
20COMMON_API std::string Relpath(std::string path, std::string to);
21COMMON_API std::string CommonAncestor(const std::vector<std::string> &paths);
22COMMON_API std::string Extension(const std::string &path);
23COMMON_API std::string RemoveExtension(const std::string &path);
24COMMON_API std::string POSIXPathToWindows(std::string path);
25COMMON_API std::string POSIXPathToCurrentOS(const std::string &path);
26COMMON_API std::string CleanupPath(std::string path);
27COMMON_API long GetFileModifiedTime(const std::string &path);
28COMMON_API bool IsPathAbsolute(const std::string &path);
29COMMON_API bool Exists(const std::string &path);
30COMMON_API bool IsRegularFile(const std::string &path);
31COMMON_API bool IsDirectory(const std::string &path);
32COMMON_API bool IsSubpath(const std::string &dir, const std::string &path);
33COMMON_API bool AreSameFile(const std::string &pathA, const std::string &pathB);
34COMMON_API FileType GetFileType(const std::string &path);
35COMMON_API long long GetFileSize(const std::string &path);
36COMMON_API std::vector<std::string> ListFiles(const std::string &path);
37
39COMMON_API std::string JoinPaths(const std::vector<std::string> &paths);
40COMMON_API std::vector<std::string> SplitPath(std::string path);
41
42COMMON_API int MakeDir(const std::string &path);
43
44COMMON_API const char *LegacyBasename(const char *path);
45
46} // namespace FileUtils
47} // namespace Wasp
#define COMMON_API
Definition: common.h:72
COMMON_API std::string POSIXPathToCurrentOS(const std::string &path)
COMMON_API std::string HomeDir()
COMMON_API FileType GetFileType(const std::string &path)
COMMON_API bool Exists(const std::string &path)
COMMON_API std::string ReadFileToString(const std::string &path)
COMMON_API long GetFileModifiedTime(const std::string &path)
COMMON_API int MakeDir(const std::string &path)
COMMON_API std::vector< std::string > SplitPath(std::string path)
COMMON_API const char * LegacyBasename(const char *path)
COMMON_API std::string CommonAncestor(const std::vector< std::string > &paths)
COMMON_API long long GetFileSize(const std::string &path)
COMMON_API bool IsPathAbsolute(const std::string &path)
COMMON_API std::string Extension(const std::string &path)
COMMON_API std::string POSIXPathToWindows(std::string path)
COMMON_API std::string Dirname(const std::string &path)
COMMON_API std::string Relpath(std::string path, std::string to)
COMMON_API const std::string Separator
COMMON_API bool AreSameFile(const std::string &pathA, const std::string &pathB)
COMMON_API bool IsDirectory(const std::string &path)
COMMON_API std::string JoinPaths(const std::vector< std::string > &paths)
COMMON_API bool IsRegularFile(const std::string &path)
COMMON_API std::vector< std::string > ListFiles(const std::string &path)
COMMON_API std::string Basename(const std::string &path)
COMMON_API std::string Realpath(const std::string &path)
COMMON_API std::string CleanupPath(std::string path)
COMMON_API bool IsSubpath(const std::string &dir, const std::string &path)
COMMON_API std::string RemoveExtension(const std::string &path)
Definition: CFuncs.h:31