39 lines
917 B
C++
39 lines
917 B
C++
|
#include "filesystem.hpp"
|
||
|
|
||
|
#define WIN32_LEAN_AND_MEAN
|
||
|
#include <windows.h>
|
||
|
#undef CopyFile
|
||
|
|
||
|
bool Filesystem::DirectoryExists(const std::string& path)
|
||
|
{
|
||
|
DWORD ftyp = GetFileAttributesA(path.c_str());
|
||
|
|
||
|
return ftyp != INVALID_FILE_ATTRIBUTES && ftyp & FILE_ATTRIBUTE_DIRECTORY;
|
||
|
}
|
||
|
|
||
|
bool Filesystem::FileExists(const std::string& path)
|
||
|
{
|
||
|
DWORD ftyp = GetFileAttributesA(path.c_str());
|
||
|
|
||
|
return ftyp != INVALID_FILE_ATTRIBUTES && !(ftyp & FILE_ATTRIBUTE_DIRECTORY);
|
||
|
}
|
||
|
|
||
|
std::vector<std::string> Filesystem::DirectoryContents(const std::string& directory)
|
||
|
{
|
||
|
std::vector<std::string> tmp;
|
||
|
|
||
|
//TODO: implement windows directory contents listing
|
||
|
|
||
|
return tmp;
|
||
|
}
|
||
|
|
||
|
void Filesystem::CopyFile(const std::string& src, const std::string& dst, bool overwrite)
|
||
|
{
|
||
|
//TODO: implement windows copyfile
|
||
|
}
|
||
|
|
||
|
std::string Filesystem::Canonical(const std::string& path)
|
||
|
{
|
||
|
//TODO: implement windows canonicallize path
|
||
|
return path;
|
||
|
}
|