Merge pull request #23 from vikramrajkumar/phoenix

Updates needed for bitshares_toolkit bugfixes
This commit is contained in:
Daniel Larimer 2014-05-17 10:20:23 -04:00
commit 5586b63fa2
2 changed files with 40 additions and 36 deletions

View file

@ -23,6 +23,7 @@ namespace fc {
friend bool operator<(const microseconds& a, const microseconds& b){ return a._count < b._count; }
friend bool operator<=(const microseconds& a, const microseconds& b){ return a._count <= b._count; }
microseconds& operator+=(const microseconds& c) { _count += c._count; return *this; }
microseconds& operator-=(const microseconds& c) { _count -= c._count; return *this; }
int64_t count()const { return _count; }
private:
friend class time_point;
@ -53,6 +54,7 @@ namespace fc {
bool operator ==( const time_point& t )const { return elapsed._count ==t.elapsed._count; }
bool operator !=( const time_point& t )const { return elapsed._count !=t.elapsed._count; }
time_point& operator += ( const microseconds& m) { elapsed+=m; return *this; }
time_point& operator -= ( const microseconds& m) { elapsed-=m; return *this; }
time_point operator + (const microseconds& m) const { return time_point(elapsed+m); }
time_point operator - (const microseconds& m) const { return time_point(elapsed-m); }
microseconds operator - (const time_point& m) const { return microseconds(elapsed.count() - m.elapsed.count()); }
@ -90,6 +92,7 @@ namespace fc {
friend bool operator == ( const time_point_sec& a, const time_point_sec& b ) { return a.utc_seconds == b.utc_seconds; }
friend bool operator != ( const time_point_sec& a, const time_point_sec& b ) { return a.utc_seconds != b.utc_seconds; }
time_point_sec& operator += ( uint32_t m ) { utc_seconds+=m; return *this; }
time_point_sec& operator -= ( uint32_t m ) { utc_seconds-=m; return *this; }
friend time_point operator - ( const time_point_sec& t, const microseconds& m ) { return time_point(t) - m; }
friend microseconds operator - ( const time_point_sec& t, const time_point_sec& m ) { return time_point(t) - time_point(m); }

View file

@ -43,7 +43,6 @@ namespace fc
FC_THROW_EXCEPTION( parse_error_exception, "Expected '\\'" );
}
template<typename T>
void skip_white_space( T& in )
{
@ -176,8 +175,10 @@ namespace fc
return obj;
}
FC_THROW_EXCEPTION( parse_error_exception, "Expected '}' after ${variant}", ("variant", obj ) );
}
catch( const fc::eof_exception& e )
{
FC_THROW_EXCEPTION( parse_error_exception, "Unexpected EOF: ${e}", ("e", e.to_detail_string() ) );
} FC_RETHROW_EXCEPTIONS( warn, "Error parsing object" );
}