Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

120 columns in helper classes

  • Loading branch information...
commit 74250108e1e04c1533c41e1fbaec978fea8c678e 1 parent 8dda596
@eofster authored
View
62 Classes/AKABAddressBook+Localizing.m
@@ -36,42 +36,32 @@
@implementation ABAddressBook (AKAddressBookLocalizingAdditions)
- (NSString *)ak_localizedLabel:(NSString *)label {
- NSString *theString;
-
- if ([label isEqualToString:kABPhoneWorkLabel]) {
- theString = NSLocalizedStringFromTable(@"work", @"AddressBookLabels",
- @"Work phone number.");
- } else if ([label isEqualToString:kABPhoneHomeLabel]) {
- theString = NSLocalizedStringFromTable(@"home", @"AddressBookLabels",
- @"Home phone number.");
- } else if ([label isEqualToString:kABPhoneMobileLabel]) {
- theString = NSLocalizedStringFromTable(@"mobile", @"AddressBookLabels",
- @"Mobile phone number.");
- } else if ([label isEqualToString:kABPhoneMainLabel]) {
- theString = NSLocalizedStringFromTable(@"main", @"AddressBookLabels",
- @"Main phone number.");
- } else if ([label isEqualToString:kABPhoneHomeFAXLabel]) {
- theString = NSLocalizedStringFromTable(@"home fax", @"AddressBookLabels",
- @"Home FAX number.");
- } else if ([label isEqualToString:kABPhoneWorkFAXLabel]) {
- theString = NSLocalizedStringFromTable(@"work fax", @"AddressBookLabels",
- @"Work FAX number.");
- } else if ([label isEqualToString:kABPhonePagerLabel]) {
- theString = NSLocalizedStringFromTable(@"pager", @"AddressBookLabels",
- @"Pager number.");
- } else if ([label isEqualToString:kABOtherLabel]) {
- theString = NSLocalizedStringFromTable(@"other", @"AddressBookLabels",
- @"Other number.");
- } else if ([label isEqualToString:@"sip"]) {
- theString = NSLocalizedStringFromTable(@"sip", @"AddressBookLabels",
- @"SIP address.");
- } else {
- CFStringRef localizedLabel
- = ABCopyLocalizedPropertyOrLabel((CFStringRef)label);
- theString = [(NSString *)localizedLabel autorelease];
- }
-
- return theString;
+ NSString *theString;
+
+ if ([label isEqualToString:kABPhoneWorkLabel]) {
+ theString = NSLocalizedStringFromTable(@"work", @"AddressBookLabels", @"Work phone number.");
+ } else if ([label isEqualToString:kABPhoneHomeLabel]) {
+ theString = NSLocalizedStringFromTable(@"home", @"AddressBookLabels", @"Home phone number.");
+ } else if ([label isEqualToString:kABPhoneMobileLabel]) {
+ theString = NSLocalizedStringFromTable(@"mobile", @"AddressBookLabels", @"Mobile phone number.");
+ } else if ([label isEqualToString:kABPhoneMainLabel]) {
+ theString = NSLocalizedStringFromTable(@"main", @"AddressBookLabels", @"Main phone number.");
+ } else if ([label isEqualToString:kABPhoneHomeFAXLabel]) {
+ theString = NSLocalizedStringFromTable(@"home fax", @"AddressBookLabels", @"Home FAX number.");
+ } else if ([label isEqualToString:kABPhoneWorkFAXLabel]) {
+ theString = NSLocalizedStringFromTable(@"work fax", @"AddressBookLabels", @"Work FAX number.");
+ } else if ([label isEqualToString:kABPhonePagerLabel]) {
+ theString = NSLocalizedStringFromTable(@"pager", @"AddressBookLabels", @"Pager number.");
+ } else if ([label isEqualToString:kABOtherLabel]) {
+ theString = NSLocalizedStringFromTable(@"other", @"AddressBookLabels", @"Other number.");
+ } else if ([label isEqualToString:@"sip"]) {
+ theString = NSLocalizedStringFromTable(@"sip", @"AddressBookLabels", @"SIP address.");
+ } else {
+ CFStringRef localizedLabel = ABCopyLocalizedPropertyOrLabel((CFStringRef)label);
+ theString = [(NSString *)localizedLabel autorelease];
+ }
+
+ return theString;
}
@end
View
54 Classes/AKABRecord+Querying.m
@@ -36,35 +36,35 @@ @implementation ABRecord (AKRecordQueryingAdditions)
@dynamic ak_fullName;
- (NSString *)ak_fullName {
- NSString *firstName = [self valueForProperty:kABFirstNameProperty];
- NSString *lastName = [self valueForProperty:kABLastNameProperty];
- NSString *company = [self valueForProperty:kABOrganizationProperty];
- NSInteger personFlags = [[self valueForProperty:kABPersonFlags] integerValue];
- BOOL isPerson = (personFlags & kABShowAsMask) == kABShowAsPerson;
- BOOL isCompany = (personFlags & kABShowAsMask) == kABShowAsCompany;
-
- ABAddressBook *AB = [ABAddressBook sharedAddressBook];
- NSString *theString = nil;
- if (isPerson) {
- if ([firstName length] > 0 && [lastName length] > 0) {
- if ([AB defaultNameOrdering] == kABFirstNameFirst) {
- theString = [NSString stringWithFormat:@"%@ %@", firstName, lastName];
- } else {
- theString = [NSString stringWithFormat:@"%@ %@", lastName, firstName];
- }
- } else if ([firstName length] > 0) {
- theString = firstName;
- } else if ([lastName length] > 0) {
- theString = lastName;
- }
+ NSString *firstName = [self valueForProperty:kABFirstNameProperty];
+ NSString *lastName = [self valueForProperty:kABLastNameProperty];
+ NSString *company = [self valueForProperty:kABOrganizationProperty];
+ NSInteger personFlags = [[self valueForProperty:kABPersonFlags] integerValue];
+ BOOL isPerson = (personFlags & kABShowAsMask) == kABShowAsPerson;
+ BOOL isCompany = (personFlags & kABShowAsMask) == kABShowAsCompany;
- } else if (isCompany) {
- if ([company length] > 0) {
- theString = company;
+ ABAddressBook *AB = [ABAddressBook sharedAddressBook];
+ NSString *theString = nil;
+ if (isPerson) {
+ if ([firstName length] > 0 && [lastName length] > 0) {
+ if ([AB defaultNameOrdering] == kABFirstNameFirst) {
+ theString = [NSString stringWithFormat:@"%@ %@", firstName, lastName];
+ } else {
+ theString = [NSString stringWithFormat:@"%@ %@", lastName, firstName];
+ }
+ } else if ([firstName length] > 0) {
+ theString = firstName;
+ } else if ([lastName length] > 0) {
+ theString = lastName;
+ }
+
+ } else if (isCompany) {
+ if ([company length] > 0) {
+ theString = company;
+ }
}
- }
-
- return theString;
+
+ return theString;
}
@end
View
10 Classes/AKNSString+Creating.m
@@ -32,11 +32,11 @@
@implementation NSString (AKStringCreatingAdditions)
+ (NSString *)ak_uuidString {
- CFUUIDRef theUUID = CFUUIDCreate(NULL);
- CFStringRef string = CFUUIDCreateString(NULL, theUUID);
- CFRelease(theUUID);
-
- return [(NSString *)string autorelease];
+ CFUUIDRef theUUID = CFUUIDCreate(NULL);
+ CFStringRef string = CFUUIDCreateString(NULL, theUUID);
+ CFRelease(theUUID);
+
+ return [(NSString *)string autorelease];
}
@end
View
10 Classes/AKNSString+Escaping.h
@@ -32,16 +32,14 @@
// A category for escaping strings.
@interface NSString (AKStringEscapingAdditions)
-// Returns a new string created from the receiver where every occurrence of the
-// first character from a given string is escaped with a backslash.
+// Returns a new string created from the receiver where every occurrence of the first character from a given string is
+// escaped with a backslash.
- (NSString *)ak_escapeFirstCharacterFromString:(NSString *)string;
-// Returns a new string created from the receiver where every quote character,
-// i.e. |"|, is escaped with a backslash.
+// Returns a new string created from the receiver where every quote character, i.e. |"|, is escaped with a backslash.
- (NSString *)ak_escapeQuotes;
-// Returns a new string created from the receiver where every parenthesis, i.e.
-// |(| or |)|, is escaped with a backslash.
+// Returns a new string created from the receiver where every parenthesis, i.e. |(| or |)|, is escaped with a backslash.
- (NSString *)ak_escapeParentheses;
@end
View
36 Classes/AKNSString+Escaping.m
@@ -32,32 +32,28 @@
@implementation NSString (AKStringEscapingAdditions)
- (NSString *)ak_escapeFirstCharacterFromString:(NSString *)string {
- NSMutableString *newString = [NSMutableString stringWithString:self];
- NSString *escapeCharacterString
- = [string substringWithRange:NSMakeRange(0, 1)];
- NSRange escapeCharacterRange
- = [newString rangeOfString:escapeCharacterString];
- while (escapeCharacterRange.location != NSNotFound) {
- [newString insertString:@"\\" atIndex:escapeCharacterRange.location];
- NSRange searchRange;
- searchRange.location = escapeCharacterRange.location + 2;
- searchRange.length = [newString length] - searchRange.location;
- escapeCharacterRange = [newString rangeOfString:escapeCharacterString
- options:0
- range:searchRange];
- }
-
- return [[newString copy] autorelease];
+ NSMutableString *newString = [NSMutableString stringWithString:self];
+ NSString *escapeCharacterString = [string substringWithRange:NSMakeRange(0, 1)];
+ NSRange escapeCharacterRange = [newString rangeOfString:escapeCharacterString];
+ while (escapeCharacterRange.location != NSNotFound) {
+ [newString insertString:@"\\" atIndex:escapeCharacterRange.location];
+ NSRange searchRange;
+ searchRange.location = escapeCharacterRange.location + 2;
+ searchRange.length = [newString length] - searchRange.location;
+ escapeCharacterRange = [newString rangeOfString:escapeCharacterString options:0 range:searchRange];
+ }
+
+ return [[newString copy] autorelease];
}
- (NSString *)ak_escapeQuotes {
- return [self ak_escapeFirstCharacterFromString:@"\""];
+ return [self ak_escapeFirstCharacterFromString:@"\""];
}
- (NSString *)ak_escapeParentheses {
- NSString *returnString = [self ak_escapeFirstCharacterFromString:@")"];
-
- return [returnString ak_escapeFirstCharacterFromString:@"("];
+ NSString *returnString = [self ak_escapeFirstCharacterFromString:@")"];
+
+ return [returnString ak_escapeFirstCharacterFromString:@"("];
}
@end
View
10 Classes/AKNSString+PJSUA.m
@@ -34,14 +34,14 @@
@implementation NSString (AKStringPJSUAAdditions)
+ (NSString *)stringWithPJString:(pj_str_t)pjString {
- return [[[NSString alloc] initWithBytes:pjString.ptr
- length:(NSUInteger)pjString.slen
- encoding:NSUTF8StringEncoding]
- autorelease];
+ return [[[NSString alloc] initWithBytes:pjString.ptr
+ length:(NSUInteger)pjString.slen
+ encoding:NSUTF8StringEncoding]
+ autorelease];
}
- (pj_str_t)pjString {
- return pj_str((char *)[self cStringUsingEncoding:NSUTF8StringEncoding]);
+ return pj_str((char *)[self cStringUsingEncoding:NSUTF8StringEncoding]);
}
@end
View
4 Classes/AKNSString+Scanning.h
@@ -34,8 +34,8 @@
// A category for scanning strings.
@interface NSString (AKStringScanningAdditions)
-// A Boolean value indicating whether the receiver is a telephone number, e.g.
-// it consists of contiguous digits with an optional leading plus character.
+// A Boolean value indicating whether the receiver is a telephone number, e.g. it consists of contiguous digits with
+// an optional leading plus character.
@property (nonatomic, readonly, assign) BOOL ak_isTelephoneNumber;
// A Boolean value indicating whether the receiver consists only of a-z or A-Z.
View
30 Classes/AKNSString+Scanning.m
@@ -38,28 +38,26 @@ @implementation NSString (AKStringScanningAdditions)
@dynamic ak_isIPAddress;
- (BOOL)ak_isTelephoneNumber {
- NSPredicate *telephoneNumberPredicate
- = [NSPredicate predicateWithFormat:@"SELF MATCHES '\\\\+?\\\\d+'"];
-
- return ([telephoneNumberPredicate evaluateWithObject:self]) ? YES : NO;
+ NSPredicate *telephoneNumberPredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES '\\\\+?\\\\d+'"];
+
+ return ([telephoneNumberPredicate evaluateWithObject:self]) ? YES : NO;
}
- (BOOL)ak_hasLetters {
- NSPredicate *containsLettersPredicate
- = [NSPredicate predicateWithFormat:@"SELF MATCHES '.*[a-zA-Z].*'"];
-
- return ([containsLettersPredicate evaluateWithObject:self]) ? YES : NO;
+ NSPredicate *containsLettersPredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES '.*[a-zA-Z].*'"];
+
+ return ([containsLettersPredicate evaluateWithObject:self]) ? YES : NO;
}
- (BOOL)ak_isIPAddress {
- NSPredicate *IPAddressPredicate
- = [NSPredicate predicateWithFormat:@"SELF MATCHES "
- "'\\\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\."
- "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\."
- "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\."
- "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\b'"];
-
- return ([IPAddressPredicate evaluateWithObject:self]) ? YES : NO;
+ NSPredicate *IPAddressPredicate
+ = [NSPredicate predicateWithFormat:@"SELF MATCHES "
+ "'\\\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\."
+ "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\."
+ "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\."
+ "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\b'"];
+
+ return ([IPAddressPredicate evaluateWithObject:self]) ? YES : NO;
}
@end
View
9 Classes/AKNSWindow+Resizing.h
@@ -34,13 +34,10 @@
// A category for window resizing.
@interface NSWindow (AKWindowResizingAdditions)
-// Sets |aView| content view for the receiver and resizes the receiver with
-// optional animation.
-- (void)ak_resizeAndSwapToContentView:(NSView *)aView
- animate:(BOOL)performAnimation;
+// Sets |aView| content view for the receiver and resizes the receiver with optional animation.
+- (void)ak_resizeAndSwapToContentView:(NSView *)aView animate:(BOOL)performAnimation;
-// Calls |ak_resizeAndSwapToContentView:animate:| with |performAnimation| set
-// to NO.
+// Calls |ak_resizeAndSwapToContentView:animate:| with |performAnimation| set to NO.
- (void)ak_resizeAndSwapToContentView:(NSView *)aView;
@end
View
49 Classes/AKNSWindow+Resizing.m
@@ -33,34 +33,33 @@
@implementation NSWindow (AKWindowResizingAdditions)
-- (void)ak_resizeAndSwapToContentView:(NSView *)aView
- animate:(BOOL)performAnimation {
- // Compute view size delta.
- NSSize currentSize = [[self contentView] frame].size;
- NSSize newSize = [aView frame].size;
- CGFloat deltaWidth = newSize.width - currentSize.width;
- CGFloat deltaHeight = newSize.height - currentSize.height;
-
- // Compute new window size.
- NSRect windowFrame = [self frame];
- windowFrame.size.height += deltaHeight;
- windowFrame.origin.y -= deltaHeight;
- windowFrame.size.width += deltaWidth;
-
- // Show temp view while changing views.
- NSView *tempView = [[NSView alloc] initWithFrame:[[self contentView] frame]];
- [self setContentView:tempView];
- [tempView release];
-
- // Set new window frame.
- [self setFrame:windowFrame display:YES animate:performAnimation];
-
- // Swap to the new view.
- [self setContentView:aView];
+- (void)ak_resizeAndSwapToContentView:(NSView *)aView animate:(BOOL)performAnimation {
+ // Compute view size delta.
+ NSSize currentSize = [[self contentView] frame].size;
+ NSSize newSize = [aView frame].size;
+ CGFloat deltaWidth = newSize.width - currentSize.width;
+ CGFloat deltaHeight = newSize.height - currentSize.height;
+
+ // Compute new window size.
+ NSRect windowFrame = [self frame];
+ windowFrame.size.height += deltaHeight;
+ windowFrame.origin.y -= deltaHeight;
+ windowFrame.size.width += deltaWidth;
+
+ // Show temp view while changing views.
+ NSView *tempView = [[NSView alloc] initWithFrame:[[self contentView] frame]];
+ [self setContentView:tempView];
+ [tempView release];
+
+ // Set new window frame.
+ [self setFrame:windowFrame display:YES animate:performAnimation];
+
+ // Swap to the new view.
+ [self setContentView:aView];
}
- (void)ak_resizeAndSwapToContentView:(NSView *)aView {
- [self ak_resizeAndSwapToContentView:aView animate:NO];
+ [self ak_resizeAndSwapToContentView:aView animate:NO];
}
@end
View
16 Classes/AKSIPURIFormatter.h
@@ -32,23 +32,21 @@
@class AKSIPURI;
-// Instances of AKSIPURIFormatter create string representations of AKSIPURI, and
-// convert textual representations of SIP URIs into AKSIPURI objects.
+// Instances of AKSIPURIFormatter create string representations of AKSIPURI, and convert textual representations of SIP
+// URIs into AKSIPURI objects.
@interface AKSIPURIFormatter : NSFormatter {
- @private
- BOOL formatsTelephoneNumbers_;
- BOOL telephoneNumberFormatterSplitsLastFourDigits_;
+ @private
+ BOOL formatsTelephoneNumbers_;
+ BOOL telephoneNumberFormatterSplitsLastFourDigits_;
}
// A Boolean value indicating whether the receiver formats telephone numbers.
@property (nonatomic, assign) BOOL formatsTelephoneNumbers;
-// A Boolean value indicating whether the receiver's telephone number formatter
-// splits last four digits.
+// A Boolean value indicating whether the receiver's telephone number formatter splits last four digits.
@property (nonatomic, assign) BOOL telephoneNumberFormatterSplitsLastFourDigits;
-// Wrapper for |getObjectValue:forString:errorDescription:|. Returns AKSIPURI
-// object converted from a given string.
+// Wrapper for |getObjectValue:forString:errorDescription:|. Returns AKSIPURI object converted from a given string.
- (AKSIPURI *)SIPURIFromString:(NSString *)SIPURIString;
@end
View
246 Classes/AKSIPURIFormatter.m
@@ -41,146 +41,134 @@ @implementation AKSIPURIFormatter
@synthesize telephoneNumberFormatterSplitsLastFourDigits = telephoneNumberFormatterSplitsLastFourDigits_;
- (NSString *)stringForObjectValue:(id)anObject {
- if (![anObject isKindOfClass:[AKSIPURI class]]) {
- return nil;
- }
-
- NSString *returnValue = nil;
-
- if ([[anObject displayName] length] > 0) {
- returnValue = [anObject displayName];
+ if (![anObject isKindOfClass:[AKSIPURI class]]) {
+ return nil;
+ }
- } else if ([[anObject user] length] > 0) {
- if ([[anObject user] ak_isTelephoneNumber]) {
- if ([self formatsTelephoneNumbers]) {
- AKTelephoneNumberFormatter *telephoneNumberFormatter
- = [[[AKTelephoneNumberFormatter alloc] init] autorelease];
-
- [telephoneNumberFormatter setSplitsLastFourDigits:
- [self telephoneNumberFormatterSplitsLastFourDigits]];
+ NSString *returnValue = nil;
+
+ if ([[anObject displayName] length] > 0) {
+ returnValue = [anObject displayName];
- returnValue = [telephoneNumberFormatter stringForObjectValue:
- [anObject user]];
- } else {
- returnValue = [anObject user];
- }
+ } else if ([[anObject user] length] > 0) {
+ if ([[anObject user] ak_isTelephoneNumber]) {
+ if ([self formatsTelephoneNumbers]) {
+ AKTelephoneNumberFormatter *telephoneNumberFormatter
+ = [[[AKTelephoneNumberFormatter alloc] init] autorelease];
+
+ [telephoneNumberFormatter setSplitsLastFourDigits:[self telephoneNumberFormatterSplitsLastFourDigits]];
+
+ returnValue = [telephoneNumberFormatter stringForObjectValue:[anObject user]];
+ } else {
+ returnValue = [anObject user];
+ }
+ } else {
+ returnValue = [anObject SIPAddress];
+ }
} else {
- returnValue = [anObject SIPAddress];
+ returnValue = [anObject host];
}
- } else {
- returnValue = [anObject host];
- }
-
- return returnValue;
+
+ return returnValue;
}
-- (BOOL)getObjectValue:(id *)anObject
- forString:(NSString *)string
- errorDescription:(NSString **)error {
-
- BOOL returnValue = NO;
- AKSIPURI *theURI;
- NSString *name, *destination, *user, *host;
- NSRange delimiterRange, atSignRange;
-
- theURI = [AKSIPURI SIPURIWithString:string];
-
- if (theURI == nil) {
- if ([[NSPredicate predicateWithFormat:@"SELF MATCHES '.+\\\\s\\\\(.+\\\\)'"]
- evaluateWithObject:string]) {
- // The string is in format |Destination (Display Name)|.
-
- delimiterRange = [string rangeOfString:@" (" options:NSBackwardsSearch];
-
- destination = [string substringToIndex:delimiterRange.location];
- atSignRange = [destination rangeOfString:@"@" options:NSBackwardsSearch];
- if (atSignRange.location == NSNotFound) {
- user = destination;
- host = nil;
- } else {
- user = [destination substringToIndex:atSignRange.location];
- host = [destination substringFromIndex:(atSignRange.location + 1)];
- }
-
- NSRange nameRange
- = NSMakeRange(delimiterRange.location + 2,
- [string length] - (delimiterRange.location + 2) - 1);
- name = [string substringWithRange:nameRange];
-
- theURI = [AKSIPURI SIPURIWithUser:user host:host displayName:name];
-
- } else if ([[NSPredicate predicateWithFormat:@"SELF MATCHES '.+\\\\s<.+>'"]
- evaluateWithObject:string]) {
- // The string is in format |Display Name <Destination>|.
-
- delimiterRange = [string rangeOfString:@" <" options:NSBackwardsSearch];
-
- NSMutableCharacterSet *trimmingCharacterSet
- = [[NSCharacterSet whitespaceCharacterSet] mutableCopy];
- [trimmingCharacterSet addCharactersInString:@"\""];
- name = [[string substringToIndex:delimiterRange.location]
- stringByTrimmingCharactersInSet:trimmingCharacterSet];
- [trimmingCharacterSet release];
-
- NSRange destinationRange
- = NSMakeRange(delimiterRange.location + 2,
- [string length] - (delimiterRange.location + 2) - 1);
- destination = [string substringWithRange:destinationRange];
-
- atSignRange = [destination rangeOfString:@"@" options:NSBackwardsSearch];
- if (atSignRange.location == NSNotFound) {
- user = destination;
- host = nil;
- } else {
- user = [destination substringToIndex:atSignRange.location];
- host = [destination substringFromIndex:(atSignRange.location + 1)];
- }
-
- theURI = [AKSIPURI SIPURIWithUser:user host:host displayName:name];
-
- } else {
- destination = string;
- atSignRange = [destination rangeOfString:@"@" options:NSBackwardsSearch];
- if (atSignRange.location == NSNotFound) {
- user = destination;
- host = nil;
- } else {
- user = [destination substringToIndex:atSignRange.location];
- host = [destination substringFromIndex:(atSignRange.location + 1)];
- }
-
- theURI = [AKSIPURI SIPURIWithUser:user host:host displayName:nil];
- }
- }
-
- if (theURI != nil) {
- returnValue = YES;
- if (anObject != NULL) {
- *anObject = theURI;
+- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error {
+ BOOL returnValue = NO;
+ AKSIPURI *theURI;
+ NSString *name, *destination, *user, *host;
+ NSRange delimiterRange, atSignRange;
+
+ theURI = [AKSIPURI SIPURIWithString:string];
+
+ if (theURI == nil) {
+ if ([[NSPredicate predicateWithFormat:@"SELF MATCHES '.+\\\\s\\\\(.+\\\\)'"] evaluateWithObject:string]) {
+ // The string is in format |Destination (Display Name)|.
+
+ delimiterRange = [string rangeOfString:@" (" options:NSBackwardsSearch];
+
+ destination = [string substringToIndex:delimiterRange.location];
+ atSignRange = [destination rangeOfString:@"@" options:NSBackwardsSearch];
+ if (atSignRange.location == NSNotFound) {
+ user = destination;
+ host = nil;
+ } else {
+ user = [destination substringToIndex:atSignRange.location];
+ host = [destination substringFromIndex:(atSignRange.location + 1)];
+ }
+
+ NSRange nameRange = NSMakeRange(delimiterRange.location + 2,
+ [string length] - (delimiterRange.location + 2) - 1);
+ name = [string substringWithRange:nameRange];
+
+ theURI = [AKSIPURI SIPURIWithUser:user host:host displayName:name];
+
+ } else if ([[NSPredicate predicateWithFormat:@"SELF MATCHES '.+\\\\s<.+>'"] evaluateWithObject:string]) {
+ // The string is in format |Display Name <Destination>|.
+
+ delimiterRange = [string rangeOfString:@" <" options:NSBackwardsSearch];
+
+ NSMutableCharacterSet *trimmingCharacterSet = [[NSCharacterSet whitespaceCharacterSet] mutableCopy];
+ [trimmingCharacterSet addCharactersInString:@"\""];
+ name = [[string substringToIndex:delimiterRange.location]
+ stringByTrimmingCharactersInSet:trimmingCharacterSet];
+ [trimmingCharacterSet release];
+
+ NSRange destinationRange = NSMakeRange(delimiterRange.location + 2,
+ [string length] - (delimiterRange.location + 2) - 1);
+ destination = [string substringWithRange:destinationRange];
+
+ atSignRange = [destination rangeOfString:@"@" options:NSBackwardsSearch];
+ if (atSignRange.location == NSNotFound) {
+ user = destination;
+ host = nil;
+ } else {
+ user = [destination substringToIndex:atSignRange.location];
+ host = [destination substringFromIndex:(atSignRange.location + 1)];
+ }
+
+ theURI = [AKSIPURI SIPURIWithUser:user host:host displayName:name];
+
+ } else {
+ destination = string;
+ atSignRange = [destination rangeOfString:@"@" options:NSBackwardsSearch];
+ if (atSignRange.location == NSNotFound) {
+ user = destination;
+ host = nil;
+ } else {
+ user = [destination substringToIndex:atSignRange.location];
+ host = [destination substringFromIndex:(atSignRange.location + 1)];
+ }
+
+ theURI = [AKSIPURI SIPURIWithUser:user host:host displayName:nil];
+ }
}
- } else {
- if (error != NULL) {
- *error = [NSString stringWithFormat:@"Couldn't convert \"%@\" to SIP URI",
- string];
+
+ if (theURI != nil) {
+ returnValue = YES;
+ if (anObject != NULL) {
+ *anObject = theURI;
+ }
+ } else {
+ if (error != NULL) {
+ *error = [NSString stringWithFormat:@"Couldn't convert \"%@\" to SIP URI", string];
+ }
}
- }
-
- return returnValue;
+
+ return returnValue;
}
- (AKSIPURI *)SIPURIFromString:(NSString *)SIPURIString {
- AKSIPURI *uri;
- NSString *error;
-
- BOOL converted
- = [self getObjectValue:&uri forString:SIPURIString errorDescription:&error];
-
- if (converted) {
- return uri;
- } else {
- NSLog(@"%@", error);
- return nil;
- }
+ AKSIPURI *uri;
+ NSString *error;
+
+ BOOL converted = [self getObjectValue:&uri forString:SIPURIString errorDescription:&error];
+
+ if (converted) {
+ return uri;
+ } else {
+ NSLog(@"%@", error);
+ return nil;
+ }
}
@end
View
18 Classes/AKTelephoneNumberFormatter.h
@@ -31,21 +31,19 @@
#import <Cocoa/Cocoa.h>
-// Instances of AKTelephoneNumberFormatter create formatted telephone numbers
-// from strings of contiguous digits, and convert strings with non-contiguous
-// digits to strings that consist of contiguous digits only.
+// Instances of AKTelephoneNumberFormatter create formatted telephone numbers from strings of contiguous digits, and
+// convert strings with non-contiguous digits to strings that consist of contiguous digits only.
@interface AKTelephoneNumberFormatter : NSFormatter {
- @private
- BOOL splitsLastFourDigits_;
+ @private
+ BOOL splitsLastFourDigits_;
}
-// A Boolean value that determines whether the receiver should separate last two
-// digits when formatting a telephone number.
-// When YES, |+11234567890| becomes |+1 (123) 456-78-90|.
+// A Boolean value that determines whether the receiver should separate last two digits when formatting a telephone
+// number. When YES, |+11234567890| becomes |+1 (123) 456-78-90|.
@property (nonatomic, assign) BOOL splitsLastFourDigits;
-// Wrapper for |getObjectValue:forString:errorDescription:|. Scans |string| for
-// numbers and returns them as a contiguous digits string.
+// Wrapper for |getObjectValue:forString:errorDescription:|. Scans |string| for numbers and returns them as a contiguous
+// digits string.
- (NSString *)telephoneNumberFromString:(NSString *)string;
@end
View
469 Classes/AKTelephoneNumberFormatter.m
@@ -36,256 +36,247 @@ @implementation AKTelephoneNumberFormatter
@synthesize splitsLastFourDigits = splitsLastFourDigits_;
- (NSString *)stringForObjectValue:(id)anObject {
- if (![anObject isKindOfClass:[NSString class]]) {
- return nil;
- }
-
- NSString *theString;
- NSUInteger length = [anObject length];
-
- if ([[NSPredicate predicateWithFormat:@"SELF MATCHES '\\\\d{6,15}'"]
- evaluateWithObject:anObject]) {
- switch (length) {
- case 6:
- if ([self splitsLastFourDigits]) { // ##-##-##
- theString = [NSString stringWithFormat:@"%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 2)],
- [anObject substringWithRange:NSMakeRange(2, 2)],
- [anObject substringWithRange:NSMakeRange(4, 2)]];
- } else { // ###-###
- theString = [NSString stringWithFormat:@"%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 3)],
- [anObject substringWithRange:NSMakeRange(3, 3)]];
- }
- break;
-
- case 7:
- if ([self splitsLastFourDigits]) { // ###-##-##
- theString = [NSString stringWithFormat:@"%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 3)],
- [anObject substringWithRange:NSMakeRange(3, 2)],
- [anObject substringWithRange:NSMakeRange(5, 2)]];
- } else { // ###-####
- theString = [NSString stringWithFormat:@"%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 3)],
- [anObject substringWithRange:NSMakeRange(3, 4)]];
- }
- break;
-
- case 8:
- if ([self splitsLastFourDigits]) { // #-###-##-##
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 1)],
- [anObject substringWithRange:NSMakeRange(1, 3)],
- [anObject substringWithRange:NSMakeRange(4, 2)],
- [anObject substringWithRange:NSMakeRange(6, 2)]];
- } else { // #-###-####
- theString = [NSString stringWithFormat:@"%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 1)],
- [anObject substringWithRange:NSMakeRange(1, 3)],
- [anObject substringWithRange:NSMakeRange(4, 4)]];
- }
- break;
-
- case 9:
- if ([self splitsLastFourDigits]) { // ##-###-##-##
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 2)],
- [anObject substringWithRange:NSMakeRange(2, 3)],
- [anObject substringWithRange:NSMakeRange(5, 2)],
- [anObject substringWithRange:NSMakeRange(7, 2)]];
- } else { // ##-###-####
- theString = [NSString stringWithFormat:@"%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 2)],
- [anObject substringWithRange:NSMakeRange(2, 3)],
- [anObject substringWithRange:NSMakeRange(5, 4)]];
- }
- break;
-
- case 10:
- if ([self splitsLastFourDigits]) { // ###-###-##-##
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 3)],
- [anObject substringWithRange:NSMakeRange(3, 3)],
- [anObject substringWithRange:NSMakeRange(6, 2)],
- [anObject substringWithRange:NSMakeRange(8, 2)]];
- } else { // ###-###-####
- theString = [NSString stringWithFormat:@"%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 3)],
- [anObject substringWithRange:NSMakeRange(3, 3)],
- [anObject substringWithRange:NSMakeRange(6, 4)]];
- }
- break;
-
- case 11:
- if ([self splitsLastFourDigits]) { // #-###-###-##-##
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 1)],
- [anObject substringWithRange:NSMakeRange(1, 3)],
- [anObject substringWithRange:NSMakeRange(4, 3)],
- [anObject substringWithRange:NSMakeRange(7, 2)],
- [anObject substringWithRange:NSMakeRange(9, 2)]];
- } else { // #-###-###-####
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 1)],
- [anObject substringWithRange:NSMakeRange(1, 3)],
- [anObject substringWithRange:NSMakeRange(4, 3)],
- [anObject substringWithRange:NSMakeRange(7, 4)]];
- }
- break;
-
- case 12:
- if ([self splitsLastFourDigits]) { // ##-###-###-##-##
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 2)],
- [anObject substringWithRange:NSMakeRange(2, 3)],
- [anObject substringWithRange:NSMakeRange(5, 3)],
- [anObject substringWithRange:NSMakeRange(8, 2)],
- [anObject substringWithRange:NSMakeRange(10, 2)]];
- } else { // ##-###-###-####
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 2)],
- [anObject substringWithRange:NSMakeRange(2, 3)],
- [anObject substringWithRange:NSMakeRange(5, 3)],
- [anObject substringWithRange:NSMakeRange(8, 4)]];
- }
- break;
-
- case 13:
- if ([self splitsLastFourDigits]) { // ###-###-###-##-##
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 3)],
- [anObject substringWithRange:NSMakeRange(3, 3)],
- [anObject substringWithRange:NSMakeRange(6, 3)],
- [anObject substringWithRange:NSMakeRange(9, 2)],
- [anObject substringWithRange:NSMakeRange(11, 2)]];
- } else { // ###-###-###-####
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 3)],
- [anObject substringWithRange:NSMakeRange(3, 3)],
- [anObject substringWithRange:NSMakeRange(6, 3)],
- [anObject substringWithRange:NSMakeRange(9, 4)]];
- }
- break;
-
- case 14:
- if ([self splitsLastFourDigits]) { // ####-###-###-##-##
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 4)],
- [anObject substringWithRange:NSMakeRange(4, 3)],
- [anObject substringWithRange:NSMakeRange(7, 3)],
- [anObject substringWithRange:NSMakeRange(10, 2)],
- [anObject substringWithRange:NSMakeRange(12, 2)]];
- } else { // ####-###-###-####
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 4)],
- [anObject substringWithRange:NSMakeRange(4, 3)],
- [anObject substringWithRange:NSMakeRange(7, 3)],
- [anObject substringWithRange:NSMakeRange(10, 4)]];
+ if (![anObject isKindOfClass:[NSString class]]) {
+ return nil;
+ }
+
+ NSString *theString;
+ NSUInteger length = [anObject length];
+
+ if ([[NSPredicate predicateWithFormat:@"SELF MATCHES '\\\\d{6,15}'"] evaluateWithObject:anObject]) {
+ switch (length) {
+ case 6:
+ if ([self splitsLastFourDigits]) { // ##-##-##
+ theString = [NSString stringWithFormat:@"%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 2)],
+ [anObject substringWithRange:NSMakeRange(2, 2)],
+ [anObject substringWithRange:NSMakeRange(4, 2)]];
+ } else { // ###-###
+ theString = [NSString stringWithFormat:@"%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 3)],
+ [anObject substringWithRange:NSMakeRange(3, 3)]];
+ }
+ break;
+
+ case 7:
+ if ([self splitsLastFourDigits]) { // ###-##-##
+ theString = [NSString stringWithFormat:@"%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 3)],
+ [anObject substringWithRange:NSMakeRange(3, 2)],
+ [anObject substringWithRange:NSMakeRange(5, 2)]];
+ } else { // ###-####
+ theString = [NSString stringWithFormat:@"%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 3)],
+ [anObject substringWithRange:NSMakeRange(3, 4)]];
+ }
+ break;
+
+ case 8:
+ if ([self splitsLastFourDigits]) { // #-###-##-##
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 1)],
+ [anObject substringWithRange:NSMakeRange(1, 3)],
+ [anObject substringWithRange:NSMakeRange(4, 2)],
+ [anObject substringWithRange:NSMakeRange(6, 2)]];
+ } else { // #-###-####
+ theString = [NSString stringWithFormat:@"%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 1)],
+ [anObject substringWithRange:NSMakeRange(1, 3)],
+ [anObject substringWithRange:NSMakeRange(4, 4)]];
+ }
+ break;
+
+ case 9:
+ if ([self splitsLastFourDigits]) { // ##-###-##-##
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 2)],
+ [anObject substringWithRange:NSMakeRange(2, 3)],
+ [anObject substringWithRange:NSMakeRange(5, 2)],
+ [anObject substringWithRange:NSMakeRange(7, 2)]];
+ } else { // ##-###-####
+ theString = [NSString stringWithFormat:@"%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 2)],
+ [anObject substringWithRange:NSMakeRange(2, 3)],
+ [anObject substringWithRange:NSMakeRange(5, 4)]];
+ }
+ break;
+
+ case 10:
+ if ([self splitsLastFourDigits]) { // ###-###-##-##
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 3)],
+ [anObject substringWithRange:NSMakeRange(3, 3)],
+ [anObject substringWithRange:NSMakeRange(6, 2)],
+ [anObject substringWithRange:NSMakeRange(8, 2)]];
+ } else { // ###-###-####
+ theString = [NSString stringWithFormat:@"%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 3)],
+ [anObject substringWithRange:NSMakeRange(3, 3)],
+ [anObject substringWithRange:NSMakeRange(6, 4)]];
+ }
+ break;
+
+ case 11:
+ if ([self splitsLastFourDigits]) { // #-###-###-##-##
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 1)],
+ [anObject substringWithRange:NSMakeRange(1, 3)],
+ [anObject substringWithRange:NSMakeRange(4, 3)],
+ [anObject substringWithRange:NSMakeRange(7, 2)],
+ [anObject substringWithRange:NSMakeRange(9, 2)]];
+ } else { // #-###-###-####
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 1)],
+ [anObject substringWithRange:NSMakeRange(1, 3)],
+ [anObject substringWithRange:NSMakeRange(4, 3)],
+ [anObject substringWithRange:NSMakeRange(7, 4)]];
+ }
+ break;
+
+ case 12:
+ if ([self splitsLastFourDigits]) { // ##-###-###-##-##
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 2)],
+ [anObject substringWithRange:NSMakeRange(2, 3)],
+ [anObject substringWithRange:NSMakeRange(5, 3)],
+ [anObject substringWithRange:NSMakeRange(8, 2)],
+ [anObject substringWithRange:NSMakeRange(10, 2)]];
+ } else { // ##-###-###-####
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 2)],
+ [anObject substringWithRange:NSMakeRange(2, 3)],
+ [anObject substringWithRange:NSMakeRange(5, 3)],
+ [anObject substringWithRange:NSMakeRange(8, 4)]];
+ }
+ break;
+
+ case 13:
+ if ([self splitsLastFourDigits]) { // ###-###-###-##-##
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 3)],
+ [anObject substringWithRange:NSMakeRange(3, 3)],
+ [anObject substringWithRange:NSMakeRange(6, 3)],
+ [anObject substringWithRange:NSMakeRange(9, 2)],
+ [anObject substringWithRange:NSMakeRange(11, 2)]];
+ } else { // ###-###-###-####
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 3)],
+ [anObject substringWithRange:NSMakeRange(3, 3)],
+ [anObject substringWithRange:NSMakeRange(6, 3)],
+ [anObject substringWithRange:NSMakeRange(9, 4)]];
+ }
+ break;
+
+ case 14:
+ if ([self splitsLastFourDigits]) { // ####-###-###-##-##
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 4)],
+ [anObject substringWithRange:NSMakeRange(4, 3)],
+ [anObject substringWithRange:NSMakeRange(7, 3)],
+ [anObject substringWithRange:NSMakeRange(10, 2)],
+ [anObject substringWithRange:NSMakeRange(12, 2)]];
+ } else { // ####-###-###-####
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 4)],
+ [anObject substringWithRange:NSMakeRange(4, 3)],
+ [anObject substringWithRange:NSMakeRange(7, 3)],
+ [anObject substringWithRange:NSMakeRange(10, 4)]];
+ }
+ break;
+
+ case 15:
+ if ([self splitsLastFourDigits]) { // #####-###-###-##-##
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 5)],
+ [anObject substringWithRange:NSMakeRange(5, 3)],
+ [anObject substringWithRange:NSMakeRange(8, 3)],
+ [anObject substringWithRange:NSMakeRange(11, 2)],
+ [anObject substringWithRange:NSMakeRange(13, 2)]];
+ } else { // #####-###-###-####
+ theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 5)],
+ [anObject substringWithRange:NSMakeRange(5, 3)],
+ [anObject substringWithRange:NSMakeRange(8, 3)],
+ [anObject substringWithRange:NSMakeRange(11, 4)]];
+ }
+ break;
+
+ default:
+ theString = anObject;
+ break;
}
- break;
-
- case 15:
- if ([self splitsLastFourDigits]) { // #####-###-###-##-##
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 5)],
- [anObject substringWithRange:NSMakeRange(5, 3)],
- [anObject substringWithRange:NSMakeRange(8, 3)],
- [anObject substringWithRange:NSMakeRange(11, 2)],
- [anObject substringWithRange:NSMakeRange(13, 2)]];
- } else { // #####-###-###-####
- theString = [NSString stringWithFormat:@"%@-%@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 5)],
- [anObject substringWithRange:NSMakeRange(5, 3)],
- [anObject substringWithRange:NSMakeRange(8, 3)],
- [anObject substringWithRange:NSMakeRange(11, 4)]];
+ } else if ([[NSPredicate predicateWithFormat:@"SELF MATCHES '\\\\+(1|7)\\\\d{10}'"] evaluateWithObject:anObject]) {
+ if ([self splitsLastFourDigits]) { // +# (###) ###-##-##
+ theString = [NSString stringWithFormat:@"%@ (%@) %@-%@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 2)],
+ [anObject substringWithRange:NSMakeRange(2, 3)],
+ [anObject substringWithRange:NSMakeRange(5, 3)],
+ [anObject substringWithRange:NSMakeRange(8, 2)],
+ [anObject substringWithRange:NSMakeRange(10, 2)]];
+ } else { // +# (###) ###-####
+ theString = [NSString stringWithFormat:@"%@ (%@) %@-%@",
+ [anObject substringWithRange:NSMakeRange(0, 2)],
+ [anObject substringWithRange:NSMakeRange(2, 3)],
+ [anObject substringWithRange:NSMakeRange(5, 3)],
+ [anObject substringWithRange:NSMakeRange(8, 4)]];
}
- break;
- default:
+ } else {
theString = anObject;
- break;
}
- } else if ([[NSPredicate predicateWithFormat:@"SELF MATCHES '\\\\+(1|7)\\\\d{10}'"]
- evaluateWithObject:anObject]) {
- if ([self splitsLastFourDigits]) { // +# (###) ###-##-##
- theString = [NSString stringWithFormat:@"%@ (%@) %@-%@-%@",
- [anObject substringWithRange:NSMakeRange(0, 2)],
- [anObject substringWithRange:NSMakeRange(2, 3)],
- [anObject substringWithRange:NSMakeRange(5, 3)],
- [anObject substringWithRange:NSMakeRange(8, 2)],
- [anObject substringWithRange:NSMakeRange(10, 2)]];
- } else { // +# (###) ###-####
- theString = [NSString stringWithFormat:@"%@ (%@) %@-%@",
- [anObject substringWithRange:NSMakeRange(0, 2)],
- [anObject substringWithRange:NSMakeRange(2, 3)],
- [anObject substringWithRange:NSMakeRange(5, 3)],
- [anObject substringWithRange:NSMakeRange(8, 4)]];
- }
- } else {
- theString = anObject;
- }
-
- return theString;
+
+ return theString;
}
-- (BOOL)getObjectValue:(id *)anObject
- forString:(NSString *)string
- errorDescription:(NSString **)error {
-
- BOOL returnValue = NO;
-
- NSMutableCharacterSet *phoneNumberCharacterSet
- = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789"] copy];
- NSScanner *scanner = [NSScanner scannerWithString:string];
- NSMutableString *telephoneNumber = [[NSMutableString alloc] init];
-
- if ([string hasPrefix:@"+"]) {
- [telephoneNumber appendString:@"+"];
- [scanner setScanLocation:1];
- } else {
- // If the number is not in the international format, allow asterisk and
- // number sign.
- [phoneNumberCharacterSet addCharactersInString:@"*#"];
- }
-
- NSString *aString;
- while (![scanner isAtEnd]) {
- [scanner scanUpToCharactersFromSet:phoneNumberCharacterSet intoString:NULL];
- BOOL scanned = [scanner scanCharactersFromSet:phoneNumberCharacterSet
- intoString:&aString];
- if (scanned) {
- [telephoneNumber appendString:aString];
+- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error {
+ BOOL returnValue = NO;
+
+ NSMutableCharacterSet *phoneNumberCharacterSet
+ = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789"] copy];
+ NSScanner *scanner = [NSScanner scannerWithString:string];
+ NSMutableString *telephoneNumber = [[NSMutableString alloc] init];
+
+ if ([string hasPrefix:@"+"]) {
+ [telephoneNumber appendString:@"+"];
+ [scanner setScanLocation:1];
+ } else {
+ // If the number is not in the international format, allow asterisk and
+ // number sign.
+ [phoneNumberCharacterSet addCharactersInString:@"*#"];
}
- }
-
- if ([telephoneNumber length] > 0) {
- returnValue = YES;
- if (anObject != NULL) {
- *anObject = [[telephoneNumber copy] autorelease];
+
+ NSString *aString;
+ while (![scanner isAtEnd]) {
+ [scanner scanUpToCharactersFromSet:phoneNumberCharacterSet intoString:NULL];
+ BOOL scanned = [scanner scanCharactersFromSet:phoneNumberCharacterSet intoString:&aString];
+ if (scanned) {
+ [telephoneNumber appendString:aString];
+ }
}
- } else if (error != NULL) {
- *error = [NSString stringWithFormat:
- @"Couldn't convert \"%@\" to telephone number",
- string];
- }
-
- [telephoneNumber release];
- [phoneNumberCharacterSet release];
-
- return returnValue;
+
+ if ([telephoneNumber length] > 0) {
+ returnValue = YES;
+ if (anObject != NULL) {
+ *anObject = [[telephoneNumber copy] autorelease];
+ }
+ } else if (error != NULL) {
+ *error = [NSString stringWithFormat:@"Couldn't convert \"%@\" to telephone number", string];
+ }
+
+ [telephoneNumber release];
+ [phoneNumberCharacterSet release];
+
+ return returnValue;
}
- (NSString *)telephoneNumberFromString:(NSString *)string {
- NSString *telephoneNumber, *error;
- BOOL converted = [self getObjectValue:&telephoneNumber
- forString:string
- errorDescription:&error];
- if (converted) {
- return telephoneNumber;
- } else {
- NSLog(@"%@", error);
- return nil;
- }
+ NSString *telephoneNumber, *error;
+ BOOL converted = [self getObjectValue:&telephoneNumber forString:string errorDescription:&error];
+ if (converted) {
+ return telephoneNumber;
+ } else {
+ NSLog(@"%@", error);
+ return nil;
+ }
}
@end
View
26 Classes/AccountSetupController.h
@@ -32,23 +32,23 @@
// Sent when account setup controller adds an account.
-// |userInfo| object contains dictionary with the account data (see the account
-// keys defined in PreferencesController.h).
+// |userInfo| object contains dictionary with the account data (see the account keys defined in
+// PreferencesController.h).
extern NSString * const AKAccountSetupControllerDidAddAccountNotification;
// A class to manage account setup.
@interface AccountSetupController : NSWindowController {
- @private
- NSTextField *fullNameField_;
- NSTextField *domainField_;
- NSTextField *usernameField_;
- NSTextField *passwordField_;
- NSImageView *fullNameInvalidDataView_;
- NSImageView *domainInvalidDataView_;
- NSImageView *usernameInvalidDataView_;
- NSImageView *passwordInvalidDataView_;
- NSButton *defaultButton_;
- NSButton *otherButton_;
+ @private
+ NSTextField *fullNameField_;
+ NSTextField *domainField_;
+ NSTextField *usernameField_;
+ NSTextField *passwordField_;
+ NSImageView *fullNameInvalidDataView_;
+ NSImageView *domainInvalidDataView_;
+ NSImageView *usernameInvalidDataView_;
+ NSImageView *passwordInvalidDataView_;
+ NSButton *defaultButton_;
+ NSButton *otherButton_;
}
// Outlets.
View
175 Classes/AccountSetupController.m
@@ -35,8 +35,7 @@
#import "PreferencesController.h"
-NSString * const AKAccountSetupControllerDidAddAccountNotification
- = @"AKAccountSetupControllerDidAddAccount";
+NSString * const AKAccountSetupControllerDidAddAccountNotification = @"AKAccountSetupControllerDidAddAccount";
@implementation AccountSetupController
@@ -52,105 +51,97 @@ @implementation AccountSetupController
@synthesize otherButton = otherButton_;
- (id)init {
- self = [super initWithWindowNibName:@"AccountSetup"];
-
- return self;
+ self = [super initWithWindowNibName:@"AccountSetup"];
+
+ return self;
}
- (void)dealloc {
- [fullNameField_ release];
- [domainField_ release];
- [usernameField_ release];
- [passwordField_ release];
- [fullNameInvalidDataView_ release];
- [domainInvalidDataView_ release];
- [usernameInvalidDataView_ release];
- [passwordInvalidDataView_ release];
- [defaultButton_ release];
- [otherButton_ release];
-
- [super dealloc];
+ [fullNameField_ release];
+ [domainField_ release];
+ [usernameField_ release];
+ [passwordField_ release];
+ [fullNameInvalidDataView_ release];
+ [domainInvalidDataView_ release];
+ [usernameInvalidDataView_ release];
+ [passwordInvalidDataView_ release];
+ [defaultButton_ release];
+ [otherButton_ release];
+
+ [super dealloc];
}
- (IBAction)closeSheet:(id)sender {
- [NSApp endSheet:[sender window]];
- [[sender window] orderOut:sender];
+ [NSApp endSheet:[sender window]];
+ [[sender window] orderOut:sender];
}
- (IBAction)addAccount:(id)sender {
- // Reset hidden states of the invalid data indicators.
- [[self fullNameInvalidDataView] setHidden:YES];
- [[self domainInvalidDataView] setHidden:YES];
- [[self usernameInvalidDataView] setHidden:YES];
- [[self passwordInvalidDataView] setHidden:YES];
-
- NSCharacterSet *spacesSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
- NSString *fullName = [[[self fullNameField] stringValue]
- stringByTrimmingCharactersInSet:spacesSet];
- NSString *domain = [[[self domainField] stringValue]
- stringByTrimmingCharactersInSet:spacesSet];
- NSString *username = [[[self usernameField] stringValue]
- stringByTrimmingCharactersInSet:spacesSet];
-
- BOOL invalidFormData = NO;
-
- if ([fullName length] == 0) {
- [[self fullNameInvalidDataView] setHidden:NO];
- invalidFormData = YES;
- }
-
- if ([domain length] == 0) {
- [[self domainInvalidDataView] setHidden:NO];
- invalidFormData = YES;
- }
-
- if ([username length] == 0) {
- [[self usernameInvalidDataView] setHidden:NO];
- invalidFormData = YES;
- }
-
- if ([[[self passwordField] stringValue] length] == 0) {
- [[self passwordInvalidDataView] setHidden:NO];
- invalidFormData = YES;
- }
-
- if (invalidFormData) {
- return;
- }
-
- NSMutableDictionary *accountDict = [NSMutableDictionary dictionary];
- [accountDict setObject:[NSNumber numberWithBool:YES] forKey:kAccountEnabled];
- [accountDict setObject:fullName forKey:kFullName];
- [accountDict setObject:domain forKey:kDomain];
- [accountDict setObject:@"*" forKey:kRealm];
- [accountDict setObject:username forKey:kUsername];
- [accountDict setObject:[NSNumber numberWithInteger:0]
- forKey:kReregistrationTime];
- [accountDict setObject:[NSNumber numberWithBool:NO]
- forKey:kSubstitutePlusCharacter];
- [accountDict setObject:@"00" forKey:kPlusCharacterSubstitutionString];
- [accountDict setObject:[NSNumber numberWithBool:NO] forKey:kUseProxy];
- [accountDict setObject:@"" forKey:kProxyHost];
- [accountDict setObject:[NSNumber numberWithInteger:0] forKey:kProxyPort];
-
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- NSMutableArray *savedAccounts
- = [NSMutableArray arrayWithArray:[defaults arrayForKey:kAccounts]];
- [savedAccounts addObject:accountDict];
- [defaults setObject:savedAccounts forKey:kAccounts];
- [defaults synchronize];
-
- [AKKeychain addItemWithServiceName:[NSString stringWithFormat:@"SIP: %@",
- domain]
- accountName:username
- password:[[self passwordField] stringValue]];
-
- [self closeSheet:sender];
-
- [[NSNotificationCenter defaultCenter]
- postNotificationName:AKAccountSetupControllerDidAddAccountNotification
- object:self
- userInfo:accountDict];
+ // Reset hidden states of the invalid data indicators.
+ [[self fullNameInvalidDataView] setHidden:YES];
+ [[self domainInvalidDataView] setHidden:YES];
+ [[self usernameInvalidDataView] setHidden:YES];
+ [[self passwordInvalidDataView] setHidden:YES];
+
+ NSCharacterSet *spacesSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
+ NSString *fullName = [[[self fullNameField] stringValue] stringByTrimmingCharactersInSet:spacesSet];
+ NSString *domain = [[[self domainField] stringValue] stringByTrimmingCharactersInSet:spacesSet];
+ NSString *username = [[[self usernameField] stringValue] stringByTrimmingCharactersInSet:spacesSet];
+
+ BOOL invalidFormData = NO;
+
+ if ([fullName length] == 0) {
+ [[self fullNameInvalidDataView] setHidden:NO];
+ invalidFormData = YES;
+ }
+
+ if ([domain length] == 0) {
+ [[self domainInvalidDataView] setHidden:NO];
+ invalidFormData = YES;
+ }
+
+ if ([username length] == 0) {
+ [[self usernameInvalidDataView] setHidden:NO];
+ invalidFormData = YES;
+ }
+
+ if ([[[self passwordField] stringValue] length] == 0) {
+ [[self passwordInvalidDataView] setHidden:NO];
+ invalidFormData = YES;
+ }
+
+ if (invalidFormData) {
+ return;
+ }
+
+ NSMutableDictionary *accountDict = [NSMutableDictionary dictionary];
+ [accountDict setObject:[NSNumber numberWithBool:YES] forKey:kAccountEnabled];
+ [accountDict setObject:fullName forKey:kFullName];
+ [accountDict setObject:domain forKey:kDomain];
+ [accountDict setObject:@"*" forKey:kRealm];
+ [accountDict setObject:username forKey:kUsername];
+ [accountDict setObject:[NSNumber numberWithInteger:0] forKey:kReregistrationTime];
+ [accountDict setObject:[NSNumber numberWithBool:NO] forKey:kSubstitutePlusCharacter];
+ [accountDict setObject:@"00" forKey:kPlusCharacterSubstitutionString];
+ [accountDict setObject:[NSNumber numberWithBool:NO] forKey:kUseProxy];
+ [accountDict setObject:@"" forKey:kProxyHost];
+ [accountDict setObject:[NSNumber numberWithInteger:0] forKey:kProxyPort];
+
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ NSMutableArray *savedAccounts = [NSMutableArray arrayWithArray:[defaults arrayForKey:kAccounts]];
+ [savedAccounts addObject:accountDict];
+ [defaults setObject:savedAccounts forKey:kAccounts];
+ [defaults synchronize];
+
+ [AKKeychain addItemWithServiceName:[NSString stringWithFormat:@"SIP: %@", domain]
+ accountName:username
+ password:[[self passwordField] stringValue]];
+
+ [self closeSheet:sender];
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:AKAccountSetupControllerDidAddAccountNotification
+ object:self
+ userInfo:accountDict];
}
@end
View
19 Classes/AuthenticationFailureController.h
@@ -40,14 +40,14 @@ extern NSString * const AKAuthenticationFailureControllerDidChangeUsernameAndPas
// Instances of AuthenticationFailureController class allow user to update
// account credentials when authentication fails.
@interface AuthenticationFailureController : NSWindowController {
- @private
- AccountController *accountController_;
-
- NSTextField *informativeText_;
- NSTextField *usernameField_;
- NSTextField *passwordField_;
- NSButton *mustSaveCheckBox_;
- NSButton *cancelButton_;
+ @private
+ AccountController *accountController_;
+
+ NSTextField *informativeText_;
+ NSTextField *usernameField_;
+ NSTextField *passwordField_;
+ NSButton *mustSaveCheckBox_;
+ NSButton *cancelButton_;
}
// The receiver's account controller.
@@ -69,8 +69,7 @@ extern NSString * const AKAuthenticationFailureControllerDidChangeUsernameAndPas
@property (nonatomic, retain) IBOutlet NSButton *cancelButton;
-// Initializes an AuthenticationFailureController object with a given account
-// controller.
+// Initializes an AuthenticationFailureController object with a given account controller.
- (id)initWithAccountController:(AccountController *)anAccountController;
// Closes a sheet.
View
177 Classes/AuthenticationFailureController.m
@@ -38,7 +38,7 @@
NSString * const AKAuthenticationFailureControllerDidChangeUsernameAndPasswordNotification
- = @"AKAuthenticationFailureControllerDidChangeUsernameAndPassword";
+ = @"AKAuthenticationFailureControllerDidChangeUsernameAndPassword";
@implementation AuthenticationFailureController
@@ -51,117 +51,108 @@ @implementation AuthenticationFailureController
@synthesize cancelButton = cancelButton_;
- (id)initWithAccountController:(AccountController *)anAccountController {
- self = [super initWithWindowNibName:@"AuthenticationFailure"];
- if (self != nil) {
- [self setAccountController:anAccountController];
- }
-
- return self;
+ self = [super initWithWindowNibName:@"AuthenticationFailure"];
+ if (self != nil) {
+ [self setAccountController:anAccountController];
+ }
+
+ return self;
}
- (id)init {
- return [self initWithAccountController:nil];
+ return [self initWithAccountController:nil];
}
- (void)dealloc {
- [informativeText_ release];
- [usernameField_ release];
- [passwordField_ release];
- [mustSaveCheckBox_ release];
- [cancelButton_ release];
-
- [super dealloc];
+ [informativeText_ release];
+ [usernameField_ release];
+ [passwordField_ release];
+ [mustSaveCheckBox_ release];
+ [cancelButton_ release];
+
+ [super dealloc];
}
- (void)awakeFromNib {
- NSString *registrar = [[[self accountController] account] registrar];
- [[self informativeText] setStringValue:
- [NSString stringWithFormat:
- NSLocalizedString(@"Telephone was unable to login to %@. "
- "Change user name or password and try again.",
- @"Registrar authentication failed."), registrar]];
-
- NSString *username = [[[self accountController] account] username];
- NSString *serviceName = [NSString stringWithFormat:@"SIP: %@",
- [[[self accountController] account] registrar]];
- NSString *password = [AKKeychain passwordForServiceName:serviceName
- accountName:username];
-
- [[self usernameField] setStringValue:username];
- [[self passwordField] setStringValue:password];
+ NSString *registrar = [[[self accountController] account] registrar];
+ [[self informativeText] setStringValue:
+ [NSString stringWithFormat:
+ NSLocalizedString(@"Telephone was unable to login to %@. Change user name or password and try again.",
+ @"Registrar authentication failed."), registrar]];
+
+ NSString *username = [[[self accountController] account] username];
+ NSString *serviceName = [NSString stringWithFormat:@"SIP: %@", [[[self accountController] account] registrar]];
+ NSString *password = [AKKeychain passwordForServiceName:serviceName accountName:username];
+
+ [[self usernameField] setStringValue:username];
+ [[self passwordField] setStringValue:password];
}
- (IBAction)closeSheet:(id)sender {
- [NSApp endSheet:[sender window]];
- [[sender window] orderOut:self];
+ [NSApp endSheet:[sender window]];
+ [[sender window] orderOut:self];
}
- (IBAction)changeUsernameAndPassword:(id)sender {
- [self closeSheet:sender];
-
- NSCharacterSet *spacesSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
- NSString *username = [[[self usernameField] stringValue]
- stringByTrimmingCharactersInSet:spacesSet];
-
- if ([username length] > 0) {
- [[self accountController] removeAccountFromUserAgent];
- [[[self accountController] account] setUsername:username];
-
- [[self accountController] showConnectingState];
+ [self closeSheet:sender];
- // Add account to the user agent.
- [[[NSApp delegate] userAgent] addAccount:[[self accountController] account]
- withPassword:[[self passwordField]
- stringValue]];
-
- // Error connecting to registrar.
- if (![[self accountController] isAccountRegistered] &&
- [[[self accountController] account] registrationExpireTime] < 0) {
- [[self accountController] showUnavailableState];
-
- NSString *statusText;
- NSString *preferredLocalization
- = [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];
- if ([preferredLocalization isEqualToString:@"Russian"]) {
- statusText = [[NSApp delegate] localizedStringForSIPResponseCode:
- [[[self accountController] account] registrationStatus]];
- } else {
- statusText
- = [[[self accountController] account] registrationStatusText];
- }
-
- NSString *error;
- if (statusText == nil) {
- error = [NSString stringWithFormat:
- NSLocalizedString(@"Error %d", @"Error #."),
- [[[self accountController] account] registrationStatus]];
- error = [error stringByAppendingString:@"."];
- } else {
- error = [NSString stringWithFormat:
- NSLocalizedString(@"The error was: \\U201C%d %@\\U201D.",
- @"Error description."),
- [[[self accountController] account] registrationStatus],
- statusText];
- }
-
- [[self accountController]
- showRegistrarConnectionErrorSheetWithError:error];
- }
+ NSCharacterSet *spacesSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
+ NSString *username = [[[self usernameField] stringValue] stringByTrimmingCharactersInSet:spacesSet];
- if ([[self mustSaveCheckBox] state] == NSOnState) {
- [AKKeychain
- addItemWithServiceName:[NSString stringWithFormat:@"SIP: %@",
- [[[self accountController] account] registrar]]
- accountName:username
- password:[[self passwordField] stringValue]];
+ if ([username length] > 0) {
+ [[self accountController] removeAccountFromUserAgent];
+ [[[self accountController] account] setUsername:username];
+
+ [[self accountController] showConnectingState];
+
+ // Add account to the user agent.
+ [[[NSApp delegate] userAgent] addAccount:[[self accountController] account]
+ withPassword:[[self passwordField] stringValue]];
+
+ // Error connecting to registrar.
+ if (![[self accountController] isAccountRegistered] &&
+ [[[self accountController] account] registrationExpireTime] < 0) {
+
+ [[self accountController] showUnavailableState];
+
+ NSString *statusText;
+ NSString *preferredLocalization = [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];
+ if ([preferredLocalization isEqualToString:@"Russian"]) {
+ statusText = [[NSApp delegate] localizedStringForSIPResponseCode:
+ [[[self accountController] account] registrationStatus]];
+ } else {
+ statusText = [[[self accountController] account] registrationStatusText];
+ }
+
+ NSString *error;
+ if (statusText == nil) {
+ error = [NSString stringWithFormat:
+ NSLocalizedString(@"Error %d", @"Error #."),
+ [[[self accountController] account] registrationStatus]];
+ error = [error stringByAppendingString:@"."];
+ } else {
+ error = [NSString stringWithFormat:
+ NSLocalizedString(@"The error was: \\U201C%d %@\\U201D.", @"Error description."),
+ [[[self accountController] account] registrationStatus], statusText];
+ }
+
+ [[self accountController] showRegistrarConnectionErrorSheetWithError:error];
+ }
+
+ if ([[self mustSaveCheckBox] state] == NSOnState) {
+ NSString *serviceName = [NSString stringWithFormat:@"SIP: %@",
+ [[[self accountController] account] registrar]];
+ [AKKeychain addItemWithServiceName:serviceName
+ accountName:username
+ password:[[self passwordField] stringValue]];
+ }
+
+ [[NSNotificationCenter defaultCenter]
+ postNotificationName:AKAuthenticationFailureControllerDidChangeUsernameAndPasswordNotification
+ object:self];
}
- [[NSNotificationCenter defaultCenter]
- postNotificationName:AKAuthenticationFailureControllerDidChangeUsernameAndPasswordNotification
- object:self];
- }
-
- [[self passwordField] setStringValue:@""];
+ [[self passwordField] setStringValue:@""];
}
@end
View
44 Telephone.xcodeproj/project.pbxproj
@@ -160,12 +160,12 @@
AA0F7B710F38FCDF0071C3CA /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = "<absolute>"; };
AA167A1D0F07BF9E00AF8B71 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/SIPResponses.strings; sourceTree = "<group>"; };
AA167A480F0805B700AF8B71 /* Russian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Russian; path = Russian.lproj/SIPResponses.strings; sourceTree = "<group>"; };
- AA16CBE10F856A4A000CAFD1 /* AKNSString+Creating.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "AKNSString+Creating.h"; sourceTree = "<group>"; tabWidth = 2; };
- AA16CBE20F856A4A000CAFD1 /* AKNSString+Creating.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "AKNSString+Creating.m"; sourceTree = "<group>"; tabWidth = 2; };
- AA16CBE40F856ACD000CAFD1 /* AKNSString+PJSUA.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "AKNSString+PJSUA.h"; sourceTree = "<group>"; tabWidth = 2; };
- AA16CBE50F856ACD000CAFD1 /* AKNSString+PJSUA.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "AKNSString+PJSUA.m"; sourceTree = "<group>"; tabWidth = 2; };
- AA16CC9C0F857009000CAFD1 /* AKNSString+Escaping.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "AKNSString+Escaping.h"; sourceTree = "<group>"; tabWidth = 2; };
- AA16CC9D0F857009000CAFD1 /* AKNSString+Escaping.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "AKNSString+Escaping.m"; sourceTree = "<group>"; tabWidth = 2; };
+ AA16CBE10F856A4A000CAFD1 /* AKNSString+Creating.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = "AKNSString+Creating.h"; sourceTree = "<group>"; tabWidth = 4; };
+ AA16CBE20F856A4A000CAFD1 /* AKNSString+Creating.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = "AKNSString+Creating.m"; sourceTree = "<group>"; tabWidth = 4; };
+ AA16CBE40F856ACD000CAFD1 /* AKNSString+PJSUA.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = "AKNSString+PJSUA.h"; sourceTree = "<group>"; tabWidth = 4; };
+ AA16CBE50F856ACD000CAFD1 /* AKNSString+PJSUA.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = "AKNSString+PJSUA.m"; sourceTree = "<group>"; tabWidth = 4; };
+ AA16CC9C0F857009000CAFD1 /* AKNSString+Escaping.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = "AKNSString+Escaping.h"; sourceTree = "<group>"; tabWidth = 4; };
+ AA16CC9D0F857009000CAFD1 /* AKNSString+Escaping.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = "AKNSString+Escaping.m"; sourceTree = "<group>"; tabWidth = 4; };
AA1732170EAF8C14009023F2 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/AuthenticationFailure.xib; sourceTree = "<group>"; };
AA19171B0F8EA627002BA093 /* iTunes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iTunes.h; sourceTree = "<group>"; };
AA1917290F8EAF87002BA093 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = "<absolute>"; };
@@ -196,15 +196,15 @@
AA3578B20E40709900021989 /* AccountController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = AccountController.m; sourceTree = "<group>"; tabWidth = 4; };
AA3578B40E4070AD00021989 /* CallController.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CallController.h; sourceTree = "<group>"; tabWidth = 4; };
AA3578B50E4070AD00021989 /* CallController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = CallController.m; sourceTree = "<group>"; tabWidth = 4; };
- AA3A14F90F309C7C00C45739 /* AKABAddressBook+Localizing.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "AKABAddressBook+Localizing.h"; sourceTree = "<group>"; tabWidth = 2; };
- AA3A14FA0F309C7C00C45739 /* AKABAddressBook+Localizing.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "AKABAddressBook+Localizing.m"; sourceTree = "<group>"; tabWidth = 2; };
+ AA3A14F90F309C7C00C45739 /* AKABAddressBook+Localizing.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = "AKABAddressBook+Localizing.h"; sourceTree = "<group>"; tabWidth = 4; };
+ AA3A14FA0F309C7C00C45739 /* AKABAddressBook+Localizing.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = "AKABAddressBook+Localizing.m"; sourceTree = "<group>"; tabWidth = 4; };
AA3A153F0F30A49C00C45739 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/AddressBookLabels.strings; sourceTree = "<group>"; };
AA3A15470F30A4C200C45739 /* Russian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Russian; path = Russian.lproj/AddressBookLabels.strings; sourceTree = "<group>"; };
AA3A15480F30A4C700C45739 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = German.lproj/AddressBookLabels.strings; sourceTree = "<group>"; };
AA3F655C1072C66C000511E8 /* Russian */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Russian; path = Russian.lproj/ActiveAccountView.xib; sourceTree = "<group>"; };
AA3F655D1072C674000511E8 /* German */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = German; path = German.lproj/ActiveAccountView.xib; sourceTree = "<group>"; };
- AA3F65681072C926000511E8 /* AuthenticationFailureController.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = AuthenticationFailureController.h; sourceTree = "<group>"; tabWidth = 2; };
- AA3F65691072C926000511E8 /* AuthenticationFailureController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = AuthenticationFailureController.m; sourceTree = "<group>"; tabWidth = 2; };
+ AA3F65681072C926000511E8 /* AuthenticationFailureController.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationFailureController.h; sourceTree = "<group>"; tabWidth = 4; };
+ AA3F65691072C926000511E8 /* AuthenticationFailureController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationFailureController.m; sourceTree = "<group>"; tabWidth = 4; };
AA4BD4C60E07C28E005A71B2 /* AKSIPUserAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AKSIPUserAgent.h; sourceTree = "<group>"; tabWidth = 4; };
AA4BD4C70E07C28E005A71B2 /* AKSIPUserAgent.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = AKSIPUserAgent.m; sourceTree = "<group>"; tabWidth = 4; };
AA4BD4D60E07C305005A71B2 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; tabWidth = 4; };
@@ -254,8 +254,8 @@
AAAC618A0FE6A42900FBE053 /* AKNetworkReachability.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AKNetworkReachability.h; sourceTree = "<group>"; tabWidth = 4; };
AAAC618B0FE6A42900FBE053 /* AKNetworkReachability.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = AKNetworkReachability.m; sourceTree = "<group>"; tabWidth = 4; };
AAAE4A230E3F4DAA00110597 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Account.xib; sourceTree = "<group>"; };
- AAB5AAC00F2E7A7D00A57531 /* AKABRecord+Querying.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "AKABRecord+Querying.h"; sourceTree = "<group>"; tabWidth = 2; };
- AAB5AAC10F2E7A7D00A57531 /* AKABRecord+Querying.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "AKABRecord+Querying.m"; sourceTree = "<group>"; tabWidth = 2; };
+ AAB5AAC00F2E7A7D00A57531 /* AKABRecord+Querying.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = "AKABRecord+Querying.h"; sourceTree = "<group>"; tabWidth = 4; };
+ AAB5AAC10F2E7A7D00A57531 /* AKABRecord+Querying.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = "AKABRecord+Querying.m"; sourceTree = "<group>"; tabWidth = 4; };
AABAD7EB0E0C171A00CB5930 /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesController.h; sourceTree = "<group>"; tabWidth = 4; };
AABAD7EC0E0C171A00CB5930 /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesController.m; sourceTree = "<group>"; tabWidth = 4; };
AABAD7EF0E0C184200CB5930 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Preferences.xib; sourceTree = "<group>"; };
@@ -280,10 +280,10 @@
AAEA9A840E0819BB00E3AB2D /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
AAEA9A850E0819BB00E3AB2D /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
AAEA9A860E0819BB00E3AB2D /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
- AAECDE8D0E70703100CEAE7B /* AKNSString+Scanning.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "AKNSString+Scanning.h"; sourceTree = "<group>"; tabWidth = 2; };
- AAECDE8E0E70703100CEAE7B /* AKNSString+Scanning.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "AKNSString+Scanning.m"; sourceTree = "<group>"; tabWidth = 2; };
- AAEE7C2F0ECD953200A7DEB4 /* AKNSWindow+Resizing.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = "AKNSWindow+Resizing.h"; sourceTree = "<group>"; tabWidth = 2; };
- AAEE7C300ECD953200A7DEB4 /* AKNSWindow+Resizing.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = "AKNSWindow+Resizing.m"; sourceTree = "<group>"; tabWidth = 2; };
+ AAECDE8D0E70703100CEAE7B /* AKNSString+Scanning.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = "AKNSString+Scanning.h"; sourceTree = "<group>"; tabWidth = 4; };
+ AAECDE8E0E70703100CEAE7B /* AKNSString+Scanning.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = "AKNSString+Scanning.m"; sourceTree = "<group>"; tabWidth = 4; };
+ AAEE7C2F0ECD953200A7DEB4 /* AKNSWindow+Resizing.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = "AKNSWindow+Resizing.h"; sourceTree = "<group>"; tabWidth = 4; };
+ AAEE7C300ECD953200A7DEB4 /* AKNSWindow+Resizing.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = "AKNSWindow+Resizing.m"; sourceTree = "<group>"; tabWidth = 4; };
AAF298D30F574744007B5036 /* AKAddressBookPhonePlugIn.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = AKAddressBookPhonePlugIn.h; sourceTree = "<group>"; tabWidth = 2; };
AAF298D40F574744007B5036 /* AKAddressBookPhonePlugIn.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = AKAddressBookPhonePlugIn.m; sourceTree = "<group>"; tabWidth = 2; };
AAF299100F575044007B5036 /* TelephoneAddressBookPhonePlugIn.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TelephoneAddressBookPhonePlugIn.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -298,10 +298,10 @@
AAF633691056FEA600CF6C3B /* ActiveAccountViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = ActiveAccountViewController.m; sourceTree = "<group>"; tabWidth = 4; };
AAF639F40FEFF13A0089DA3A /* AKResponsiveProgressIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AKResponsiveProgressIndicator.h; sourceTree = "<group>"; tabWidth = 4; };
AAF639F50FEFF13A0089DA3A /* AKResponsiveProgressIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = AKResponsiveProgressIndicator.m; sourceTree = "<group>"; tabWidth = 4; };
- AAFA9B1B0EE1D8FC009A45CB /* AKSIPURIFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = AKSIPURIFormatter.h; sourceTree = "<group>"; tabWidth = 2; };
- AAFA9B1C0EE1D8FC009A45CB /* AKSIPURIFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = AKSIPURIFormatter.m; sourceTree = "<group>"; tabWidth = 2; };
- AAFA9C3B0EE411BA009A45CB /* AKTelephoneNumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = AKTelephoneNumberFormatter.h; sourceTree = "<group>"; tabWidth = 2; };
- AAFA9C3C0EE411BA009A45CB /* AKTelephoneNumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = AKTelephoneNumberFormatter.m; sourceTree = "<group>"; tabWidth = 2; };
+ AAFA9B1B0EE1D8FC009A45CB /* AKSIPURIFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AKSIPURIFormatter.h; sourceTree = "<group>"; tabWidth = 4; };
+ AAFA9B1C0EE1D8FC009A45CB /* AKSIPURIFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = AKSIPURIFormatter.m; sourceTree = "<group>"; tabWidth = 4; };
+ AAFA9C3B0EE411BA009A45CB /* AKTelephoneNumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AKTelephoneNumberFormatter.h; sourceTree = "<group>"; tabWidth = 4; };
+ AAFA9C3C0EE411BA009A45CB /* AKTelephoneNumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = AKTelephoneNumberFormatter.m; sourceTree = "<group>"; tabWidth = 4; };
AAFC002D1074D0EB0018C7DA /* Russian */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Russian; path = Russian.lproj/GeneralPreferencesView.xib; sourceTree = "<group>"; };
AAFC00351074D1700018C7DA /* German */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = German; path = German.lproj/GeneralPreferencesView.xib; sourceTree = "<group>"; };
AAFC00361074D17F0018C7DA /* Russian */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Russian; path = Russian.lproj/AccountPreferencesView.xib; sourceTree = "<group>"; };
@@ -310,8 +310,8 @@
AAFC00391074D18F0018C7DA /* German */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = German; path = German.lproj/SoundPreferencesView.xib; sourceTree = "<group>"; };
AAFC003A1074D1980018C7DA /* Russian */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Russian; path = Russian.lproj/NetworkPreferencesView.xib; sourceTree = "<group>"; };
AAFC003B1074D19A0018C7DA /* German */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = German; path = German.lproj/NetworkPreferencesView.xib; sourceTree = "<group>"; };
- AAFCFFBB1074BFCA0018C7DA /* AccountSetupController.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = AccountSetupController.h; sourceTree = "<group>"; tabWidth = 2; };
- AAFCFFBC1074BFCA0018C7DA /* AccountSetupController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = AccountSetupController.m; sourceTree = "<group>"; tabWidth = 2; };
+ AAFCFFBB1074BFCA0018C7DA /* AccountSetupController.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AccountSetupController.h; sourceTree = "<group>"; tabWidth = 4; };
+ AAFCFFBC1074BFCA0018C7DA /* AccountSetupController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = AccountSetupController.m; sourceTree = "<group>"; tabWidth = 4; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
Please sign in to comment.
Something went wrong with that request. Please try again.