12#include "../helpers/LastError.h"
22 using Header = std::vector<std::string>;
24 using Paths = std::set<std::filesystem::path>;
29 static std::optional<Patch>
create(
const std::filesystem::path &path);
31 static std::optional<Patch>
create(std::istream &is);
34 const auto &
header() const noexcept {
return m_header; }
36 const auto &
paths() const noexcept {
return m_paths; }
39 static auto lastError() noexcept {
return m_lastError.lastError(); }
42 m_paths(std::move(
paths)) {}
48 static thread_local LastError m_lastError;
Parses a patch into header and files patched.
Definition Patch.h:19
static std::optional< Patch > create(std::istream &is)
Create a new Patch from stream is.
const auto & paths() const noexcept
Get paths this Patch touches.
Definition Patch.h:36
std::set< std::filesystem::path > Paths
Type for patched paths.
Definition Patch.h:24
static auto lastError() noexcept
Return the last error string if any.
Definition Patch.h:39
std::vector< std::string > Header
Type for a patch header.
Definition Patch.h:22
static std::optional< Patch > create(const std::filesystem::path &path)
Create a new Patch from file at path.
const auto & header() const noexcept
Get header of this Patch.
Definition Patch.h:34