Files
Card-Collection-Manager-3/core/include/ccm/infra/LocalImageStore.hpp
T
Sebastian Dine 55ace147bc major: initial release
* 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>
2026-05-09 11:05:47 +02:00

38 lines
1.1 KiB
C++

#pragma once
// LocalImageStore: stores card images under
// `<dataStorage>/<game>/images/<filename>`.
// Implements IImageStore, used by ImageService.
#include "ccm/games/IGameModule.hpp"
#include "ccm/ports/IFileSystem.hpp"
#include "ccm/ports/IImageStore.hpp"
#include "ccm/services/ConfigService.hpp"
#include <functional>
#include <string>
namespace ccm {
class LocalImageStore final : public IImageStore {
public:
using DirNameFn = std::function<std::string(Game)>;
LocalImageStore(IFileSystem& fs, ConfigService& config, DirNameFn dirName);
Result<std::string> copyIn(Game game,
const std::filesystem::path& srcPath,
const std::string& targetName) override;
Result<void> remove(Game game, const std::string& imageName) override;
std::filesystem::path resolvePath(Game game, const std::string& imageName) const override;
private:
IFileSystem& fs_;
ConfigService& config_;
DirNameFn dirName_;
[[nodiscard]] std::filesystem::path gameImageDir(Game game) const;
};
} // namespace ccm