23#include "ghc/filesystem.hpp"
25using namespace ghc::filesystem;
61 void write(
const std::string& content);
62 void write(std::vector<char> newBytes);
63 void write(
const char* bytes,
size_t length);
86 static bool isFile(
const std::string& fullPath);
88 static bool isLink(
const std::string& fullPath);
99 static void copy(
const std::string& fromFullPath,
const std::string& toFullPath,
int copyOption =
CopyOptions::NONE);
101 static void copySymlink(
const std::string& existingSymlinkFullPath,
const std::string& newSymlinkFullPath);
104 static void createSymlink(
const std::string& toFullPath,
const std::string& symlinkFullPath);
105 static bool isEmpty(
const std::string& fullPath);
106 static bool isEquivalent(
const std::string& fullPath1,
const std::string& fullPath2);
108 static bool remove(
const std::string& fullPath);
110 static void rename(
const std::string& fromFullPath,
const std::string& toFullPath);
118 std::vector<char> bytes;
123 bool openStream(
int fileMode,
bool isBinary);
126 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:35
@ FILEMODE_APPEND
Definition gFile.h:39
@ FILEMODE_READWRITE
Definition gFile.h:38
@ FILEMODE_WRITEONLY
Definition gFile.h:37
@ FILEMODE_READONLY
Definition gFile.h:36
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:67
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)
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:42
@ OVERWRITE_EXISTING
Definition gFile.h:45
@ RECURSIVE
Definition gFile.h:46
@ NONE
Definition gFile.h:43
@ SKIP_EXISTING
Definition gFile.h:44
std::string getDirectory()
static bool isEquivalent(const std::string &fullPath1, const std::string &fullPath2)
ghc::filesystem::ofstream ofstream
Definition gFile.h:27
ghc::filesystem::fstream fstream
Definition gFile.h:28
ghc::filesystem::ifstream ifstream
Definition gFile.h:26