Browse files

return a string from key(), add Undefined

  • Loading branch information...
1 parent 61d59b8 commit 1c2a4befe64ce34b7c1cb117ee77bd39b7cfcf3a @gerald-lindsly committed Nov 21, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 MongoBson.pas
View
9 MongoBson.pas
@@ -422,7 +422,7 @@ implementation
Result := bson_iterator_next(handle) <> bsonEOO;
end;
- function TBsonIterator.key() : PAnsiChar;
+ function TBsonIterator.key() : string;
begin
Result := string(bson_iterator_key(handle));
end;
@@ -632,6 +632,13 @@ implementation
Result := (bson_append_null(handle, name) = 0);
end;
+ function TBsonBuffer.appendUndefined(name: PAnsiChar) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_undefined(handle, name) = 0);
+ end;
+
function TBsonBuffer.appendBinary(name : PAnsiChar; kind : Integer; data : Pointer; length : Integer) : Boolean;
begin
if handle = nil then

0 comments on commit 1c2a4be

Please sign in to comment.