/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2023-03-15 * Changed: 2023-04-01 * * */ #include #include #if defined(unix) || defined(__APPLE__) #include #endif #include #include #ifdef _WIN32 #include #endif #include using ls::std::core::Class; using ls::std::core::NullPointerArgumentEvaluator; using ls::std::time::DateParameter; #if defined(unix) || defined(__APPLE__) using ls::std::time::PosixClock; #endif using ls::std::time::SystemTime; using ls::std::time::SystemTimeParameter; #ifdef _WIN32 using ls::std::time::WindowsClock; #endif using ls::std::time::type::UnixTimestamp; using std::make_shared; using std::shared_ptr; SystemTime::SystemTime(const shared_ptr &_parameter) : SystemTime() { NullPointerArgumentEvaluator{_parameter}.evaluate(); this->parameter = _parameter; } SystemTime::SystemTime() : Class("SystemTime") { this->_generateParameter(); } SystemTime::~SystemTime() noexcept = default; bool SystemTime::set(const DateParameter &_dateParameter) { return this->parameter->getClock()->setTime(_dateParameter); } void SystemTime::_generateParameter() { this->parameter = make_shared(); #if defined(unix) || defined(__APPLE__) this->parameter->setClock(make_shared()); #endif #ifdef _WIN32 this->parameter->setClock(make_shared()); #endif }