Version.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-09-27
  6. * Changed: 2020-09-27
  7. *
  8. * */
  9. #ifndef LS_STD_VERSION_HPP
  10. #define LS_STD_VERSION_HPP
  11. #include "Class.hpp"
  12. #include "../serialization/ISerializable.hpp"
  13. #include "../base/Types.hpp"
  14. namespace ls_std {
  15. class Version : public ISerializable {
  16. explicit Version(version_type _major, version_type _minor, version_type _patch);
  17. ~Version() = default;
  18. ls_std::byte_field marshal() override;
  19. void unmarshal(const ls_std::byte_field& _data) override;
  20. version_type getMajor() const;
  21. version_type getMinor() const;
  22. version_type getPatch();
  23. void setMajor(version_type _major);
  24. void setMinor(version_type _minor);
  25. void setPatch(version_type _patch);
  26. private:
  27. version_type major {};
  28. version_type minor {};
  29. version_type patch {};
  30. bool _isValidVersionString(const std::string& _versionString);
  31. };
  32. }
  33. #endif