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 boost::filesystem::path root()
const = 0;
27 virtual OSTreeRef GetRef(
const std::string& refname)
const = 0;
31 OSTreeObject::ptr GetObject(
const uint8_t sha256[32],
OstreeObjectType type)
const;
34 virtual bool FetchObject(
const boost::filesystem::path& path)
const = 0;
36 bool CheckForObject(
const OSTreeHash& hash,
const std::string& path, OSTreeObject::ptr&
object)
const;
38 typedef std::map<OSTreeHash, OSTreeObject::ptr> otable;
39 mutable otable ObjectTable;
50 const char* what()
const noexcept
override {
return "OSTree repository is missing an object"; }
52 OSTreeHash missing_object()
const {
return missing_object_; }
58 #endif // SOTA_CLIENT_TOOLS_OSTREE_REPO_H_