From f44d36b05e43cabde31aeaba5d25fded140345a1 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 27 Jan 2023 19:42:08 +0100 Subject: Added diff.cpp --- diff.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 diff.h (limited to 'diff.h') diff --git a/diff.h b/diff.h new file mode 100644 index 0000000..0193238 --- /dev/null +++ b/diff.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include + +class Diff +{ +public: + Diff(); + Diff(const std::string& old_version, const std::string& new_version); + + std::string apply(const std::string& old_version) const; + void create(const std::string& old_version, const std::string& new_version); + + boost::property_tree::ptree get_structure() const; + std::string get_xml() const; + +private: + // diff replaces space from m_pos0 (inclusive) to m_pos1 (exclusive) with m_data + size_t m_pos0{}; + size_t m_pos1{}; + std::string m_data; +}; -- cgit v1.2.3