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; }
42 m_paths(std::move(
paths)) {}
48 static thread_local LastError m_lastError;
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
Stores a string (usually an error string) to be retrieved later.
Definition: LastError.h:87
const auto & header() const noexcept
Get header of this Patch.
Definition: Patch.h:34
Parses a patch into header and files patched.
Definition: Patch.h:19
const auto & paths() const noexcept
Get paths this Patch touches.
Definition: Patch.h:36
std::vector< std::string > Header
Type for a patch header.
Definition: Patch.h:22
Definition: Branches.h:15
static std::optional< Patch > create(const std::filesystem::path &path)
Create a new Patch from file at path.
std::string lastError() const noexcept
Obtain the stored string.
Definition: LastError.h:112