Permalink
Browse files

restore - but deprecate - NSDictionary and NSData bson categories.

  • Loading branch information...
1 parent a7df856 commit ad831922124dcbf36d8d8b11666ec4c64c809892 Tim Burks committed Dec 8, 2010
Showing with 23 additions and 0 deletions.
  1. +9 −0 objc/NuBSON.h
  2. +14 −0 objc/NuBSON.m
View
@@ -98,3 +98,12 @@ limitations under the License.
@end
bson *bson_for_object(id object); // used in NuMongoDB
+
+// deprecated convenience categories
+@interface NSData (NuBSON)
+- (NSMutableDictionary *) BSONValue;
+@end
+
+@interface NSDictionary (NuBSON)
+- (NSData *) BSONRepresentation;
+@end
View
@@ -579,3 +579,17 @@ - (id) handleUnknownMessage:(id) method withContext:(NSMutableDictionary *) cont
}
@end
+
+
+// deprecated convenience categories
+@implementation NSData (NuBSON)
+- (NSMutableDictionary *) BSONValue {
+ return [[NuBSON bsonWithData:self] dictionaryValue];
+}
+@end
+
+@implementation NSDictionary (NuBSON)
+- (NSData *) BSONRepresentation {
+ return [[NuBSON bsonWithDictionary:self] dataRepresentation];
+}
+@end

0 comments on commit ad83192

Please sign in to comment.