Skip to content

Commit

Permalink
Subproject ZXingWidget
Browse files Browse the repository at this point in the history
Added the new subproject for iOS
  • Loading branch information
jonathannaguin committed Oct 3, 2013
1 parent 6ba9c4a commit 068c271
Show file tree
Hide file tree
Showing 318 changed files with 33,896 additions and 0 deletions.
155 changes: 155 additions & 0 deletions src/ios/ZXingWidgetLibrary/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.1
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
# - added line-by-line explanations for EVERYTHING (some were missing)
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
#########################

#####
# OS X temporary files that should never be committed
#
# c.f. http://www.westwind.com/reference/os-x/invisibles.html

.DS_Store

# c.f. http://www.westwind.com/reference/os-x/invisibles.html

.Trashes

# c.f. http://www.westwind.com/reference/os-x/invisibles.html

*.swp

# *.lock - this is used and abused by many editors for many different things.
# For the main ones I use (e.g. Eclipse), it should be excluded
# from source-control, but YMMV

*.lock

#
# profile - REMOVED temporarily (on double-checking, this seems incorrect; I can't find it in OS X docs?)
#profile


####
# Xcode temporary files that should never be committed
#
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...

*~.nib


####
# Xcode build files -
#
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"

DerivedData/

# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"

build/


#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
#
# This is complicated:
#
# SOMETIMES you need to put this file in version control.
# Apple designed it poorly - if you use "custom executables", they are
# saved in this file.
# 99% of projects do NOT use those, so they do NOT want to version control this file.
# ..but if you're in the 1%, comment out the line "*.pbxuser"

# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html

*.pbxuser

# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html

*.mode1v3

# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html

*.mode2v3

# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file

*.perspectivev3

# NB: also, whitelist the default ones, some projects need to use these
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3


####
# Xcode 4 - semi-personal settings
#
#
# OPTION 1: ---------------------------------
# throw away ALL personal settings (including custom schemes!
# - unless they are "shared")
#
# NB: this is exclusive with OPTION 2 below
xcuserdata

# OPTION 2: ---------------------------------
# get rid of ALL personal settings, but KEEP SOME OF THEM
# - NB: you must manually uncomment the bits you want to keep
#
# NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X,
# or manually install git over the top of the OS X version
# NB: this is exclusive with OPTION 1 above
#
#xcuserdata/**/*

# (requires option 2 above): Personal Schemes
#
#!xcuserdata/**/xcschemes/*

####
# XCode 4 workspaces - more detailed
#
# Workspaces are important! They are a core feature of Xcode - don't exclude them :)
#
# Workspace layout is quite spammy. For reference:
#
# /(root)/
# /(project-name).xcodeproj/
# project.pbxproj
# /project.xcworkspace/
# contents.xcworkspacedata
# /xcuserdata/
# /(your name)/xcuserdatad/
# UserInterfaceState.xcuserstate
# /xcsshareddata/
# /xcschemes/
# (shared scheme name).xcscheme
# /xcuserdata/
# /(your name)/xcuserdatad/
# (private scheme).xcscheme
# xcschememanagement.plist
#
#

####
# Xcode 4 - Deprecated classes
#
# Allegedly, if you manually "deprecate" your classes, they get moved here.
#
# We're using source-control, so this is a "feature" that we do not want!

