add to/from variant for fc::microseconds
This commit is contained in:
parent
8347a7b7fa
commit
a6ca7042da
2 changed files with 16 additions and 1 deletions
|
|
@ -29,6 +29,7 @@ namespace fc
|
|||
class mutable_variant_object;
|
||||
class time_point;
|
||||
class time_point_sec;
|
||||
class microseconds;
|
||||
|
||||
void to_variant( const int16_t& var, variant& vo );
|
||||
void from_variant( const variant& var, int16_t& vo );
|
||||
|
|
@ -69,6 +70,10 @@ namespace fc
|
|||
|
||||
void to_variant( const time_point_sec& var, variant& vo );
|
||||
void from_variant( const variant& var, time_point_sec& vo );
|
||||
|
||||
void to_variant( const microseconds& input_microseconds, variant& output_variant );
|
||||
void from_variant( const variant& input_variant, microseconds& output_microseconds );
|
||||
|
||||
#ifdef __APPLE__
|
||||
void to_variant( size_t s, variant& v );
|
||||
#elif !defined(_MSC_VER)
|
||||
|
|
|
|||
12
src/time.cpp
12
src/time.cpp
|
|
@ -99,4 +99,14 @@ namespace fc {
|
|||
string get_approximate_relative_time_string(const time_point& event_time) {
|
||||
return get_approximate_relative_time_string(time_point_sec(event_time));
|
||||
}
|
||||
}
|
||||
|
||||
void to_variant( const microseconds& input_microseconds, variant& output_variant )
|
||||
{
|
||||
output_variant = input_microseconds.count();
|
||||
}
|
||||
void from_variant( const variant& input_variant, microseconds& output_microseconds )
|
||||
{
|
||||
output_microseconds = microseconds(input_variant.as_int64());
|
||||
}
|
||||
|
||||
} //namespace fc
|
||||
|
|
|
|||
Loading…
Reference in a new issue