9 #ifndef __libutilxx__sella__variant__Time_H__
10 #define __libutilxx__sella__variant__Time_H__
12 #include "../../common.h"
13 #include "TypeCastException.h"
18 #include <boost/regex.hpp>
28 static const boost::regex & Pattern(
void) {
static boost::regex regex(
"^(([01][0-9])|(2[0-3])):([0-5][0-9])(:([0-5][0-9])(\\.([0-9]{1,6}))?)?$");
return regex; }
29 static const int Type = 0x21;
33 Time(
const std::string & value)
throw (TypeCastException);
34 Time(int64_t value)
throw ();
37 virtual ~
Time()
throw ();
40 bool operator==(
const Time &other)
const throw ();
41 bool operator!=(
const Time &other)
const throw ();
42 bool operator>(
const Time &other)
const throw ();
43 bool operator<(
const Time &other)
const throw ();
44 Time& operator=(
const Time &other)
throw ();
45 Time& operator+=(int64_t value)
throw ();
46 Time& operator-=(int64_t value)
throw ();
47 Time& operator*=(int64_t value)
throw ();
48 Time& operator/=(int64_t value)
throw ();
49 Time& operator^=(int64_t value)
throw ();
50 Time& operator%=(int64_t value)
throw ();
51 Time& operator&=(int64_t value)
throw ();
52 Time& operator|=(int64_t value)
throw ();
53 Time& operator<<=(int64_t value)
throw ();
54 Time& operator>>=(int64_t value)
throw ();
57 int64_t getUsec()
const throw (UnsupportedOperatorException);
60 virtual void msgpackBufferSize(
size_t &size)
const throw ();
61 virtual std::string str(
int type)
const throw ();
62 virtual int getType(
void)
throw () {
return Type; }
64 static bool isType(
const std::string &value)
throw () {
return isType(value.c_str(), value.size()); }
65 static bool isType(
const char *value,
size_t size)
throw ();