Permalink
Browse files

The Great Renaming

ToyCouch --> TouchDB
"Toy" prefix --> "TD"
  • Loading branch information...
1 parent 42705e2 commit 9ae9ecf1da40c3e769a0687194dfe44a092de118 @snej snej committed Dec 9, 2011
Showing with 777 additions and 775 deletions.
  1. +3 −3 Demo/DemoAppController.h
  2. +13 −13 Demo/DemoAppController.m
  3. +1 −1 Demo/ShoppingDemo-Info.plist
  4. +1 −1 README.md
  5. +1 −1 Source/ChangeTracker/TDBase64.h
  6. +1 −1 Source/ChangeTracker/TDBase64.m
  7. +1 −1 Source/ChangeTracker/TDChangeTracker.h
  8. +1 −1 Source/ChangeTracker/TDChangeTracker.m
  9. +1 −1 Source/ChangeTracker/TDConnectionChangeTracker.h
  10. +1 −1 Source/ChangeTracker/TDSocketChangeTracker.h
  11. +2 −2 Source/ChangeTracker/TDSocketChangeTracker.m
  12. +5 −5 Source/{ToyBody.h → TDBody.h}
  13. +6 −6 Source/{ToyBody.m → TDBody.m}
  14. +3 −3 Source/{ToyCollate.h → TDCollateJSON.h}
  15. +27 −27 Source/{ToyCollate.m → TDCollateJSON.m}
  16. +25 −25 Source/{ToyDB.h → TDDatabase.h}
  17. +54 −54 Source/{ToyDB.m → TDDatabase.m}
  18. +32 −34 Source/{ToyDB_Tests.m → TDDatabase_Tests.m}
  19. +31 −0 Source/TDInternal.h
  20. +4 −4 Source/{ToyPuller.h → TDPuller.h}
  21. +15 −17 Source/{ToyPuller.m → TDPuller.m}
  22. +12 −13 Source/{ToyPuller_Tests.m → TDPuller_Tests.m}
  23. +4 −4 Source/{ToyPusher.h → TDPusher.h}
  24. +14 −18 Source/{ToyPusher.m → TDPusher.m}
  25. +7 −7 Source/{ToyReplicator.h → TDReplicator.h}
  26. +7 −9 Source/{ToyReplicator.m → TDReplicator.m}
  27. +13 −13 Source/{ToyRev.h → TDRevision.h}
  28. +16 −17 Source/{ToyRev.m → TDRevision.m}
  29. +14 −14 Source/{ToyRouter.h → TDRouter.h}
  30. +55 −56 Source/{ToyRouter.m → TDRouter.m}
  31. +37 −38 Source/{ToyRouter_Tests.m → TDRouter_Tests.m}
  32. +6 −10 Source/{ToyServer.h → TDServer.h}
  33. +25 −23 Source/{ToyServer.m → TDServer.m}
  34. +24 −0 Source/TDURLProtocol.h
  35. +33 −25 Source/{ToyProtocol.m → TDURLProtocol.m}
  36. +15 −15 Source/{ToyView.h → TDView.h}
  37. +12 −12 Source/{ToyView.m → TDView.m}
  38. +26 −26 Source/{ToyView_Tests.m → TDView_Tests.m}
  39. +1 −1 Source/{ToyCouch-Info.plist → TouchDB-Info.plist}
  40. +15 −0 Source/TouchDB.exp
  41. +3 −3 Source/{ToyCouch.h → TouchDB.h}
  42. +2 −2 Source/{ToyCouchPrefix.h → TouchDBPrefix.h}
  43. +0 −14 Source/ToyCouch.exp
  44. +0 −23 Source/ToyDB_Internal.h
  45. +0 −21 Source/ToyProtocol.h
  46. +3 −3 Tests/ToyCouchTests.h
  47. +5 −5 Tests/ToyCouchTests.m
  48. +181 −183 {ToyCouch.xcodeproj → TouchDB.xcodeproj}/project.pbxproj
  49. +1 −1 {ToyCouch.xcodeproj → TouchDB.xcodeproj}/project.xcworkspace/contents.xcworkspacedata
  50. +12 −12 ...reddata/xcschemes/ToyCouch Demo.xcscheme → TouchDB.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme
  51. +6 −6 {ToyCouch.xcodeproj → TouchDB.xcodeproj}/xcshareddata/xcschemes/Framework.xcscheme
