Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
file.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_CORE_FILE_HPP_
2#define IV_SRC_CORE_FILE_HPP_
3
4#include "core/defines.hpp"
5
6#include <filesystem>
7#include <vector>
8
9namespace fs = std::filesystem;
10
11namespace iv::file
12{
13
14bool canWrite(const std::filesystem::path &path);
15
23std::string changeExtension(std::string_view filePath, const std::string &targetExtension);
24
25void copy(std::string_view from, std::string_view to, bool overwrite = false);
26
27void copyFolder(std::string_view from, std::string_view to, bool recursive, bool overwrite);
28
29bool createDirectory(std::string_view path);
30
31bool exists(std::string_view path);
32
33bool isFile(std::string_view path);
34
35bool isDirectory(std::string_view path);
36
37std::string getExtensionFile(std::string_view filePath, bool includeDot = false);
38
45std::string getFileName(std::string_view filePath, bool includeExtension = false);
46
52std::string getFinalDirectoryName(std::string_view path);
53
54std::vector<std::string> getFolderFiles(const std::string &foldersPath, bool recursively, bool absolutePath);
55
56iv::types::timestamp getLastModifiedTime(std::string_view path);
57
63std::string getParentDirectoryPath(std::string_view path);
64
72std::string makePath(std::string_view dirOpt = "", std::string_view fNameOpt = "", std::string_view extOpt = "");
73
74std::string escapePathForShell(std::string_view path);
75
76bool remove(std::string_view path);
77
78void rename(std::string_view oldPath, std::string_view newPath);
79
80}// namespace iv::file
81
82#endif//IV_SRC_CORE_FILE_HPP_
Definition file.cpp:13
void copyFolder(const std::string_view from, const std::string_view to, const bool recursive, const bool overwrite)
Definition file.cpp:68
void copy(const std::string_view from, const std::string_view to, const bool overwrite)
Definition file.cpp:56
void rename(const std::string_view oldPath, const std::string_view newPath)
Definition file.cpp:310
std::string getParentDirectoryPath(const std::string_view path)
Definition file.cpp:214
bool remove(const std::string_view path)
Definition file.cpp:294
iv::types::timestamp getLastModifiedTime(const std::string_view path)
Definition file.cpp:198
bool isDirectory(const std::string_view path)
Definition file.cpp:107
bool createDirectory(const std::string_view path)
Definition file.cpp:85
bool canWrite(const std::filesystem::path &path)
Definition file.cpp:15
std::string escapePathForShell(const std::string_view path)
Definition file.cpp:273
bool isFile(const std::string_view path)
Definition file.cpp:102
std::string getFileName(const std::string_view filePath, const bool includeExtension)
Definition file.cpp:130
std::vector< std::string > getFolderFiles(const std::string &foldersPath, const bool recursively, const bool absolutePath)
Definition file.cpp:163
std::string changeExtension(const std::string_view filePath, const std::string &targetExtension)
Definition file.cpp:35
bool exists(const std::string_view path)
Definition file.cpp:97
std::string getExtensionFile(const std::string_view filePath, const bool includeDot)
Definition file.cpp:112
std::string makePath(const std::string_view dirOpt, const std::string_view fNameOpt, const std::string_view extOpt)
Definition file.cpp:228
std::string getFinalDirectoryName(const std::string_view path)
Definition file.cpp:155
uint64_t timestamp
Definition types.hpp:21