1 #ifndef SOTA_CLIENT_TOOLS_OSTREE_REPO_H_
2 #define SOTA_CLIENT_TOOLS_OSTREE_REPO_H_
7 #include <boost/filesystem.hpp>
10 #include "ostree_hash.h"
11 #include "ostree_object.h"
21 using ptr = std::shared_ptr<OSTreeRepo>;
25 virtual bool LooksValid()
const = 0;
26 virtual const boost::filesystem::path root()
const = 0;
27 virtual OSTreeRef GetRef(
const std::string& refname)
const = 0;
30 OSTreeObject::ptr GetObject(
const uint8_t sha256[32],
OstreeObjectType type)
const;
33 virtual bool FetchObject(
const boost::filesystem::path& path)
const = 0;
35 bool CheckForObject(
const OSTreeHash& hash,
const std::string& path, OSTreeObject::ptr&
object)
const;
37 typedef std::map<OSTreeHash, OSTreeObject::ptr> otable;
38 mutable otable ObjectTable;
49 const char* what()
const noexcept
override {
return "OSTree repository is missing an object"; }
51 OSTreeHash missing_object()
const {
return missing_object_; }
57 #endif // SOTA_CLIENT_TOOLS_OSTREE_REPO_H_