[ox/fs] Make some PassThroughFS functions noexcept
This commit is contained in:
parent
82dc1895d5
commit
ca9bf786b1
14
deps/ox/src/ox/fs/filesystem/passthroughfs.cpp
vendored
14
deps/ox/src/ox/fs/filesystem/passthroughfs.cpp
vendored
@ -20,10 +20,10 @@ PassThroughFS::PassThroughFS(const char *dirPath) {
|
|||||||
m_path = dirPath;
|
m_path = dirPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
PassThroughFS::~PassThroughFS() {
|
PassThroughFS::~PassThroughFS() noexcept {
|
||||||
}
|
}
|
||||||
|
|
||||||
String PassThroughFS::basePath() {
|
String PassThroughFS::basePath() const noexcept {
|
||||||
return m_path.string().c_str();
|
return m_path.string().c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,8 +43,14 @@ Error PassThroughFS::mkdir(const char *path, bool recursive) noexcept {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
success = std::filesystem::create_directory(p, ec);
|
const auto isDir = std::filesystem::is_directory(p, ec);
|
||||||
oxReturnError(OxError(ec.value(), "PassThroughFS: mkdir failed"));
|
if (isDir) {
|
||||||
|
success = true;
|
||||||
|
} else {
|
||||||
|
std::error_code ec;
|
||||||
|
success = std::filesystem::create_directory(p, ec);
|
||||||
|
oxReturnError(OxError(ec.value(), "PassThroughFS: mkdir failed"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return OxError(success ? 0 : 1);
|
return OxError(success ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
@ -32,10 +32,10 @@ class PassThroughFS: public FileSystem {
|
|||||||
public:
|
public:
|
||||||
explicit PassThroughFS(const char *dirPath);
|
explicit PassThroughFS(const char *dirPath);
|
||||||
|
|
||||||
~PassThroughFS() override;
|
~PassThroughFS() noexcept override;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
String basePath();
|
String basePath() const noexcept;
|
||||||
|
|
||||||
Error mkdir(const char *path, bool recursive = false) noexcept override;
|
Error mkdir(const char *path, bool recursive = false) noexcept override;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user