mirror of
https://github.com/zxing/zxing.git
synced 2024-11-13 06:24:06 -08:00
ee44225e3d
git-svn-id: https://zxing.googlecode.com/svn/trunk@478 59b500cc-1b3d-0410-9834-0bbf25fbcc57
28 lines
621 B
Objective-C
28 lines
621 B
Objective-C
//
|
|
// TelResultParser.m
|
|
// ZXing
|
|
//
|
|
// Created by Christian Brunschen on 25/06/2008.
|
|
// Copyright 2008 Google Inc. All rights reserved.
|
|
//
|
|
|
|
#import "TelResultParser.h"
|
|
#import "TelParsedResult.h"
|
|
|
|
#define PREFIX @"tel:"
|
|
|
|
@implementation TelResultParser
|
|
|
|
+ (ParsedResult *)parsedResultForString:(NSString *)s {
|
|
NSRange telRange = [s rangeOfString:PREFIX options:NSCaseInsensitiveSearch];
|
|
if (telRange.location == 0) {
|
|
int restStart = telRange.location + telRange.length;
|
|
return [[[TelParsedResult alloc] initWithNumber:[s substringFromIndex:restStart]]
|
|
autorelease];
|
|
}
|
|
return nil;
|
|
}
|
|
|
|
|
|
@end
|