1 #ifndef SOTA_CLIENT_TOOLS_OSTREE_HTTP_REPO_H_ 2 #define SOTA_CLIENT_TOOLS_OSTREE_HTTP_REPO_H_ 4 #include <boost/filesystem.hpp> 6 #include "logging/logging.h" 7 #include "ostree_ref.h" 8 #include "ostree_repo.h" 9 #include "treehub_server.h" 10 #include "utilities/utils.h" 15 : server_(server), root_(root_in) {
17 root_ = root_tmp_.Path();
19 curlEasySetoptWrapper(easy_handle_.get(), CURLOPT_VERBOSE, get_curlopt_verbose());
20 curlEasySetoptWrapper(easy_handle_.get(), CURLOPT_WRITEFUNCTION, &OSTreeHttpRepo::curl_handle_write);
21 curlEasySetoptWrapper(easy_handle_.get(), CURLOPT_FAILONERROR,
true);
25 bool LooksValid()
const override;
26 OSTreeRef GetRef(
const std::string& refname)
const override;
27 boost::filesystem::path root()
const override {
return root_; }
30 bool FetchObject(
const boost::filesystem::path& path)
const override;
31 static size_t curl_handle_write(
void* buffer,
size_t size,
size_t nmemb,
void* userp);
34 boost::filesystem::path root_;
40 #endif // SOTA_CLIENT_TOOLS_OSTREE_HTTP_REPO_H_
A source repository to read OSTree objects from.