Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
graphite/engine/platform/windows/filesystem.cpp
2024-01-03 16:05:02 -05:00

39 lines
No EOL
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;
}