mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
StringBuilder support for BSONObj/BSONElement
This commit is contained in:
parent
108401044c
commit
a8115022f0
@ -614,6 +614,16 @@ namespace mongo {
|
||||
return s << e.toString();
|
||||
}
|
||||
|
||||
inline StringBuilder& operator<<( StringBuilder &s, const BSONObj &o ) {
|
||||
o.toString( s );
|
||||
return s;
|
||||
}
|
||||
inline StringBuilder& operator<<( StringBuilder &s, const BSONElement &e ) {
|
||||
e.toString( s );
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
inline void BSONElement::Val(BSONObj& v) const { v = Obj(); }
|
||||
|
||||
template<typename T>
|
||||
|
@ -373,9 +373,14 @@ private:
|
||||
_assertInvalid();
|
||||
}
|
||||
};
|
||||
|
||||
ostream& operator<<( ostream &s, const BSONObj &o );
|
||||
ostream& operator<<( ostream &s, const BSONElement &e );
|
||||
|
||||
StringBuilder& operator<<( StringBuilder &s, const BSONObj &o );
|
||||
StringBuilder& operator<<( StringBuilder &s, const BSONElement &e );
|
||||
|
||||
|
||||
struct BSONArray : BSONObj {
|
||||
// Don't add anything other than forwarding constructors!!!
|
||||
BSONArray(): BSONObj() {}
|
||||
|
Loading…
Reference in New Issue
Block a user