-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
ConverterVersion.h
56 lines (37 loc) · 1.36 KB
/
ConverterVersion.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef CONVERTER_VERSION_H
#define CONVERTER_VERSION_H
// A class to handle converter-style versions
#include "GameVersion.h"
#include "Parser.h"
namespace commonItems
{
class ConverterVersion: convenientParser
{
public:
ConverterVersion() = default;
void loadVersion(const std::string& filename);
void loadVersion(std::istream& theStream);
[[nodiscard]] const auto& getName() const { return name; }
[[nodiscard]] const auto& getVersion() const { return version; }
[[nodiscard]] const auto& getSource() const { return source; }
[[nodiscard]] const auto& getTarget() const { return target; }
[[nodiscard]] const auto& getMinSource() const { return minSource; }
[[nodiscard]] const auto& getMaxSource() const { return maxSource; }
[[nodiscard]] const auto& getMinTarget() const { return minTarget; }
[[nodiscard]] const auto& getMaxTarget() const { return maxTarget; }
[[nodiscard]] std::string getDescription() const;
friend std::ostream& operator<<(std::ostream& output, const ConverterVersion& version);
private:
void registerKeys();
std::string name;
std::string version;
std::string source;
std::string target;
GameVersion minSource;
GameVersion maxSource;
GameVersion minTarget;
GameVersion maxTarget;
};
std::ostream& operator<<(std::ostream& output, const ConverterVersion& version);
} // namespace commonItems
#endif // CONVERTER_VERSION_H