82 void FileCopy(
const std::string& src,
const std::string& dest,
bool overwrite =
true);
83 void FileCopy(
const std::wstring& src,
const std::wstring& dest,
bool overwrite =
true);
175 std::wstring
DirectoryCombine(
const std::wstring& dir,
const std::wstring& file);
191 std::list<std::wstring>
GetFiles(
const std::wstring& path,
const std::wstring& wildcard = L
"*.*",
int flags =
GET_FILES_FILES);
199 std::list<std::wstring>
GetFiles(
const std::wstring& path_and_wildcard,
int flags);
207 std::list<std::wstring>
GetDirectoryFiles(
const std::wstring& path,
const std::wstring& wildcard = L
"*.*");
214 void ReadToEnd(
const std::wstring& filename, std::wstring& data);
221 void ReadToEnd(
const std::wstring& filename, std::string& data);
228 void ReadToEnd(
const std::wstring& filename, std::vector<char>& data);
231 static unsigned char utf8_bom[] = { 0xef, 0xbb, 0xbf };
250 const std::wstring& filename,
251 const std::vector<char>& data,
252 DWORD dwShareMode = GENERIC_READ | GENERIC_WRITE,
253 DWORD dwCreationDisposition = CREATE_ALWAYS,
254 DWORD dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL);
263 const std::wstring& filename,
264 DWORD dwShareMode = GENERIC_READ | GENERIC_WRITE,
265 DWORD dwCreationDisposition = CREATE_ALWAYS,
266 DWORD dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL);
std::wstring GetModuleFileNameW(HINSTANCE h=NULL)
Definition: File.cpp:77
std::string GetTemporaryDirectoryA()
Get the location of the temporary directory.
Definition: File.cpp:331
long GetFileSize(const std::wstring &filename)
Get file size.
Definition: File.cpp:316
std::string DirectoryCreate(const std::string &path)
Create a directory.
Definition: File.cpp:457
DELETE_DIRECTORY_FLAGS
Definition: File.h:107
bool ReadAndConvertToEnd(const std::wstring &filename, std::wstring &data)
Read the entire contents of file and convert to UNICODE depending on the file marker.
Definition: File.cpp:390
byte(s)
Definition: File.h:142
GET_FILES_FLAGS
Definition: File.h:177
std::wstring GetFileNameW(const std::wstring &path)
Definition: File.cpp:49
bool DirectoryDelete(const std::string &path, int flags=DELETE_DIRECTORY_ALL)
Delete a directory.
Definition: File.cpp:489
std::string GetParentDirectory(const std::string &path)
Get the parent directory of a path.
Definition: File.cpp:635
automatically adjust
Definition: File.h:141
void FileDelete(const std::string &filename)
Delete a file.
Definition: File.cpp:149
const long GBYTE
Definition: File.h:150
const long MBYTE
Definition: File.h:149
std::pair< std::wstring, std::wstring > SizeToStringPairW(long size, FILESIZE_STRING_TYPE type=FILESIZE_AUTO, int precision=0)
Definition: File.cpp:572
delete empty (sub)directories only
Definition: File.h:113
delete subdirectories
Definition: File.h:112
void ReadToEnd(const std::wstring &filename, std::wstring &data)
Read the entire contents of file.
Definition: File.cpp:351
std::string SizeToStringA(long size, FILESIZE_STRING_TYPE type=FILESIZE_AUTO, int precision=0)
Convert a file size into a string.
Definition: File.cpp:608
std::wstring GetTemporaryDirectoryW()
Definition: File.cpp:341
std::string GetFileDirectoryA(const std::string &path)
Get the directory portion of a full path.
Definition: File.cpp:22
delete folders
Definition: File.h:111
std::string GetCurrentDirectoryA()
Get the current directory.
Definition: File.cpp:619
FILESIZE_STRING_TYPE
Definition: File.h:138
std::wstring DirectoryCombine(const std::wstring &dir, const std::wstring &file)
Combine two directory paths and an optional file.
Definition: File.cpp:173
std::string GetModuleFileNameA(HINSTANCE h=NULL)
Get the full path to the module's filename.
Definition: File.cpp:68
std::wstring GetCurrentDirectoryW()
Definition: File.cpp:627
bool IsAbsolutePath(const std::wstring &path)
returns true if provided path is absolute, false otherwise
Definition: File.cpp:657
recurse into subdirectories
Definition: File.h:182
std::wstring GetSpecialFolderPath(int csidl, BOOL create=FALSE)
Takes the CSIDL of a folder and returns the path.
Definition: File.cpp:647
return files
Definition: File.h:180
std::wstring GetTemporaryFileNameW()
Definition: File.cpp:13
std::pair< std::string, std::string > SizeToStringPairA(long size, FILESIZE_STRING_TYPE type=FILESIZE_AUTO, int precision=0)
Convert a file size into a pair of strings.
Definition: File.cpp:564
std::wstring GetFileDirectoryW(const std::wstring &path)
Definition: File.cpp:31
std::list< std::wstring > GetDirectoryFiles(const std::wstring &path, const std::wstring &wildcard=L"*.*")
Get a list of file names in path.
Definition: File.cpp:212
std::wstring GetModuleDirectoryW()
Definition: File.cpp:63
void FileCreate(const std::wstring &filename, DWORD dwShareMode=GENERIC_READ|GENERIC_WRITE, DWORD dwCreationDisposition=CREATE_ALWAYS, DWORD dwFlagsAndAttributes=FILE_ATTRIBUTE_NORMAL)
Create an empty file.
Definition: File.cpp:441
std::list< std::wstring > GetFiles(const std::wstring &path, const std::wstring &wildcard=L"*.*", int flags=GET_FILES_FILES)
Get a list of files in a directory structure.
Definition: File.cpp:253
Mb.
Definition: File.h:144
return directory names
Definition: File.h:181
bool DirectoryExists(const std::string &path)
Check whether a directory exists.
Definition: File.cpp:117
const long KBYTE
Definition: File.h:148
std::string GetFileNameA(const std::string &path)
Get the filename portion of a full path.
Definition: File.cpp:40
std::string GetModuleDirectoryA()
Get the full path (directory) of the module's filename.
Definition: File.cpp:58
void FileWrite(const std::wstring &filename, const std::vector< char > &data, DWORD dwShareMode=GENERIC_READ|GENERIC_WRITE, DWORD dwCreationDisposition=CREATE_ALWAYS, DWORD dwFlagsAndAttributes=FILE_ATTRIBUTE_NORMAL)
Write data to a file.
Definition: File.cpp:415
Kb.
Definition: File.h:143
std::wstring SizeToStringW(long size, FILESIZE_STRING_TYPE type=FILESIZE_AUTO, int precision=0)
Definition: File.cpp:613
delete files
Definition: File.h:110
bool FileExists(const std::string &filename)
Check whether a file exists.
Definition: File.cpp:86
std::string GetTemporaryFileNameA()
Create a temporary file and return its name.
Definition: File.cpp:4
const long BYTE
Definition: File.h:147
void FileCopy(const std::string &src, const std::string &dest, bool overwrite=true)
Copy a file.
Definition: File.cpp:161