SystemTime.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-03-07
  6. * Changed: 2024-09-11
  7. *
  8. * */
  9. #ifndef LS_STD_SYSTEM_TIME_HPP
  10. #define LS_STD_SYSTEM_TIME_HPP
  11. #include "SystemTimeParameter.hpp"
  12. #include <cstdint>
  13. #include <ls-std/core/Class.hpp>
  14. #include <ls-std/os/dynamic-goal.hpp>
  15. #include <ls-std/time/common/DateParameter.hpp>
  16. #include <ls-std/time/type/DateParameterTypes.hpp>
  17. #include <memory>
  18. #include <string>
  19. /*
  20. * @doc: class(name: 'SystemTime', package: 'time')
  21. * @doc: time.SystemTime.description('This class represents the system time and can be set. This would require root privileges.')
  22. * */
  23. namespace ls::std::time
  24. {
  25. class LS_STD_DYNAMIC_GOAL SystemTime : public ls::std::core::Class
  26. {
  27. public:
  28. explicit SystemTime(const ::std::shared_ptr<ls::std::time::SystemTimeParameter> &_parameter);
  29. SystemTime();
  30. ~SystemTime() noexcept override;
  31. [[nodiscard]] bool set(const ls::std::time::DateParameter &_dateParameter) const;
  32. private:
  33. ::std::shared_ptr<ls::std::time::SystemTimeParameter> parameter{};
  34. [[nodiscard]] static ::std::string _fetchClassName();
  35. void _generateParameter();
  36. };
  37. }
  38. #endif