23#include "ghc/filesystem.hpp"
26using namespace ghc::filesystem;
62 void write(
const std::string& content);
63 void write(std::vector<char> newBytes);
64 void write(
const char* bytes,
size_t length);
87 static bool isFile(
const std::string& fullPath);
89 static bool isLink(
const std::string& fullPath);
100 static void copy(
const std::string& fromFullPath,
const std::string& toFullPath,
int copyOption =
CopyOptions::NONE);
102 static void copySymlink(
const std::string& existingSymlinkFullPath,
const std::string& newSymlinkFullPath);
105 static void createSymlink(
const std::string& toFullPath,
const std::string& symlinkFullPath);
106 static bool isEmpty(
const std::string& fullPath);
107 static bool isEquivalent(
const std::string& fullPath1,
const std::string& fullPath2);
109 static bool remove(
const std::string& fullPath);
111 static void rename(
const std::string& fromFullPath,
const std::string& toFullPath);
120 std::vector<char> bytes;
125 bool openStream(
int fileMode,
bool isBinary);
128 static fs::copy_options copyOptions[4];
void write(const std::string &content)
void write(std::vector< char > newBytes)
static void rename(const std::string &fromFullPath, const std::string &toFullPath)
static void createSymlink(const std::string &toFullPath, const std::string &symlinkFullPath)
static bool createDirectory(const std::string &fullPath)
static bool doesFileExistInAssets(const std::string &filePath)
static std::string getDirectory(const fs::path &path)
static bool doesFileExist(const std::string &fullPath)
Mode
Definition gFile.h:36
@ FILEMODE_APPEND
Definition gFile.h:40
@ FILEMODE_READWRITE
Definition gFile.h:39
@ FILEMODE_WRITEONLY
Definition gFile.h:38
@ FILEMODE_READONLY
Definition gFile.h:37
static bool isLink(const std::string &fullPath)
static bool isSymlink(const std::string &fullPath)
static bool removeAll(const std::string &fullPath)
static bool isDirectoryInAssets(const std::string &filePath)
bool loadFile(const std::string &filePath, int fileMode=FILEMODE_READONLY, bool isBinary=true)
static void copySymlink(const std::string &existingSymlinkFullPath, const std::string &newSymlinkFullPath)
gFile(const std::string &fullPath, int fileMode=FILEMODE_READONLY, bool isBinary=true)
void write(const char *bytes, size_t length)
static bool remove(const std::string &fullPath)
static bool isEmpty(const std::string &fullPath)
static std::string addComplementarySlashIfNeeded(const fs::path &filePath)
static std::vector< std::string > getDirectoryContent(const std::string &fullPath)
static bool isDirectory(const std::string &fullPath)
const std::vector< char > & getBytesConst()
Definition gFile.h:68
static bool isDevice(const fs::path &path)
static void createDirectorySymlink(const std::string &toFullPath, const std::string &symlinkFullPath)
std::string getFilename()
static bool isFile(const std::string &fullPath)
static std::string normalizePathUtf8(const std::string &p)
std::vector< char > getBytes()
static bool isLinkInAssets(const std::string &filePath)
static bool isFileInAssets(const std::string &filePath)
static std::string getFilename(const fs::path &path)
static void copy(const std::string &fromFullPath, const std::string &toFullPath, int copyOption=CopyOptions::NONE)
static bool copyFile(const std::string &fromFullPath, const std::string &toFullPath, int copyOption=CopyOptions::NONE)
bool load(const std::string &fullPath, int fileMode=FILEMODE_READONLY, bool isBinary=true)
CopyOptions
Definition gFile.h:43
@ OVERWRITE_EXISTING
Definition gFile.h:46
@ RECURSIVE
Definition gFile.h:47
@ NONE
Definition gFile.h:44
@ SKIP_EXISTING
Definition gFile.h:45
std::string getDirectory()
static bool isEquivalent(const std::string &fullPath1, const std::string &fullPath2)
ghc::filesystem::ofstream ofstream
Definition gFile.h:28
ghc::filesystem::fstream fstream
Definition gFile.h:29
ghc::filesystem::ifstream ifstream
Definition gFile.h:27