X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=source%2Ftime%2FDate.cpp;fp=source%2Ftime%2FDate.cpp;h=0745fdd99582c4dcc7ab53268202adc5ba25567f;hp=b002fced2df50f0f0bc42c606e72b1e72952997c;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hpb=af9c86ffb0e28d35ad94d99c5f77e41578c972b4 diff --git a/source/time/Date.cpp b/source/time/Date.cpp index b002fce..0745fdd 100644 --- a/source/time/Date.cpp +++ b/source/time/Date.cpp @@ -37,7 +37,7 @@ using namespace anna::time; //------------------------------------------------------------------------------ //----------------------------------------------------------- Date::initialize() //------------------------------------------------------------------------------ -void Date::initialize(const char * TZ) throw() { +void Date::initialize(const char * TZ) { a_timestamp = ::time(NULL); setTz(TZ); } @@ -46,7 +46,7 @@ void Date::initialize(const char * TZ) throw() { //------------------------------------------------------------------------------ //-------------------------------------------------------------- Date::refresh() //------------------------------------------------------------------------------ -void Date::refresh(void) throw() { +void Date::refresh(void) { anna::Guard guard(a_mutex); // Set current/programmed timezone @@ -78,7 +78,7 @@ Date::Date(const char *TZ) { //------------------------------------------------------------------------------ //---------------------------------------------------------------- Date::setTz() //------------------------------------------------------------------------------ -void Date::setTz(const char * TZ) throw() { +void Date::setTz(const char * TZ) { if (TZ) a_tz.set(TZ); else a_tz = functions::getSystemTimezone(); @@ -89,7 +89,7 @@ void Date::setTz(const char * TZ) throw() { //------------------------------------------------------------------------------ //---------------------------------------------------- Date::setSystemTimezone() //------------------------------------------------------------------------------ -void Date::setSystemTimezone() throw() { +void Date::setSystemTimezone() { a_tz = functions::getSystemTimezone(); // Refresh the other data: refresh(); @@ -99,7 +99,7 @@ void Date::setSystemTimezone() throw() { //------------------------------------------------------------------------------ //---------------------------------------------------------------- Date::store() //------------------------------------------------------------------------------ -void Date::store(const time_t & unixTimestamp) throw() { +void Date::store(const time_t & unixTimestamp) { a_timestamp = unixTimestamp; // Refresh the other data: refresh(); @@ -109,7 +109,7 @@ void Date::store(const time_t & unixTimestamp) throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Date::storeNtp() //------------------------------------------------------------------------------ -void Date::storeNtp(const unsigned int & ntpTimestamp) throw() { +void Date::storeNtp(const unsigned int & ntpTimestamp) { a_timestamp = ntpTimestamp - TIMESTAMP_OFFSET_NTP1900_OVER_UNIX1970; // Refresh the other data: refresh(); @@ -121,7 +121,7 @@ void Date::storeNtp(const unsigned int & ntpTimestamp) throw() { //------------------------------------------------------------------------------ void Date::store(const struct tm &date, const char *TZ) -throw(anna::RuntimeException) +noexcept(false) { if (TZ) { @@ -153,7 +153,7 @@ throw(anna::RuntimeException) //---------------------------------------------------------------- Date::store() //------------------------------------------------------------------------------ void Date::store(const std::string &stringDate, const char *TZ, const char *strptimeFormat) -throw(anna::RuntimeException) +noexcept(false) { if(strptimeFormat == NULL) throw anna::RuntimeException("Invalid NULL strptimeFormat !!", ANNA_FILE_LOCATION); @@ -195,7 +195,7 @@ Date & Date::operator = (const Date & d) { //------------------------------------------------------------------------------ //--------------------------------------------------------------- Date::getDay() //------------------------------------------------------------------------------ -const char *Date::getDay(void) const throw() { +const char *Date::getDay(void) const { static const char *weekdayname[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; @@ -207,7 +207,7 @@ const char *Date::getDay(void) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------- Date::yyyymmddHHmmss() //------------------------------------------------------------------------------ -std::string Date::yyyymmddHHmmss(void) const throw() { +std::string Date::yyyymmddHHmmss(void) const { return anna::functions::asString("%04d%02d%02d%02d%02d%02d", 1900 + a_tm.tm_year, 1 + (a_tm.tm_mon), a_tm.tm_mday, a_tm.tm_hour, a_tm.tm_min, a_tm.tm_sec); @@ -217,7 +217,7 @@ std::string Date::yyyymmddHHmmss(void) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Date::asString() //------------------------------------------------------------------------------ -std::string Date::asString(void) const throw() { +std::string Date::asString(void) const { std::string result = anna::functions::asString("%s %02d/%02d/%04d %02d:%02d:%02d ", getDay(), getTm().tm_mday, 1 + (getTm().tm_mon), 1900 + getTm().tm_year, @@ -234,7 +234,7 @@ std::string Date::asString(void) const throw() { //------------------------------------------------------------------------------ //---------------------------------------------------------------- Date::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* Date::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* Date::asXML(anna::xml::Node* parent) const { //anna::xml::Node* result = parent->createChild("anna.time.Date"); parent->createAttribute("Date", anna::functions::asString("%02d/%02d/%04d", getTm().tm_mday, 1 + (getTm().tm_mon), 1900 + getTm().tm_year)); parent->createAttribute("Day", getDay());