View
@@ -14,7 +14,7 @@
// and limitations under the License.
#import <Cocoa/Cocoa.h>
-@class CouchDatabase, CouchReplication, DemoQuery, ToyPuller, ToyPusher;
+@class CouchDatabase, CouchReplication, DemoQuery, TDPuller, TDPusher;
/** Generic application delegate for simple Mac OS CouchDB demo apps.
@@ -31,8 +31,8 @@
CouchReplication *_pull, *_push;
BOOL _glowing;
- ToyPuller* _puller;
- ToyPusher* _pusher;
+ TDPuller* _puller;
+ TDPusher* _pusher;
}
@property (retain) DemoQuery* query;
View
@@ -16,11 +16,11 @@
#import "DemoAppController.h"
#import "DemoQuery.h"
#import "Test.h"
-#import "ToyDB.h"
-#import "ToyServer.h"
-#import "ToyProtocol.h"
-#import "ToyPuller.h"
-#import "ToyPusher.h"
+#import "TDDatabase.h"
+#import "TDServer.h"
+#import "TDURLProtocol.h"
+#import "TDPuller.h"
+#import "TDPusher.h"
#import <CouchCocoa/CouchCocoa.h>
@@ -53,11 +53,11 @@ - (void) applicationDidFinishLaunching: (NSNotification*)n {
#if 0
CouchServer *server = [[CouchServer alloc] init];
#else
- ToyServer* toyServer = [[ToyServer alloc] initWithDirectory: @"/tmp/ShoppingDemo" error: nil];
- NSAssert(toyServer, @"Couldn't create ToyServer");
- [ToyProtocol setServer: toyServer];
- [toyServer release];
- NSURL* url = [NSURL URLWithString: @"toy:///"];
+ TDServer* tdServer = [[TDServer alloc] initWithDirectory: @"/tmp/ShoppingDemo" error: nil];
+ NSAssert(tdServer, @"Couldn't create TDServer");
+ [TDURLProtocol setServer: tdServer];
+ [tdServer release];
+ NSURL* url = [NSURL URLWithString: @"touchdb:///"];
CouchServer *server = [[CouchServer alloc] initWithURL: url];
#endif
_database = [[server databaseNamed: dbName] retain];
@@ -82,9 +82,9 @@ - (void) applicationDidFinishLaunching: (NSNotification*)n {
- (void) startContinuousSyncWith: (NSURL*)otherDbURL {
#if 1
- ToyDB* db = [[ToyProtocol server] databaseNamed: _database.relativePath];
- _puller = [[ToyPuller alloc] initWithDB: db remote: otherDbURL continuous: NO];
- _pusher = [[ToyPusher alloc] initWithDB: db remote: otherDbURL continuous: NO];
+ TDDatabase* db = [[TDURLProtocol server] databaseNamed: _database.relativePath];
+ _puller = [[TDPuller alloc] initWithDB: db remote: otherDbURL continuous: NO];
+ _pusher = [[TDPusher alloc] initWithDB: db remote: otherDbURL continuous: NO];
#else
_pull = [[_database pullFromDatabaseAtURL: otherDbURL
options: kCouchReplicationContinuous] retain];
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>com.couchbase.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
View
@@ -1,4 +1,4 @@
-# ToyCouch #
+# TouchDB #
by Jens Alfke (jens@couchbase.com)
@@ -1,6 +1,6 @@
//
// TDBase64.h
-// ToyDB
+// TouchDB
//
// Created by Jens Alfke on 9/14/11.
// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
@@ -1,6 +1,6 @@
//
// TDBase64.m
-// ToyDB
+// TouchDB
//
// Created by Jens Alfke on 9/14/11.
// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
@@ -1,6 +1,6 @@
//
// TDChangeTracker.h
-// ToyDB
+// TouchDB
//
// Created by Jens Alfke on 6/20/11.
// Copyright 2011 Couchbase, Inc.
@@ -1,6 +1,6 @@
//
// TDChangeTracker.m
-// ToyDB
+// TouchDB
//
// Created by Jens Alfke on 6/20/11.
// Copyright 2011 Couchbase, Inc.
@@ -1,6 +1,6 @@
//
// TDConnectionChangeTracker.h
-// ToyDB
+// TouchDB
//
// Created by Jens Alfke on 12/1/11.
// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
@@ -1,6 +1,6 @@
//
// TDSocketChangeTracker.h
-// ToyDB
+// TouchDB
//
// Created by Jens Alfke on 12/2/11.
// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
@@ -1,6 +1,6 @@
//
// TDSocketChangeTracker.m
-// ToyDB
+// TouchDB
//
// Created by Jens Alfke on 12/2/11.
// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
@@ -135,7 +135,7 @@ - (BOOL) readLine {
[self stop];
return NO;
}
- if (_inputBuffer.length < lineLength + 2 + chunkLength)
+ if (_inputBuffer.length < (size_t)lineLength + 2 + chunkLength)
return NO; // Don't read the chunk till it's complete
NSData* chunk = [_inputBuffer subdataWithRange: NSMakeRange(lineLength + 2,
@@ -1,6 +1,6 @@
//
-// ToyBody.h
-// ToyCouch
+// TDBody.h
+// TouchDB
//
// Created by Jens Alfke on 6/19/10.
// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
@@ -10,7 +10,7 @@
/** A request/response/document body, stored as either JSON or an NSDictionary. */
-@interface ToyBody : NSObject
+@interface TDBody : NSObject
{
@private
NSData* _json;
@@ -22,8 +22,8 @@
- (id) initWithArray: (NSArray*)array;
- (id) initWithJSON: (NSData*)json;
-+ (ToyBody*) bodyWithProperties: (id)properties;
-+ (ToyBody*) bodyWithJSON: (NSData*)json;
++ (TDBody*) bodyWithProperties: (id)properties;
++ (TDBody*) bodyWithJSON: (NSData*)json;
@property (readonly) NSData* asJSON;
@property (readonly) id asObject;
@@ -1,15 +1,15 @@
//
-// ToyBody.m
-// ToyCouch
+// TDBody.m
+// TouchDB
//
// Created by Jens Alfke on 6/19/10.
// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
//
-#import "ToyBody.h"
+#import "TDBody.h"
-@implementation ToyBody
+@implementation TDBody
- (id) initWithProperties: (NSDictionary*)properties {
NSParameterAssert(properties);
@@ -38,10 +38,10 @@ - (void)dealloc {
[super dealloc];
}
-+ (ToyBody*) bodyWithProperties: (NSDictionary*)properties {
++ (TDBody*) bodyWithProperties: (NSDictionary*)properties {
return [[[self alloc] initWithProperties: properties] autorelease];
}
-+ (ToyBody*) bodyWithJSON: (NSData*)json {
++ (TDBody*) bodyWithJSON: (NSData*)json {
return [[[self alloc] initWithJSON: json] autorelease];
}
@@ -1,6 +1,6 @@
//
-// ToyCollator.h
-// ToyCouch
+// TDCollator.h
+// TouchDB
//
// Created by Jens Alfke on 12/8/11.
// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
@@ -12,6 +12,6 @@
Compares them according to CouchDB's collation rules.
WARNING: This function *only* works on valid JSON with no whitespace.
If called on non-JSON strings it is quite likely to crash! */
-int ToyCollate(void *context,
+int TDCollateJSON(void *context,
int len1, const void * chars1,
int len2, const void * chars2);
@@ -1,13 +1,13 @@
//
-// ToyCollator.m
-// ToyCouch
+// TDCollator.m
+// TouchDB
//
// Created by Jens Alfke on 12/8/11.
// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
//
// http://wiki.apache.org/couchdb/View_collation#Collation_Specification
-#import "ToyCollate.h"
+#import "TDCollateJSON.h"
static int cmp(int n1, int n2) {
@@ -93,7 +93,7 @@ static int compareStrings(const char** in1, const char** in2) {
}
-int ToyCollate(void *context,
+int TDCollateJSON(void *context,
int len1, const void * chars1,
int len2, const void * chars2)
{
@@ -160,32 +160,32 @@ int ToyCollate(void *context,
#if DEBUG
-TestCase(ToyCollateScalars) {
- CAssertEq(ToyCollate(NULL, 0, "true", 0, "false"), 1);
- CAssertEq(ToyCollate(NULL, 0, "false", 0, "true"), -1);
- CAssertEq(ToyCollate(NULL, 0, "null", 0, "17"), -1);
- CAssertEq(ToyCollate(NULL, 0, "123", 0, "1"), 1);
- CAssertEq(ToyCollate(NULL, 0, "123", 0, "0123.0"), 0);
- CAssertEq(ToyCollate(NULL, 0, "123", 0, "\"123\""), -1);
- CAssertEq(ToyCollate(NULL, 0, "\"1234\"", 0, "\"123\""), 1);
- CAssertEq(ToyCollate(NULL, 0, "\"1234\"", 0, "\"1235\""), -1);
- CAssertEq(ToyCollate(NULL, 0, "\"1234\"", 0, "\"1234\""), 0);
- CAssertEq(ToyCollate(NULL, 0, "\"12\"34\"", 0, "\"1234\""), -1);
+TestCase(TDCollateScalars) {
+ CAssertEq(TDCollateJSON(NULL, 0, "true", 0, "false"), 1);
+ CAssertEq(TDCollateJSON(NULL, 0, "false", 0, "true"), -1);
+ CAssertEq(TDCollateJSON(NULL, 0, "null", 0, "17"), -1);
+ CAssertEq(TDCollateJSON(NULL, 0, "123", 0, "1"), 1);
+ CAssertEq(TDCollateJSON(NULL, 0, "123", 0, "0123.0"), 0);
+ CAssertEq(TDCollateJSON(NULL, 0, "123", 0, "\"123\""), -1);
+ CAssertEq(TDCollateJSON(NULL, 0, "\"1234\"", 0, "\"123\""), 1);
+ CAssertEq(TDCollateJSON(NULL, 0, "\"1234\"", 0, "\"1235\""), -1);
+ CAssertEq(TDCollateJSON(NULL, 0, "\"1234\"", 0, "\"1234\""), 0);
+ CAssertEq(TDCollateJSON(NULL, 0, "\"12\"34\"", 0, "\"1234\""), -1);
}
-TestCase(ToyCollateArrays) {
- CAssertEq(ToyCollate(NULL, 0, "[]", 0, "\"foo\""), 1);
- CAssertEq(ToyCollate(NULL, 0, "[]", 0, "[]"), 0);
- CAssertEq(ToyCollate(NULL, 0, "[true]", 0, "[true]"), 0);
- CAssertEq(ToyCollate(NULL, 0, "[false]", 0, "[null]"), 1);
- CAssertEq(ToyCollate(NULL, 0, "[]", 0, "[null]"), -1);
- CAssertEq(ToyCollate(NULL, 0, "[123]", 0, "[45]"), 1);
- CAssertEq(ToyCollate(NULL, 0, "[123]", 0, "[45,67]"), 1);
- CAssertEq(ToyCollate(NULL, 0, "[123.4,\"wow\"]", 0, "[123.40,789]"), 1);
+TestCase(TDCollateArrays) {
+ CAssertEq(TDCollateJSON(NULL, 0, "[]", 0, "\"foo\""), 1);
+ CAssertEq(TDCollateJSON(NULL, 0, "[]", 0, "[]"), 0);
+ CAssertEq(TDCollateJSON(NULL, 0, "[true]", 0, "[true]"), 0);
+ CAssertEq(TDCollateJSON(NULL, 0, "[false]", 0, "[null]"), 1);
+ CAssertEq(TDCollateJSON(NULL, 0, "[]", 0, "[null]"), -1);
+ CAssertEq(TDCollateJSON(NULL, 0, "[123]", 0, "[45]"), 1);
+ CAssertEq(TDCollateJSON(NULL, 0, "[123]", 0, "[45,67]"), 1);
+ CAssertEq(TDCollateJSON(NULL, 0, "[123.4,\"wow\"]", 0, "[123.40,789]"), 1);
}
-TestCase(ToyCollateNestedArrays) {
- CAssertEq(ToyCollate(NULL, 0, "[[]]", 0, "[]"), 1);
- CAssertEq(ToyCollate(NULL, 0, "[1,[2,3],4]", 0, "[1,[2,3.1],4,5,6]"), -1);
+TestCase(TDCollateNestedArrays) {
+ CAssertEq(TDCollateJSON(NULL, 0, "[[]]", 0, "[]"), 1);
+ CAssertEq(TDCollateJSON(NULL, 0, "[1,[2,3],4]", 0, "[1,[2,3.1],4,5,6]"), -1);
}
#endif
Oops, something went wrong.

0 comments on commit 9ae9ecf

Please sign in to comment.