*.moved-aside
1 change: 1 addition & 0 deletions src/ios/ZXingWidgetLibrary/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.2
1,454 changes: 1,454 additions & 0 deletions src/ios/ZXingWidgetLibrary/ZXingWidgetLibrary.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>2DD24C19-C830-4241-85D7-B94FD26ADA4D</string>
<key>IDESourceControlProjectName</key>
<string>ZXingWidgetLibrary</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>AB63177B-A988-4AB2-BDF3-42F42D40770A</key>
<string>https://github.com/jonathannaguin/BarcodeScanner.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>src/ios/ZXingWidgetLibrary/ZXingWidgetLibrary.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>AB63177B-A988-4AB2-BDF3-42F42D40770A</key>
<string>../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/jonathannaguin/BarcodeScanner.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>AB63177B-A988-4AB2-BDF3-42F42D40770A</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>AB63177B-A988-4AB2-BDF3-42F42D40770A</string>
<key>IDESourceControlWCCName</key>
<string>com.phonegap.plugins</string>
</dict>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// ArrayAndStringCategories.h
// ZXing
//
// Created by Christian Brunschen on 25/06/2008.
/*
* Copyright 2008 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import <UIKit/UIKit.h>
#import "ResultParser.h"

@interface NSString (DoCoMoFieldParsing)
- (NSString *)backslashUnescaped;
- (NSArray *)fieldsWithPrefix:(NSString *)prefix;
- (NSArray *)fieldsWithPrefix:(NSString *)prefix terminator:(NSString *)term;
- (NSString *)fieldWithPrefix:(NSString *)prefix;
- (NSString *)fieldWithPrefix:(NSString *)prefix terminator:(NSString *)term;
- (NSString *)stringWithTrimmedWhitespace;
@end

@interface NSArray (DoCoMoStringArray)

- (NSArray*)stringArrayWithTrimmedWhitespace;
+ (NSArray*)arrayWithStringIfNotNil:(NSString *)string;

@end


// This works around the linker bug described here:
// http://developer.apple.com/library/mac/#qa/qa1490/_index.html
void ForceArrayAndStringCategoriesToLoad(void);
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
//
// ArrayAndStringCategories.m
// ZXing
//
// Created by Christian Brunschen on 25/06/2008.
/*
* Copyright 2008 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import "ArrayAndStringCategories.h"


@implementation NSString (ArrayAndStringCategories)

- (NSString *)backslashUnescaped {
NSRange backslashRange = [self rangeOfString:@"\\"];
if (backslashRange.location == NSNotFound) {
return self;
}

int max = [self length];
int startLocation = 0;
NSMutableString *result = [NSMutableString stringWithCapacity:[self length]];
while (backslashRange.location != NSNotFound) {
[result appendString:[self substringWithRange:NSMakeRange(startLocation,
backslashRange.location - startLocation)]];
[result appendFormat:@"%c", [self characterAtIndex:backslashRange.location + 1]];
startLocation = backslashRange.location + 2;
NSRange searchRange = NSMakeRange(startLocation, max - startLocation);
backslashRange = [self rangeOfString:@"\\" options:0 range:searchRange];
}
if (startLocation < max) {
[result appendString:[self substringWithRange:NSMakeRange(startLocation, max - startLocation)]];
}
return [NSString stringWithString:result];
}

- (NSArray *)fieldsWithPrefix:(NSString *)prefix {
return [self fieldsWithPrefix:prefix terminator:@";"];
}

- (NSArray *)fieldsWithPrefix:(NSString *)prefix terminator:(NSString *)term {
NSMutableArray *result = nil;

int i = 0;
int max = [self length];
NSRange searchRange;
NSRange foundRange;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
while (i < max) {
searchRange = NSMakeRange(i, max - i);
foundRange = [self rangeOfString:prefix options:0 range:searchRange];
if(foundRange.location == NSNotFound) {
break;
}

int start = i = foundRange.location + foundRange.length;
bool done = false;
while (!done) {
searchRange = NSMakeRange(i, max - i);
NSRange termRange = [self rangeOfString:term options:0 range:searchRange];
if (termRange.location == NSNotFound) {
i = max;
done = true;
} else if ([self characterAtIndex:termRange.location-1] == (unichar)'\\') {
i++;
} else {
NSAutoreleasePool *secondaryPool = [[NSAutoreleasePool alloc] init];
NSString *substring = [self substringWithRange:NSMakeRange(start, termRange.location - start)];
NSString *unescaped = [substring backslashUnescaped];
NSString *toBeInArray = [[NSString alloc] initWithString:unescaped];
[secondaryPool release];
if (result == nil) {
result = [[NSMutableArray alloc] initWithCapacity:1];
}
[result addObject:toBeInArray];
[toBeInArray release];
i = termRange.location + termRange.length;
done = true;
}
}
}
[pool release];

return [result autorelease];
}

- (NSString *)fieldWithPrefix:(NSString *)prefix {
return [self fieldWithPrefix:prefix terminator:@";"];
}

- (NSString *)fieldWithPrefix:(NSString *)prefix terminator:(NSString *)term {
NSArray *fields = [self fieldsWithPrefix:prefix terminator:term];
if (fields.count == 0) {
return nil;
} else {
return [fields lastObject];
}
}

- (NSString *)stringWithTrimmedWhitespace {
return [self stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}

@end

@implementation NSArray (ArrayAndStringCategories)

- (NSArray*)stringArrayWithTrimmedWhitespace {
NSMutableArray* trimmed = [NSMutableArray arrayWithCapacity:[self count]];
for (NSString* s in self) {
[trimmed addObject:[s stringWithTrimmedWhitespace]];
}
return trimmed;
}

+ (NSArray*)arrayWithStringIfNotNil:(NSString *)string {
if (string != nil) {
return [NSArray arrayWithObject:string];
} else {
return nil;
}
}

@end


void ForceArrayAndStringCategoriesToLoad(void) {
// No-op. See comments in header file.
}
Loading

0 comments on commit 068c271

Please sign in to comment.