//------------------------------------------------------------------------------
//----------------------------------------------------------- Date::initialize()
//------------------------------------------------------------------------------
-void Date::initialize(const char * TZ) throw() {
+void Date::initialize(const char * TZ) {
a_timestamp = ::time(NULL);
setTz(TZ);
}
//------------------------------------------------------------------------------
//-------------------------------------------------------------- Date::refresh()
//------------------------------------------------------------------------------
-void Date::refresh(void) throw() {
+void Date::refresh(void) {
anna::Guard guard(a_mutex);
// Set current/programmed timezone
//------------------------------------------------------------------------------
//---------------------------------------------------------------- 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();
//------------------------------------------------------------------------------
//---------------------------------------------------- Date::setSystemTimezone()
//------------------------------------------------------------------------------
-void Date::setSystemTimezone() throw() {
+void Date::setSystemTimezone() {
a_tz = functions::getSystemTimezone();
// Refresh the other data:
refresh();
//------------------------------------------------------------------------------
//---------------------------------------------------------------- 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();
//------------------------------------------------------------------------------
//------------------------------------------------------------- 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();
//------------------------------------------------------------------------------
void Date::store(const struct tm &date, const char *TZ)
-throw(anna::RuntimeException)
+noexcept(false)
{
if (TZ) {
//---------------------------------------------------------------- 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);
//------------------------------------------------------------------------------
//--------------------------------------------------------------- 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"};
//------------------------------------------------------------------------------
//------------------------------------------------------- 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);
//------------------------------------------------------------------------------
//------------------------------------------------------------- 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,
//------------------------------------------------------------------------------
//---------------------------------------------------------------- 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());