-// ANNA - Anna is Not Nothingness Anymore
-//
-// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
-//
-// http://redmine.teslayout.com/projects/anna-suite
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of the copyright holder nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: eduardo.ramos.testillano@gmail.com
-// cisco.tierra@gmail.com
+// ANNA - Anna is Not Nothingness Anymore //
+// //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
+// //
+// See project site at http://redmine.teslayout.com/projects/anna-suite //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
#ifndef anna_time_Date_hpp
// sets the current date/time (time(NULL)) and provided TimeZone as described in constructor
- void initialize(const char *TZ = NULL) throw();
+ void initialize(const char *TZ = NULL) ;
// main refresh method regarding timestamp
- void refresh(void) throw();
+ void refresh(void) ;
anna::Mutex a_mutex;
/**
* Sets the current date/time (time(NULL)) and provided TimeZone as described in constructor
*/
- void setNow(const char *TZ = NULL) throw() { initialize(TZ); }
+ void setNow(const char *TZ = NULL) { initialize(TZ); }
/**
* timezone, only helps to know the valid TZ values and shows how to change
* the timezone settings if you would want to do that).
*/
- void setTz(const char *TZ = NULL) throw();
+ void setTz(const char *TZ = NULL) ;
/**
Sets the local host timezone (even if it is based on TZ or in /usr/share/zoneinfo)
*/
- void setSystemTimezone() throw();
+ void setSystemTimezone() ;
/**
*
* @param unixTimestamp Time since 01-Jan-1970 GMT
*/
- void store(const time_t & unixTimestamp) throw();
- void storeUnix(const time_t & unixTimestamp) throw() { store(unixTimestamp); }
+ void store(const time_t & unixTimestamp) ;
+ void storeUnix(const time_t & unixTimestamp) { store(unixTimestamp); }
/**
*
* @param ntpTimestamp Time since 01-Jan-1900 GMT
*/
- void storeNtp(const unsigned int &ntpTimestamp) throw();
+ void storeNtp(const unsigned int &ntpTimestamp) ;
/**
* @param TZ timezone for date/time provided. Default (NULL) assumes the system
* timezone configuration. Empty string will be interpreted as UTC timezone.
*/
- void store(const struct tm &date, const char *TZ = NULL) throw(anna::RuntimeException);
+ void store(const struct tm &date, const char *TZ = NULL) noexcept(false);
/**
* @param strptimeFormat Date/time string format for strptime primitive.
* See format syntax at http://man7.org/linux/man-pages/man3/strptime.3.html
*/
- void store(const std::string &stringDate, const char *TZ = NULL, const char *strptimeFormat = "%Y%m%d%H%M%S") throw(anna::RuntimeException);
- //void store(const std::string &stringDate, const char *tz = NULL, const char *strptimeFormat = "%Y-%m-%d-%H-%M-%S") throw(anna::RuntimeException);
+ void store(const std::string &stringDate, const char *TZ = NULL, const char *strptimeFormat = "%Y%m%d%H%M%S") noexcept(false);
+ //void store(const std::string &stringDate, const char *tz = NULL, const char *strptimeFormat = "%Y-%m-%d-%H-%M-%S") noexcept(false);
/**
* @return NULL if TZ is unset, or string for TZ environment variable
* (empty is allowed and use to be understood as UTC.
*/
- const char *getTz(void) const throw() { return (a_tz.unsetTZ() ? NULL:a_tz.getValue().c_str()); }
+ const char *getTz(void) const { return (a_tz.unsetTZ() ? NULL:a_tz.getValue().c_str()); }
/**
* Gets the context timezone as string
*/
- std::string getTzAsString() const throw() { return a_tz.asString(); }
+ std::string getTzAsString() const { return a_tz.asString(); }
/**
*
* @return 'tm' struct on the current timezone
*/
- const struct tm & getTm(void) const throw() { return a_tm; }
+ const struct tm & getTm(void) const { return a_tm; }
/**
* Gets the week day abbreviation: Sun, Mon, Tue, Wed, Thu, Fri, Sat
*
* @return Day of the week
*/
- const char *getDay(void) const throw();
+ const char *getDay(void) const ;
/**
*
* @see getTz
*/
- std::string yyyymmddHHmmss(void) const throw();
+ std::string yyyymmddHHmmss(void) const ;
/**
*
* @return Seconds since 01-Jan-1970 GMT
*/
- const time_t & getUnixTimestamp(void) const throw() { return a_timestamp; }
+ const time_t & getUnixTimestamp(void) const { return a_timestamp; }
/**
*
* @return Seconds since 01-Jan-1900 GMT
*/
- unsigned int getNtpTimestamp(void) const throw() {
+ unsigned int getNtpTimestamp(void) const {
unsigned int ntp_timestamp = a_timestamp + TIMESTAMP_OFFSET_NTP1900_OVER_UNIX1970;
return ntp_timestamp;
}
*
* @return String with class content
*/
- std::string asString(void) const throw();
+ std::string asString(void) const ;
/**
*
* @return XML with class content
*/
- anna::xml::Node* asXML(anna::xml::Node* parent) const throw();
+ anna::xml::Node* asXML(anna::xml::Node* parent) const ;
};