Merge pull request #23 from vikramrajkumar/phoenix
Updates needed for bitshares_toolkit bugfixes
This commit is contained in:
commit
5586b63fa2
2 changed files with 40 additions and 36 deletions
|
|
@ -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; }
|
||||||
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; }
|
||||||
|
microseconds& operator-=(const microseconds& c) { _count -= c._count; return *this; }
|
||||||
int64_t count()const { return _count; }
|
int64_t count()const { return _count; }
|
||||||
private:
|
private:
|
||||||
friend class time_point;
|
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; }
|
||||||
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) { 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); }
|
||||||
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()); }
|
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; }
|
||||||
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; }
|
||||||
|
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 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); }
|
friend microseconds operator - ( const time_point_sec& t, const time_point_sec& m ) { return time_point(t) - time_point(m); }
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,8 @@ namespace fc
|
||||||
FC_THROW_EXCEPTION( parse_error_exception, "Expected '\\'" );
|
FC_THROW_EXCEPTION( parse_error_exception, "Expected '\\'" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void skip_white_space( T& in )
|
void skip_white_space( T& in )
|
||||||
{
|
{
|
||||||
while( true )
|
while( true )
|
||||||
{
|
{
|
||||||
|
|
@ -176,8 +175,10 @@ namespace fc
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
FC_THROW_EXCEPTION( parse_error_exception, "Expected '}' after ${variant}", ("variant", 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" );
|
} FC_RETHROW_EXCEPTIONS( warn, "Error parsing object" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue