Permalink
Browse files

Removed MGSScanner as it was not being instantiated and was an invali…

…d subclass of a class cluster.

Added a category nethod to check the bounds on NSScanner location.
  • Loading branch information...
1 parent 5d0f55a commit 0c97a10f28f1719b2e42633ce86e92afefab0dc1 @mugginsoft committed Jan 13, 2012
@@ -16,7 +16,6 @@
AB257FE0129B1CE300A3FF76 /* MGSSyntaxController.h in Headers */ = {isa = PBXBuildFile; fileRef = AB3971C8118C1F8A00AEF388 /* MGSSyntaxController.h */; settings = {ATTRIBUTES = (Public, ); }; };
AB257FE1129B1CE300A3FF76 /* MGSPreferencesController.h in Headers */ = {isa = PBXBuildFile; fileRef = AB69B809118B8D0400903D1D /* MGSPreferencesController.h */; settings = {ATTRIBUTES = (Public, ); }; };
AB257FE2129B1CE300A3FF76 /* MGSFragariaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = ABD0FE581193543600E6AFE6 /* MGSFragariaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
- AB257FE3129B1CE300A3FF76 /* MGSScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDED9C1128AB4E0002EE039 /* MGSScanner.h */; settings = {ATTRIBUTES = (Public, ); }; };
AB257FE4129B1CE300A3FF76 /* MGSTextMenuController.h in Headers */ = {isa = PBXBuildFile; fileRef = AB472B7B1299732F00202CB5 /* MGSTextMenuController.h */; settings = {ATTRIBUTES = (Public, ); }; };
AB257FE5129B1CE300A3FF76 /* MGSExtraInterfaceController.h in Headers */ = {isa = PBXBuildFile; fileRef = AB472BF51299BBBA00202CB5 /* MGSExtraInterfaceController.h */; settings = {ATTRIBUTES = (Public, ); }; };
AB3971CB118C1F8A00AEF388 /* MGSSyntaxController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB3971C9118C1F8A00AEF388 /* MGSSyntaxController.m */; };
@@ -57,6 +56,8 @@
AB69B80C118B8D0400903D1D /* MGSPreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB69B80A118B8D0400903D1D /* MGSPreferencesController.m */; };
ABA812DC11B6855200A29990 /* LICENSE-2.0.txt in Resources */ = {isa = PBXBuildFile; fileRef = ABA812DB11B6855200A29990 /* LICENSE-2.0.txt */; };
ABD0FDB01193281600E6AFE6 /* MGSFragaria.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB69B62B118B745700903D1D /* MGSFragaria.framework */; };
+ ABF28AF014C075D400ECAD48 /* NSScanner+Fragaria.m in Sources */ = {isa = PBXBuildFile; fileRef = ABF28AEE14C075D400ECAD48 /* NSScanner+Fragaria.m */; };
+ ABF28AF114C075D400ECAD48 /* NSScanner+Fragaria.h in Headers */ = {isa = PBXBuildFile; fileRef = ABF28AEF14C075D400ECAD48 /* NSScanner+Fragaria.h */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -146,7 +147,7 @@
AB648E4D11FB3A5200AEF7BD /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MyDocument.xib; sourceTree = "<group>"; };
AB69B62B118B745700903D1D /* MGSFragaria.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MGSFragaria.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AB69B62C118B745700903D1D /* MGSFragaria-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MGSFragaria-Info.plist"; sourceTree = "<group>"; };
- AB69B65A118B75FB00903D1D /* SMLSyntaxColouring.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMLSyntaxColouring.m; sourceTree = "<group>"; };
+ AB69B65A118B75FB00903D1D /* SMLSyntaxColouring.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = SMLSyntaxColouring.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
AB69B662118B763A00903D1D /* SMLStandardHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMLStandardHeader.h; sourceTree = "<group>"; };
AB69B664118B766300903D1D /* SMLSyntaxColouring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMLSyntaxColouring.h; sourceTree = "<group>"; };
AB69B666118B768000903D1D /* SMLTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMLTextView.h; sourceTree = "<group>"; };
@@ -183,8 +184,8 @@
ABA812DB11B6855200A29990 /* LICENSE-2.0.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "LICENSE-2.0.txt"; sourceTree = "<group>"; };
ABD0FD7F119326FE00E6AFE6 /* MGSFragariaFramework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGSFragariaFramework.h; sourceTree = "<group>"; };
ABD0FE581193543600E6AFE6 /* MGSFragariaPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGSFragariaPreferences.h; sourceTree = "<group>"; };
- ABDED9C1128AB4E0002EE039 /* MGSScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGSScanner.h; sourceTree = "<group>"; };
- ABDED9C2128AB4E0002EE039 /* MGSScanner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGSScanner.m; sourceTree = "<group>"; };
+ ABF28AEE14C075D400ECAD48 /* NSScanner+Fragaria.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "NSScanner+Fragaria.m"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
+ ABF28AEF14C075D400ECAD48 /* NSScanner+Fragaria.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSScanner+Fragaria.h"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -433,10 +434,10 @@
ABDED9B6128AB144002EE039 /* Fragaria */ = {
isa = PBXGroup;
children = (
+ ABF28AEE14C075D400ECAD48 /* NSScanner+Fragaria.m */,
ABFBCC58119217F700F55626 /* Headers */,
AB3971C9118C1F8A00AEF388 /* MGSSyntaxController.m */,
AB41C1041191FFCB004F0CB5 /* MGSFragaria.m */,
- ABDED9C2128AB4E0002EE039 /* MGSScanner.m */,
AB69B80A118B8D0400903D1D /* MGSPreferencesController.m */,
AB472BF31299BBB100202CB5 /* MGSExtraInterfaceController.m */,
AB472B6E129972E400202CB5 /* MGSTextMenuController.m */,
@@ -465,12 +466,12 @@
ABFBCC58119217F700F55626 /* Headers */ = {
isa = PBXGroup;
children = (
+ ABF28AEF14C075D400ECAD48 /* NSScanner+Fragaria.h */,
AB69B753118B830700903D1D /* MGSFragaria.h */,
AB3971C8118C1F8A00AEF388 /* MGSSyntaxController.h */,
AB69B809118B8D0400903D1D /* MGSPreferencesController.h */,
ABD0FD7F119326FE00E6AFE6 /* MGSFragariaFramework.h */,
ABD0FE581193543600E6AFE6 /* MGSFragariaPreferences.h */,
- ABDED9C1128AB4E0002EE039 /* MGSScanner.h */,
AB472B7B1299732F00202CB5 /* MGSTextMenuController.h */,
AB472BF51299BBBA00202CB5 /* MGSExtraInterfaceController.h */,
);
@@ -487,11 +488,11 @@
AB257FE0129B1CE300A3FF76 /* MGSSyntaxController.h in Headers */,
AB257FE1129B1CE300A3FF76 /* MGSPreferencesController.h in Headers */,
AB257FE2129B1CE300A3FF76 /* MGSFragariaPreferences.h in Headers */,
- AB257FE3129B1CE300A3FF76 /* MGSScanner.h in Headers */,
AB257FE4129B1CE300A3FF76 /* MGSTextMenuController.h in Headers */,
AB257FE5129B1CE300A3FF76 /* MGSExtraInterfaceController.h in Headers */,
AB69B754118B830700903D1D /* MGSFragaria.h in Headers */,
AB257FCE129B1BF500A3FF76 /* SMLTextView.h in Headers */,
+ ABF28AF114C075D400ECAD48 /* NSScanner+Fragaria.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -661,6 +662,7 @@
AB472B9E12997B1F00202CB5 /* SMLBasicPerformer.m in Sources */,
AB472BE91299AF3800202CB5 /* SMLTextPerformer.m in Sources */,
AB472BF41299BBB100202CB5 /* MGSExtraInterfaceController.m in Sources */,
+ ABF28AF014C075D400ECAD48 /* NSScanner+Fragaria.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -22,5 +22,4 @@
#import "MGSPreferencesController.h"
#import "MGSSyntaxController.h"
#import "NSScanner+Fragaria.h"
-#import "MGSScanner.h"
#import "MGSFragariaPreferences.h"
View
@@ -1,16 +0,0 @@
-//
-// MGSTolerantScanner.h
-// Fragaria
-//
-// Created by Jonathan on 12/08/2010.
-// Copyright 2010 mugginsoft.com. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-
-
-@interface MGSScanner : NSScanner {
- NSUInteger maxIndex;
-}
-
-@end
View
@@ -1,42 +0,0 @@
-//
-// MGSScanner.m
-// Fragaria
-//
-// Created by Jonathan on 12/08/2010.
-// Copyright 2010 mugginsoft.com. All rights reserved.
-//
-
-#import "MGSScanner.h"
-
-@implementation MGSScanner
-
-/*
-
- - initWithString:
-
- */
-- (id)initWithString:(NSString *)aString
-{
- self = [super initWithString:aString];
- if (self) {
- maxIndex = [aString length] -1;
- }
-
- return self;
-}
-
-/*
-
- setScanLocation:
-
- */
-- (void)setScanLocation:(NSUInteger)idx
-{
- if (idx > maxIndex) {
- idx = maxIndex;
- }
-
- [super setScanLocation:idx];
-}
-
-@end
View
@@ -10,5 +10,5 @@
@interface NSScanner (Fragaria)
-
+- (void)mgs_setScanLocation:(NSUInteger)idx;
@end
View
@@ -11,4 +11,24 @@
@implementation NSScanner (Fragaria)
+/*
+
+ mgs_setScanLocation:
+
+ */
+- (void)mgs_setScanLocation:(NSUInteger)idx
+{
+ /*
+
+ NSScanner raises if the index is beyond the end of the string.
+
+ */
+ NSUInteger maxIndex = [[self string] length];
+ if (idx > maxIndex) {
+ NSLog(@"Invalid scan location %u > max of %u", idx, maxIndex);
+ idx = maxIndex;
+ }
+
+ [self setScanLocation:idx];
+}
@end
Oops, something went wrong.

0 comments on commit 0c97a10

Please sign in to comment.