summaryrefslogtreecommitdiffhomepage
path: root/diff.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-27 19:42:08 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-27 19:42:08 +0100
commitf44d36b05e43cabde31aeaba5d25fded140345a1 (patch)
tree1024a76cb1ae671c9445dcc379cb9eddd26922aa /diff.h
parent789e5555ab4c44a1ae779eccf6ccf8340602cf22 (diff)
Added diff.cpp
Diffstat (limited to 'diff.h')
-rw-r--r--diff.h24
1 files changed, 24 insertions, 0 deletions
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 <string>
+
+#include <boost/property_tree/ptree.hpp>
+
+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;
+};