Remove dynamic exceptions
[anna.git] / source / time / Date.cpp
index b002fce..0745fdd 100644 (file)
@@ -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());