12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /*
- * Author: Patrick-Christopher Mattulat
- * Company: Lynar Studios
- * E-Mail: webmaster@lynarstudios.com
- * Created: 2020-09-27
- * Changed: 2024-05-31
- *
- * */
- #ifndef LS_STD_VERSION_HPP
- #define LS_STD_VERSION_HPP
- #include <ls-std/core/definition.hpp>
- #include <ls-std/core/interface/ISerializable.hpp>
- #include <ls-std/core/type/Types.hpp>
- #include <string_view>
- namespace ls::std::core
- {
- ls_std_class Version final : public interface_type::ISerializable
- {
- public:
- explicit Version(type::version_type _majorVersion, type::version_type _minorVersion, type::version_type _patchVersion);
- ~Version() noexcept override;
- // implementation
- [[nodiscard]] type::byte_field marshal() override;
- void unmarshal(const type::byte_field &_data) override;
- // other functionality
- [[nodiscard]] type::version_type getMajorVersion() const;
- [[nodiscard]] type::version_type getMinorVersion() const;
- [[nodiscard]] type::version_type getPatchVersion() const;
- [[nodiscard]] static bool isValid(const ::std::string &_versionString);
- void setMajorVersion(type::version_type _major);
- void setMinorVersion(type::version_type _minor);
- void setPatchVersion(type::version_type _patch);
- private:
- type::version_type majorVersion{};
- type::version_type minorVersion{};
- type::version_type patchVersion{};
- [[nodiscard]] static bool _isValid(::std::string_view _versionString);
- };
- }
- #endif
|