mirror of
https://github.com/sebastiandine/Card-Collection-Manager-3.git
synced 2026-08-28 17:01:02 +00:00
55ace147bc
* initial development * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * ci/cd * ci/cd * ci/cd * ci/cd * ci/cd * ci/cd * ci/cd * pokemon * pokemon * pokemon * pokemon * pokemon * pokemon * improvements * improvements * ci/cd * ci/cd * improvements * improvements * improvements * improvements * improvements * improvements * improvements * improvements * improvements --------- Co-authored-by: sdine <sdine@sdine.com>
26 lines
966 B
C++
26 lines
966 B
C++
#pragma once
|
|
|
|
// std::filesystem-backed implementation of IFileSystem.
|
|
|
|
#include "ccm/ports/IFileSystem.hpp"
|
|
|
|
namespace ccm {
|
|
|
|
class StdFileSystem final : public IFileSystem {
|
|
public:
|
|
[[nodiscard]] bool exists(const std::filesystem::path& p) const override;
|
|
[[nodiscard]] bool isDirectory(const std::filesystem::path& p) const override;
|
|
|
|
Result<void> ensureDirectory(const std::filesystem::path& p) override;
|
|
Result<std::string> readText(const std::filesystem::path& p) override;
|
|
Result<void> writeText(const std::filesystem::path& p, std::string_view contents) override;
|
|
Result<void> copyFile(const std::filesystem::path& from,
|
|
const std::filesystem::path& to,
|
|
bool overwrite) override;
|
|
Result<void> remove(const std::filesystem::path& p) override;
|
|
Result<std::vector<std::filesystem::path>> listDirectory(
|
|
const std::filesystem::path& p) override;
|
|
};
|
|
|
|
} // namespace ccm
|