IOSAD-172 NSString length is sufficient IOSAD-172
authorDirk Zimmermann <dz@pep.security>
Sat, 27 Jun 2020 11:33:18 +0200
branchIOSAD-172
changeset 1493ee822a02e4fc
parent 1492 f3f8dfd4e698
child 1494 bb73b3f4273c
IOSAD-172 NSString length is sufficient
pEpObjCAdapter.xcodeproj/project.pbxproj
pEpObjCAdapter/NSString+CodePoints.h
pEpObjCAdapter/NSString+CodePoints.m
     1.1 --- a/pEpObjCAdapter.xcodeproj/project.pbxproj	Sat Jun 27 11:28:19 2020 +0200
     1.2 +++ b/pEpObjCAdapter.xcodeproj/project.pbxproj	Sat Jun 27 11:33:18 2020 +0200
     1.3 @@ -28,8 +28,6 @@
     1.4  		433DFBB724A61D4B00AB373B /* PEPInternalSession+PassphraseCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 433DFBB524A61D4B00AB373B /* PEPInternalSession+PassphraseCache.h */; };
     1.5  		433DFBB824A61D4B00AB373B /* PEPInternalSession+PassphraseCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 433DFBB624A61D4B00AB373B /* PEPInternalSession+PassphraseCache.m */; };
     1.6  		433DFBBC24A73AD400AB373B /* PEPSessionProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 433DFBBB24A73AD400AB373B /* PEPSessionProtocol.m */; };
     1.7 -		433DFBBF24A744B100AB373B /* NSString+CodePoints.h in Headers */ = {isa = PBXBuildFile; fileRef = 433DFBBD24A744B100AB373B /* NSString+CodePoints.h */; };
     1.8 -		433DFBC024A744B100AB373B /* NSString+CodePoints.m in Sources */ = {isa = PBXBuildFile; fileRef = 433DFBBE24A744B100AB373B /* NSString+CodePoints.m */; };
     1.9  		434226811D4F60000083ED79 /* PepTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 434226801D4F60000083ED79 /* PepTests.m */; };
    1.10  		43589EF724A4A3B70079BEA2 /* PEPPassphraseCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 43589EF524A4A3B70079BEA2 /* PEPPassphraseCache.h */; };
    1.11  		43589EF924A4A3B70079BEA2 /* PEPPassphraseCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 43589EF624A4A3B70079BEA2 /* PEPPassphraseCache.m */; };
    1.12 @@ -181,8 +179,6 @@
    1.13  		433DFBB524A61D4B00AB373B /* PEPInternalSession+PassphraseCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PEPInternalSession+PassphraseCache.h"; sourceTree = "<group>"; };
    1.14  		433DFBB624A61D4B00AB373B /* PEPInternalSession+PassphraseCache.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "PEPInternalSession+PassphraseCache.m"; sourceTree = "<group>"; };
    1.15  		433DFBBB24A73AD400AB373B /* PEPSessionProtocol.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPSessionProtocol.m; sourceTree = "<group>"; };
    1.16 -		433DFBBD24A744B100AB373B /* NSString+CodePoints.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+CodePoints.h"; sourceTree = "<group>"; };
    1.17 -		433DFBBE24A744B100AB373B /* NSString+CodePoints.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+CodePoints.m"; sourceTree = "<group>"; };
    1.18  		433E28901FA741DE00E359B3 /* PEPIdentity.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPIdentity.m; sourceTree = "<group>"; };
    1.19  		434226801D4F60000083ED79 /* PepTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PepTests.m; sourceTree = "<group>"; };
    1.20  		434ED6D4207E27B8000A7590 /* PEPAutoPointer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPAutoPointer.h; sourceTree = "<group>"; };
    1.21 @@ -381,8 +377,6 @@
    1.22  				433DFBAB24A5E04000AB373B /* PEPPassphraseCacheEntry.m */,
    1.23  				433DFBB524A61D4B00AB373B /* PEPInternalSession+PassphraseCache.h */,
    1.24  				433DFBB624A61D4B00AB373B /* PEPInternalSession+PassphraseCache.m */,
    1.25 -				433DFBBD24A744B100AB373B /* NSString+CodePoints.h */,
    1.26 -				433DFBBE24A744B100AB373B /* NSString+CodePoints.m */,
    1.27  			);
    1.28  			path = pEpObjCAdapter;
    1.29  			sourceTree = "<group>";
    1.30 @@ -464,7 +458,6 @@
    1.31  				433DFBAC24A5E04000AB373B /* PEPPassphraseCacheEntry.h in Headers */,
    1.32  				435F5164222045FB006EB11F /* PEPIdentity.h in Headers */,
    1.33  				43AD0E3022E99ECE00D46F56 /* PEPInternalConstants.h in Headers */,
    1.34 -				433DFBBF24A744B100AB373B /* NSString+CodePoints.h in Headers */,
    1.35  				430CD9B62292ADAC00AAC37F /* PEPSendMessageDelegate.h in Headers */,
    1.36  				43E3985F221D7E56008E7983 /* PEPObjCAdapterFramework.h in Headers */,
    1.37  				435C0C8C22291FFB0025C6B5 /* PEPSession.h in Headers */,
    1.38 @@ -675,7 +668,6 @@
    1.39  				435F517D222046C2006EB11F /* PEPSync.m in Sources */,
    1.40  				435F516D222046C2006EB11F /* PEPQueue.m in Sources */,
    1.41  				43AD0E3122E99ECE00D46F56 /* PEPInternalConstants.m in Sources */,
    1.42 -				433DFBC024A744B100AB373B /* NSString+CodePoints.m in Sources */,
    1.43  			);
    1.44  			runOnlyForDeploymentPostprocessing = 0;
    1.45  		};
     2.1 --- a/pEpObjCAdapter/NSString+CodePoints.h	Sat Jun 27 11:28:19 2020 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,21 +0,0 @@
     2.4 -//
     2.5 -//  NSString+CodePoints.h
     2.6 -//  PEPObjCAdapterFramework
     2.7 -//
     2.8 -//  Created by Dirk Zimmermann on 27.06.20.
     2.9 -//  Copyright © 2020 p≡p. All rights reserved.
    2.10 -//
    2.11 -
    2.12 -#import <Foundation/Foundation.h>
    2.13 -
    2.14 -NS_ASSUME_NONNULL_BEGIN
    2.15 -
    2.16 -@interface NSString (CodePoints)
    2.17 -
    2.18 -/// The number of unicode code-points in this string.
    2.19 -/// - Note: The caller is responsible for doing any normalization before this call.
    2.20 -- (NSUInteger)numberOfCodePoints;
    2.21 -
    2.22 -@end
    2.23 -
    2.24 -NS_ASSUME_NONNULL_END
     3.1 --- a/pEpObjCAdapter/NSString+CodePoints.m	Sat Jun 27 11:28:19 2020 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,18 +0,0 @@
     3.4 -//
     3.5 -//  NSString+CodePoints.m
     3.6 -//  PEPObjCAdapterFramework
     3.7 -//
     3.8 -//  Created by Dirk Zimmermann on 27.06.20.
     3.9 -//  Copyright © 2020 p≡p. All rights reserved.
    3.10 -//
    3.11 -
    3.12 -#import "NSString+CodePoints.h"
    3.13 -
    3.14 -@implementation NSString (CodePoints)
    3.15 -
    3.16 -- (NSUInteger)numberOfCodePoints
    3.17 -{
    3.18 -    return [self lengthOfBytesUsingEncoding:NSUTF32StringEncoding] / 4;
    3.19 -}
    3.20 -
    3.21 -@end