Permalink
Browse files

comments on obj() and arr()

  • Loading branch information...
erh committed Oct 25, 2010
1 parent 36328b2 commit 0dbcd449c62404f46320e2e1a09039d688f9f121
Showing with 10 additions and 2 deletions.
  1. +10 −2 bson/bsonobjbuilder.h
View
@@ -511,7 +511,11 @@ namespace mongo {
template < class T >
BSONObjBuilder& append( const StringData& fieldName, const list< T >& vals );
- /** The returned BSONObj will free the buffer when it is finished. */
+ /**
+ * destructive
+ * The returned BSONObj will free the buffer when it is finished.
+ * @return owned BSONObj
+ */
BSONObj obj() {
bool own = owned();
massert( 10335 , "builder does not own memory", own );
@@ -662,7 +666,11 @@ namespace mongo {
void appendNull() {
_b.appendNull(num());
}
-
+
+ /**
+ * destructive - ownership moves to returned BSONArray
+ * @return owned BSONArray
+ */
BSONArray arr(){ return BSONArray(_b.obj()); }
BSONObj done() { return _b.done(); }

0 comments on commit 0dbcd44

Please sign in to comment.