[ox] Get building in MSVC

This commit is contained in:
2019-12-23 15:11:53 -06:00
parent a66f1499a4
commit 4cbf1b9a9a
7 changed files with 10 additions and 11 deletions

View File

@@ -28,7 +28,8 @@ std::string PassThroughFS::basePath() {
Error PassThroughFS::mkdir(const char *path, bool recursive) {
bool success = false;
const auto p = m_path / stripSlash(path);
oxTrace("ox::fs::PassThroughFS::mkdir") << p.c_str();
const auto u8p = p.u8string();
oxTrace("ox::fs::PassThroughFS::mkdir") << u8p.c_str();
if (recursive) {
success = std::filesystem::create_directories(p);
} else {

View File

@@ -89,9 +89,7 @@ class PassThroughFS: public FileSystem {
template<typename F>
ox::Error PassThroughFS::ls(const char *dir, F cb) {
for (auto &p : std::filesystem::directory_iterator(m_path / stripSlash(dir))) {
if (auto err = cb(p.path().filename().c_str(), 0); err) {
return err;
}
oxReturnError(cb(p.path().filename().u8string(), 0));
}
return OxError(0);
}