Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
Changes.hpp
Go to the documentation of this file.
1
2#ifndef IV_SRC_MODEL_CHANGES_HPP_
3#define IV_SRC_MODEL_CHANGES_HPP_
4
5#include "Revisions.hpp"
6#include "core/defines.hpp"
8#include <string>
9
10namespace iv::model
11{
12
20
21struct Changes
22{
23 struct Change
24 {
25 Change() = default;
26 Change(eChangeType type, std::string_view description, std::string_view author, iv::types::timestamp timestamp);
27 ~Change() = default;
28
29 Change(const Change &other);
30 Change(Change &&other) noexcept;
31
32 Change &operator=(const Change &other);
33 Change &operator=(Change &&other) noexcept;
34
36 std::string description;
37 std::string author;
39 };
40
41 Changes() = default;
42 Changes(const Changes &other);
43 Changes(Changes &&other) noexcept;
44 ~Changes() = default;
45
46 Changes &operator=(const Changes &other);
47 Changes &operator=(Changes &&other) noexcept;
48
49 void load(const iv::file::xml::node &node);
50 void save(iv::file::xml::node &node) const;
51
52 std::string getVersion() const;
53
54 std::string getChangeVersion(const Change &change) const;
55
56 void convertFromRevisions(const iv::model::Revisions &revisions);
57
58 void addChange(eChangeType type, std::string_view description, std::string_view author,
59 iv::types::timestamp timestamp);
60
61 std::vector<Change> m_changes;
62
63private:
64 struct Keys
65 {
66 static constexpr std::string_view version {"Version"};
67 static constexpr std::string_view type {"Type"};
68 static constexpr std::string_view description {"Description"};
69 static constexpr std::string_view author {"Author"};
70 static constexpr std::string_view timestamp {"Timestamp"};
71 };
72
73 struct Sections
74 {
75 static constexpr std::string_view changes {"Changes"};
76 static constexpr std::string_view change {"Change"};
77 static constexpr std::string_view revisions {"Revisions"};
78 };
79
81 {
82 static constexpr std::string string {};
83 static constexpr std::string description {};
85 static constexpr std::string author {};
86 static constexpr iv::types::timestamp timestamp {0};
87 };
88};
89}// namespace iv::model
90#endif//IV_SRC_MODEL_CHANGES_HPP_
Definition xmlFile.hpp:15
Definition DiamarModel.cpp:14
eChangeType
Definition Changes.hpp:14
@ Major
Definition Changes.hpp:15
@ Patch
Definition Changes.hpp:17
@ Runtime
Definition Changes.hpp:18
@ Minor
Definition Changes.hpp:16
uint64_t timestamp
Definition types.hpp:21
Definition Changes.hpp:24
Change & operator=(const Change &other)
Definition Changes.cpp:25
std::string author
Definition Changes.hpp:37
Change(const Change &other)
iv::types::timestamp timestamp
Definition Changes.hpp:38
std::string description
Definition Changes.hpp:36
eChangeType type
Definition Changes.hpp:35
Definition Changes.hpp:81
static constexpr std::string description
Definition Changes.hpp:83
static constexpr std::string author
Definition Changes.hpp:85
static constexpr eChangeType type
Definition Changes.hpp:84
static constexpr iv::types::timestamp timestamp
Definition Changes.hpp:86
Definition Changes.hpp:65
static constexpr std::string_view author
Definition Changes.hpp:69
static constexpr std::string_view type
Definition Changes.hpp:67
static constexpr std::string_view description
Definition Changes.hpp:68
static constexpr std::string_view timestamp
Definition Changes.hpp:70
static constexpr std::string_view version
Definition Changes.hpp:66
Definition Changes.hpp:74
static constexpr std::string_view changes
Definition Changes.hpp:75
static constexpr std::string_view revisions
Definition Changes.hpp:77
static constexpr std::string_view change
Definition Changes.hpp:76
Definition Changes.hpp:22
std::string getVersion() const
Definition Changes.cpp:150
void save(iv::file::xml::node &node) const
Definition Changes.cpp:104
void convertFromRevisions(const iv::model::Revisions &revisions)
Definition Changes.cpp:185
Changes & operator=(const Changes &other)
Definition Changes.cpp:58
void load(const iv::file::xml::node &node)
Definition Changes.cpp:78
std::vector< Change > m_changes
Definition Changes.hpp:61
void addChange(eChangeType type, std::string_view description, std::string_view author, iv::types::timestamp timestamp)
Definition Changes.cpp:227
std::string getChangeVersion(const Change &change) const
Definition Changes.cpp:233
Definition Revisions.hpp:15