X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=source%2Fcore%2Futil%2FSecond.cpp;h=eecb909404ac767b86180a6322d4e900ff2041fb;hp=fcf75b15619f2b3c1247ad4a4f87e03a11195fbb;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hpb=af9c86ffb0e28d35ad94d99c5f77e41578c972b4 diff --git a/source/core/util/Second.cpp b/source/core/util/Second.cpp index fcf75b1..eecb909 100644 --- a/source/core/util/Second.cpp +++ b/source/core/util/Second.cpp @@ -21,12 +21,12 @@ using namespace anna; #define implement_operator(op) \ bool Second::operator op (const Millisecond& other) const \ - throw ()\ + \ {\ return a_value op (other.a_value / 1000);\ }\ bool Second::operator op (const Microsecond& other) const\ - throw ()\ + \ {\ return a_value op (other.a_value / 1000000);\ } @@ -36,13 +36,13 @@ Second::Second(const Millisecond& other) : a_value(other.a_value / 1000) {;} Second::Second(const Microsecond& other) : a_value(other.a_value / 1000000) {;} Second& Second::operator= (const Millisecond & other) -throw() { +{ a_value = (other.a_value / 1000); return *this; } Second& Second::operator= (const Microsecond & other) -throw() { +{ a_value = (other.a_value / 1000000); return *this; } @@ -53,13 +53,13 @@ implement_operator( >) implement_operator( <) string Second::asDateTime(const char* format) const -throw() { +{ char aux [DateTimeSizeString]; return string(asDateTime(aux, format)); } const char* Second::asDateTime(char* result, const char* format) const -throw() { +{ struct tm* tt = localtime((time_t*) & a_value); char aux [256]; @@ -71,7 +71,7 @@ throw() { //static Second Second::getTime() -throw() { +{ struct timeval tv; gettimeofday(&tv, NULL); return Second(tv.tv_sec); @@ -79,19 +79,19 @@ throw() { //static Second Second::getLocalTime() -throw() { +{ return Second(time(NULL)); } string Second::asString() const -throw() { +{ string result(functions::asString(a_value)); return result += " sec"; } //static Second Second::fromString(const std::string& value) -throw(RuntimeException) { +noexcept(false) { if(value.find(" sec") == string::npos) { string msg("String: "); msg += value;