Skip to content

Commit

Permalink
renaming JSON classes to be frank specific
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnolen committed Aug 28, 2012
1 parent 13534c6 commit 465366f
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 135 deletions.
129 changes: 49 additions & 80 deletions Frank.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file modified gem/frank-skeleton/libCocoaHTTPServer.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libFrank.a
Binary file not shown.
Binary file modified gem/frank-skeleton/libShelley.a
Binary file not shown.
17 changes: 7 additions & 10 deletions lib/JSON/SBJSON.h → lib/JSON/Franks_SBJSON.h
Expand Up @@ -28,22 +28,19 @@
*/

#import <Foundation/Foundation.h>
#import "SBJsonParser.h"
#import "SBJsonWriter.h"

@class Franks_SBJSON;
@compatibility_alias SBJSON Franks_SBJSON;
#import "Franks_SBJsonParser.h"
#import "Franks_SBJsonWriter.h"

/**
@brief Facade for SBJsonWriter/SBJsonParser.
@brief Facade for Franks_SBJsonWriter/Franks_SBJsonParser.
Requests are forwarded to instances of SBJsonWriter and SBJsonParser.
Requests are forwarded to instances of Franks_SBJsonWriter and Franks_SBJsonParser.
*/
@interface SBJSON : SBJsonBase <SBJsonParser, SBJsonWriter> {
@interface Franks_SBJSON : Franks_SBJsonBase <Franks_SBJsonParser, Franks_SBJsonWriter> {

@private
SBJsonParser *jsonParser;
SBJsonWriter *jsonWriter;
Franks_SBJsonParser *jsonParser;
Franks_SBJsonWriter *jsonWriter;
}


Expand Down
8 changes: 4 additions & 4 deletions lib/JSON/SBJSON.m → lib/JSON/Franks_SBJSON.m
Expand Up @@ -27,15 +27,15 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#import "SBJSON.h"
#import "Franks_SBJSON.h"

@implementation SBJSON
@implementation Franks_SBJSON

- (id)init {
self = [super init];
if (self) {
jsonWriter = [SBJsonWriter new];
jsonParser = [SBJsonParser new];
jsonWriter = [Franks_SBJsonWriter new];
jsonParser = [Franks_SBJsonParser new];
[self setMaxDepth:512];

}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions lib/JSON/SBJsonBase.m → lib/JSON/Franks_SBJsonBase.m
Expand Up @@ -27,11 +27,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#import "SBJsonBase.h"
#import "Franks_SBJsonBase.h"
NSString * SBJSONErrorDomain = @"org.brautaset.JSON.ErrorDomain";


@implementation SBJsonBase
@implementation Franks_SBJsonBase

@synthesize errorTrace;
@synthesize maxDepth;
Expand Down
12 changes: 4 additions & 8 deletions lib/JSON/SBJsonParser.h → lib/JSON/Franks_SBJsonParser.h
Expand Up @@ -28,14 +28,14 @@
*/

#import <Foundation/Foundation.h>
#import "SBJsonBase.h"
#import "Franks_SBJsonBase.h"

/**
@brief Options for the parser class.
This exists so the SBJSON facade can implement the options in the parser without having to re-declare them.
*/
@protocol SBJsonParser
@protocol Franks_SBJsonParser

/**
@brief Return the object represented by the given string.
Expand All @@ -49,10 +49,6 @@

@end

@class Franks_SBJsonParser;
@compatibility_alias SBJsonParser Franks_SBJsonParser;



/**
@brief The JSON parser class.
Expand All @@ -75,7 +71,7 @@
as we can thus avoid any loss of precision. (JSON allows ridiculously large numbers.)
*/
@interface SBJsonParser : SBJsonBase <SBJsonParser> {
@interface Franks_SBJsonParser : Franks_SBJsonBase <Franks_SBJsonParser> {

@private
const char *c;
Expand All @@ -84,7 +80,7 @@
@end

// don't use - exists for backwards compatibility with 2.1.x only. Will be removed in 2.3.
@interface SBJsonParser (Private)
@interface Franks_SBJsonParser (Private)
- (id)fragmentWithString:(id)repr;
@end

Expand Down
6 changes: 3 additions & 3 deletions lib/JSON/SBJsonParser.m → lib/JSON/Franks_SBJsonParser.m
Expand Up @@ -27,9 +27,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#import "SBJsonParser.h"
#import "Franks_SBJsonParser.h"

@interface SBJsonParser ()
@interface Franks_SBJsonParser ()

- (BOOL)scanValue:(NSObject **)o;

Expand All @@ -54,7 +54,7 @@ - (BOOL)scanIsAtEnd;
#define skipDigits(c) while (isdigit(*c)) c++


@implementation SBJsonParser
@implementation Franks_SBJsonParser

static char ctrl[0x22];

Expand Down
14 changes: 5 additions & 9 deletions lib/JSON/SBJsonWriter.h → lib/JSON/Franks_SBJsonWriter.h
Expand Up @@ -28,14 +28,14 @@
*/

#import <Foundation/Foundation.h>
#import "SBJsonBase.h"
#import "Franks_SBJsonBase.h"

/**
@brief Options for the writer class.
This exists so the SBJSON facade can implement the options in the writer without having to re-declare them.
This exists so the Franks_SBJSON facade can implement the options in the writer without having to re-declare them.
*/
@protocol SBJsonWriter
@protocol Franks_SBJsonWriter

/**
@brief Whether we are generating human-readable (multiline) JSON.
Expand Down Expand Up @@ -68,10 +68,6 @@

@end

@class Franks_SBJsonWriter;
@compatibility_alias SBJsonWriter Franks_SBJsonWriter;



/**
@brief The JSON writer class.
Expand All @@ -95,7 +91,7 @@
way you would expect.
*/
@interface SBJsonWriter : SBJsonBase <SBJsonWriter> {
@interface Franks_SBJsonWriter : Franks_SBJsonBase <Franks_SBJsonWriter> {

@private
BOOL sortKeys, humanReadable;
Expand All @@ -104,7 +100,7 @@
@end

// don't use - exists for backwards compatibility. Will be removed in 2.3.
@interface SBJsonWriter (Private)
@interface Franks_SBJsonWriter (Private)
- (NSString*)stringWithFragment:(id)value;
@end

Expand Down
6 changes: 3 additions & 3 deletions lib/JSON/SBJsonWriter.m → lib/JSON/Franks_SBJsonWriter.m
Expand Up @@ -27,9 +27,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#import "SBJsonWriter.h"
#import "Franks_SBJsonWriter.h"

@interface SBJsonWriter ()
@interface Franks_SBJsonWriter ()

- (BOOL)appendValue:(id)fragment into:(NSMutableString*)json;
- (BOOL)appendArray:(NSArray*)fragment into:(NSMutableString*)json;
Expand All @@ -40,7 +40,7 @@ - (NSString*)indent;

@end

@implementation SBJsonWriter
@implementation Franks_SBJsonWriter

static NSMutableCharacterSet *kEscapeChars;

Expand Down
6 changes: 3 additions & 3 deletions lib/JSON/JSON.h
Expand Up @@ -44,7 +44,7 @@
*/

#import "SBJSON.h"
#import "NSObject+SBJSON.h"
#import "NSString+SBJSON.h"
#import "Franks_SBJSON.h"
#import "NSObject+Franks_SBJSON.h"
#import "NSString+Franks_SBJSON.h"

Expand Up @@ -37,7 +37,7 @@
of standard objects to the objects themselves. This means you can call the
-JSONRepresentation method on an NSArray object and it'll do what you want.
*/
@interface NSObject (NSObject_SBJSON)
@interface NSObject (NSObject_Franks_SBJSON)

/**
@brief Returns a string containing the receiver encoded as a JSON fragment.
Expand Down
10 changes: 5 additions & 5 deletions lib/JSON/NSObject+SBJSON.m → lib/JSON/NSObject+Franks_SBJSON.m
Expand Up @@ -27,13 +27,13 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#import "NSObject+SBJSON.h"
#import "SBJsonWriter.h"
#import "NSObject+Franks_SBJSON.h"
#import "Franks_SBJsonWriter.h"

@implementation NSObject (NSObject_SBJSON)
@implementation NSObject (NSObject_Franks_SBJSON)

- (NSString *)JSONFragment {
SBJsonWriter *jsonWriter = [SBJsonWriter new];
Franks_SBJsonWriter *jsonWriter = [Franks_SBJsonWriter new];
NSString *json = [jsonWriter stringWithFragment:self];
if (!json)
NSLog(@"-JSONFragment failed. Error trace is: %@", [jsonWriter errorTrace]);
Expand All @@ -42,7 +42,7 @@ - (NSString *)JSONFragment {
}

- (NSString *)JSONRepresentation {
SBJsonWriter *jsonWriter = [SBJsonWriter new];
Franks_SBJsonWriter *jsonWriter = [Franks_SBJsonWriter new];
NSString *json = [jsonWriter stringWithObject:self];
if (!json)
NSLog(@"-JSONRepresentation failed. Error trace is: %@", [jsonWriter errorTrace]);
Expand Down
Expand Up @@ -34,7 +34,7 @@
This is a category on NSString that adds methods for parsing the target string.
*/
@interface NSString (NSString_SBJSON)
@interface NSString (NSString_Franks_SBJSON)


/**
Expand Down
10 changes: 5 additions & 5 deletions lib/JSON/NSString+SBJSON.m → lib/JSON/NSString+Franks_SBJSON.m
Expand Up @@ -27,14 +27,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#import "NSString+SBJSON.h"
#import "SBJsonParser.h"
#import "NSString+Franks_SBJSON.h"
#import "Franks_SBJsonParser.h"

@implementation NSString (NSString_SBJSON)
@implementation NSString (NSString_Franks_SBJSON)

- (id)JSONFragmentValue
{
SBJsonParser *jsonParser = [SBJsonParser new];
Franks_SBJsonParser *jsonParser = [Franks_SBJsonParser new];
id repr = [jsonParser fragmentWithString:self];
if (!repr)
NSLog(@"-JSONFragmentValue failed. Error trace is: %@", [jsonParser errorTrace]);
Expand All @@ -44,7 +44,7 @@ - (id)JSONFragmentValue

- (id)JSONValue
{
SBJsonParser *jsonParser = [SBJsonParser new];
Franks_SBJsonParser *jsonParser = [Franks_SBJsonParser new];
id repr = [jsonParser objectWithString:self];
if (!repr)
NSLog(@"-JSONValue failed. Error trace is: %@", [jsonParser errorTrace]);
Expand Down
2 changes: 1 addition & 1 deletion src/OrientationCommand.m
Expand Up @@ -7,7 +7,7 @@
//

#import "OrientationCommand.h"
#import "NSObject+SBJSON.h"
#import "NSObject+Franks_SBJSON.h"


@implementation OrientationCommand
Expand Down

0 comments on commit 465366f

Please sign in to comment.