Serialization works in new version
This commit is contained in:
parent
6b3ce01e94
commit
79f7135746
23 changed files with 186 additions and 56 deletions
20
src/VersionConstants.cpp
Normal file
20
src/VersionConstants.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include "VersionConstants.hpp"
|
||||
#include <stdexcept>
|
||||
|
||||
namespace VersionConstants {
|
||||
|
||||
VersionNumber header_to_version_number(const std::string& header) {
|
||||
static std::unordered_map<std::string, VersionNumber> m;
|
||||
if(m.empty()) {
|
||||
m["INFPNT000001"] = VersionNumber(0, 0, 1);
|
||||
m["INFPNT000002"] = VersionNumber(0, 1, 0);
|
||||
m["INFPNT000003"] = VersionNumber(0, 2, 0);
|
||||
m["INFPNT000004"] = VersionNumber(0, 3, 0);
|
||||
}
|
||||
auto it = m.find(header);
|
||||
if(it == m.end())
|
||||
throw std::runtime_error("[VersionConstants::header_to_version_number] Header " + header + " is invalid");
|
||||
return it->second;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue