Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added support for long longs (although they are truncated to longs in…

… MongoDB).
  • Loading branch information...
commit 4eeb66115df0cfead136ea3d94432e6243964077 1 parent b52fca5
Tim Burks authored

Showing 1 changed file with 8 additions and 4 deletions. Show diff stats Hide diff stats

  1. +8 4 objc/NuBSON.m
12 objc/NuBSON.m
@@ -9,9 +9,9 @@ @implementation NuBSONObjectID
9 9
10 10 + (NuBSONObjectID *) objectID
11 11 {
12   - bson_oid_t oid;
13   - bson_oid_gen(&oid);
14   - return [[[NuBSONObjectID alloc] initWithObjectIDPointer:&oid] autorelease];
  12 + bson_oid_t oid;
  13 + bson_oid_gen(&oid);
  14 + return [[[NuBSONObjectID alloc] initWithObjectIDPointer:&oid] autorelease];
15 15 }
16 16
17 17 - (id) initWithString:(NSString *) s
@@ -77,7 +77,7 @@ - (NuBSON *) initWithBSON:(bson) b
77 77
78 78 - (NSData *) data
79 79 {
80   - return [[[NSData alloc] initWithBytes:(bsonValue.data) length:bson_size(&(bsonValue.data))] autorelease];
  80 + return [[[NSData alloc] initWithBytes:(bsonValue.data) length:bson_size(&(bsonValue.data))] autorelease];
81 81 }
82 82
83 83 void add_object_to_bson_buffer(bson_buffer *bb, id key, id object)
@@ -95,6 +95,10 @@ void add_object_to_bson_buffer(bson_buffer *bb, id key, id object)
95 95 case 'L':
96 96 bson_append_long(bb, name, [object longValue]);
97 97 break;
  98 + case 'q':
  99 + case 'Q':
  100 + bson_append_long(bb, name, [object longLongValue]);
  101 + break;
98 102 case 'B':
99 103 bson_append_bool(bb, name, [object boolValue]);
100 104 break;

0 comments on commit 4eeb661

Please sign in to comment.
Something went wrong with that request. Please try again.