This needs to be cleaned up a bit as we don't actually want to
import rgw_common into ceph_json (we'll need to pull the parse_date
out of that and into somewhere more accessible/appropriate).
Signed-off-by: Greg Farnum <greg@inktank.com>
}
}
+void decode_json_obj(utime_t& val, JSONObj *obj)
+{
+ string s = obj->get_data();
+ uint64_t epoch;
+ int r = utime_t::parse_date(s, &epoch);
+ if (r == 0) {
+ val.set_from_double(epoch);
+ } else {
+ throw JSONDecoder::err("failed to decode utime_t");
+ }
+}
+
void encode_json(const char *name, const string& val, Formatter *f)
{
f->dump_string(name, val);
void decode_json_obj(int& val, JSONObj *obj);
void decode_json_obj(bool& val, JSONObj *obj);
void decode_json_obj(bufferlist& val, JSONObj *obj);
+class utime_t;
+void decode_json_obj(utime_t& val, JSONObj *obj);
template<class T>
void decode_json_obj(list<T>& l, JSONObj *obj)