├── XcodeCoverage ├── .gitignore ├── lcov-1.10 │ ├── contrib │ │ └── galaxy │ │ │ ├── CHANGES │ │ │ ├── README │ │ │ ├── conglomerate_functions.pl │ │ │ └── gen_makefile.sh │ ├── example │ │ ├── gauss.h │ │ ├── iterate.h │ │ ├── README │ │ ├── descriptions.txt │ │ ├── methods │ │ │ ├── iterate.c │ │ │ └── gauss.c │ │ ├── example.c │ │ └── Makefile │ ├── bin │ │ ├── install.sh │ │ ├── updateversion.pl │ │ └── gendesc │ ├── man │ │ ├── gendesc.1 │ │ └── genpng.1 │ ├── rpm │ │ └── lcov.spec │ ├── Makefile │ ├── README │ └── lcovrc ├── cleancov ├── exportenv.sh ├── envcov.sh ├── env.sh ├── getcov ├── LICENSE.txt └── README.md ├── .gitignore ├── en.lproj └── InfoPlist.strings ├── UnitTestMac ├── en.lproj │ └── InfoPlist.strings ├── UnitTestMac-Prefix.pch └── UnitTestMac-Info.plist ├── UnitTestiOS ├── en.lproj │ └── InfoPlist.strings ├── UnitTestiOS-Prefix.pch ├── Info.plist └── UnitTestiOS-Info.plist ├── Images └── NanoStore_Logo.png ├── NanoStore_Prefix.pch ├── libnanostore2 └── libnanostore2-Prefix.pch ├── Examples ├── iTunesImporter │ ├── iTunesImporter_Prefix.pch │ ├── iTunesImporter.xcodeproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ ├── xcuserdata │ │ │ └── tciuro.xcuserdatad │ │ │ │ ├── xcschemes │ │ │ │ ├── xcschememanagement.plist │ │ │ │ └── iTunesImporter.xcscheme │ │ │ │ └── xcdebugger │ │ │ │ └── Breakpoints.xcbkptlist │ │ └── tciuro.pbxuser │ ├── iTunesImporter.1 │ └── iTunesImporter.m └── iPhoneTest │ ├── iPhoneTest_Prefix.pch │ ├── Classes │ ├── RootViewController.h │ ├── iPhoneTestAppDelegate.h │ └── iPhoneTestAppDelegate.m │ ├── main.m │ └── iPhoneTest-Info.plist ├── NanoStore.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ ├── UnitTestiOS.xcscheme │ ├── Universal.xcscheme │ ├── libnanostore2.xcscheme │ ├── UnitTestMac.xcscheme │ └── NanoStore.xcscheme ├── fopenCompatibilityFix.c ├── Tests └── UnitTests │ └── NanoStore │ ├── NanoStoreSortTests.h │ ├── NanoStoreGlobalsTests.h │ ├── NanoEngineTests.h │ ├── NanoStoreTests.h │ ├── NanoStoreBagTests.h │ ├── NanoStoreObjectTests.h │ ├── NanoStoreResultTests.h │ ├── NanoStoreExpressionTests.h │ ├── NanoStoreSearchTests.h │ ├── TestClasses │ ├── NanoCarTestClass.h │ ├── NanoPersonTestClass.h │ ├── NanoCarTestClass.m │ └── NanoPersonTestClass.m │ ├── NanoEngineTests.m │ ├── NanoStoreResultTests.m │ ├── NanoStoreSortTests.m │ └── NanoStoreGlobalsTests.m ├── NanoStore.podspec.json ├── NanoStore.podspec ├── Info.plist ├── .github └── workflows │ └── objc.yml ├── Classes ├── Advanced │ ├── NSFOrderedDictionary.h │ ├── NSFOrderedDictionary.m │ └── NSFNanoResult.h ├── Private │ ├── NSFNanoPredicate_Private.h │ ├── NSFNanoExpression_Private.h │ ├── NanoStore_Private.h │ ├── NSFNanoBag_Private.h │ ├── NSFNanoResult_Private.h │ ├── NSFNanoObject_Private.h │ ├── NSFNanoSearch_Private.h │ ├── NSFNanoEngine_Private.h │ ├── NSFNanoGlobals_Private.h │ └── NSFNanoStore_Private.h └── Public │ ├── NSFNanoSortDescriptor.m │ ├── NSFNanoExpression.m │ ├── NSFNanoObjectProtocol.h │ ├── NSFNanoExpression.h │ ├── NSFNanoPredicate.h │ ├── NSFNanoSortDescriptor.h │ ├── NSFNanoPredicate.m │ └── NSFNanoGlobals.m └── LICENSE /XcodeCoverage/.gitignore: -------------------------------------------------------------------------------- 1 | env.sh 2 | lcov-* 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *xcuserdata 3 | *.xccheckout 4 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/contrib/galaxy/CHANGES: -------------------------------------------------------------------------------- 1 | 09-04-2003 Initial checkin 2 | -------------------------------------------------------------------------------- /en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /UnitTestMac/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /UnitTestiOS/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Images/NanoStore_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tciuro/NanoStore/HEAD/Images/NanoStore_Logo.png -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/example/gauss.h: -------------------------------------------------------------------------------- 1 | #ifndef GAUSS_H 2 | #define GAUSS_H GAUSS_h 3 | 4 | extern int gauss_get_sum (int min, int max); 5 | 6 | #endif /* GAUSS_H */ 7 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/example/iterate.h: -------------------------------------------------------------------------------- 1 | #ifndef ITERATE_H 2 | #define ITERATE_H ITERATE_H 3 | 4 | extern int iterate_get_sum (int min, int max); 5 | 6 | #endif /* ITERATE_H */ 7 | -------------------------------------------------------------------------------- /NanoStore_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NanoStore' target in the 'NanoStore' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /UnitTestMac/UnitTestMac-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'UnitTestMac' target in the 'UnitTestMac' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/example/README: -------------------------------------------------------------------------------- 1 | 2 | To get an example of how the LCOV generated HTML output looks like, 3 | type 'make output' and point a web browser to the resulting file 4 | 5 | output/index.html 6 | 7 | -------------------------------------------------------------------------------- /libnanostore2/libnanostore2-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'libnanostore2' target in the 'libnanostore2' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Examples/iTunesImporter/iTunesImporter_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'iTunesImporter' target in the 'iTunesImporter' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NanoStore.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UnitTestiOS/UnitTestiOS-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'UnitTestiOS' target in the 'UnitTestiOS' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Examples/iTunesImporter/iTunesImporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /fopenCompatibilityFix.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | FILE *fopen$UNIX2003( const char *filename, const char *mode ) 4 | { 5 | return fopen(filename, mode); 6 | } 7 | 8 | size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d ) 9 | { 10 | return fwrite(a, b, c, d); 11 | } -------------------------------------------------------------------------------- /XcodeCoverage/cleancov: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright 2012 Jonathan M. Reid. See LICENSE.txt 4 | # Created by: Jon Reid, http://qualitycoding.org/ 5 | # Source: https://github.com/jonreid/XcodeCoverage 6 | # 7 | 8 | source envcov.sh 9 | 10 | "${LCOV}" --zerocounters -d "${OBJ_DIR}" 11 | -------------------------------------------------------------------------------- /XcodeCoverage/exportenv.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012 Jonathan M. Reid. See LICENSE.txt 3 | # Created by: Jon Reid, http://qualitycoding.org/ 4 | # Source: https://github.com/jonreid/XcodeCoverage 5 | # 6 | 7 | export | egrep '( BUILT_PRODUCTS_DIR)|(CURRENT_ARCH)|(OBJECT_FILE_DIR_normal)|(SRCROOT)|(OBJROOT)' > XcodeCoverage/env.sh 8 | -------------------------------------------------------------------------------- /NanoStore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreSortTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreSortTests.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 3/30/08. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NanoStoreSortTests : XCTestCase 12 | { 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreGlobalsTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreGlobalsTests.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 4/18/12. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NanoStoreGlobalsTests : XCTestCase 12 | { 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoEngineTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoEngineTests.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 9/11/10. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NanoEngineTests : XCTestCase 12 | { 13 | NSDictionary *_defaultTestInfo; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreTests.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 3/12/08. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NanoStoreTests : XCTestCase 12 | { 13 | NSDictionary *_defaultTestInfo; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreBagTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreBagTests.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 10/15/10. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NanoStoreBagTests : XCTestCase 12 | { 13 | NSDictionary *_defaultTestInfo; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreObjectTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreObjectTests.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 10/14/10. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NanoStoreObjectTests : XCTestCase 12 | { 13 | NSDictionary *_defaultTestInfo; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreResultTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreResultTests.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 11/11/10. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NanoStoreResultTests : XCTestCase 12 | { 13 | NSDictionary *_defaultTestInfo; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreExpressionTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreExpressionTests.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 3/30/08. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NanoStoreExpressionTests : XCTestCase 12 | { 13 | NSDictionary *_defaultTestInfo; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/example/descriptions.txt: -------------------------------------------------------------------------------- 1 | test_noargs 2 | Example program is called without arguments so that default range 3 | [0..9] is used. 4 | 5 | test_2_to_2000 6 | Example program is called with "2" and "2000" as arguments. 7 | 8 | test_overflow 9 | Example program is called with "0" and "100000" as arguments. The 10 | resulting sum is too large to be stored as an int variable. 11 | -------------------------------------------------------------------------------- /Examples/iPhoneTest/iPhoneTest_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'iPhoneTest' target in the 'iPhoneTest' project 3 | // 4 | #import 5 | 6 | #ifndef __IPHONE_3_0 7 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 8 | #endif 9 | 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreSearchTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreSearchTests.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 10/4/08. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NanoStoreSearchTests : XCTestCase 12 | { 13 | NSDictionary *_defaultTestInfo; 14 | double _systemVersion; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Examples/iPhoneTest/Classes/RootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // iPhoneTest 4 | // 5 | // Created by Tito Ciuro on 24/08/10. 6 | // Copyright 2010 Webbo, L.L.C. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RootViewController : UITableViewController 12 | { 13 | NSMutableArray *values; 14 | } 15 | 16 | @property (nonatomic,retain) NSMutableArray *values; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /XcodeCoverage/envcov.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2012 Jonathan M. Reid. See LICENSE.txt 3 | # Created by: Jon Reid, http://qualitycoding.org/ 4 | # Source: https://github.com/jonreid/XcodeCoverage 5 | # 6 | 7 | source env.sh 8 | 9 | # Change the report name if you like: 10 | LCOV_INFO=Coverage.info 11 | 12 | LCOV_PATH=${SRCROOT}/XcodeCoverage/lcov-1.10/bin 13 | LCOV=${LCOV_PATH}/lcov 14 | OBJ_DIR=${OBJECT_FILE_DIR_normal}/${CURRENT_ARCH} 15 | -------------------------------------------------------------------------------- /Examples/iPhoneTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // iPhoneTest 4 | // 5 | // Created by Tito Ciuro on 24/08/10. 6 | // Copyright 2010 Webbo, L.L.C. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/TestClasses/NanoCarTestClass.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoCarTestClass.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 5/26/12. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "NSFNanoObjectProtocol.h" 12 | 13 | @interface NanoCarTestClass : NSObject 14 | 15 | @property (nonatomic, strong) NSString *name; 16 | @property (nonatomic, strong) NSString *key; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/TestClasses/NanoPersonTestClass.h: -------------------------------------------------------------------------------- 1 | // 2 | // NanoPersonTestClass.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 5/26/12. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "NSFNanoObject.h" 12 | 13 | extern NSString *NanoPersonFirst; 14 | extern NSString *NanoPersonLast; 15 | 16 | @interface NanoPersonTestClass : NSFNanoObject 17 | 18 | @property (nonatomic, strong) NSString *name; 19 | @property (nonatomic, strong) NSString *last; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /XcodeCoverage/env.sh: -------------------------------------------------------------------------------- 1 | export BUILT_PRODUCTS_DIR="/Users/tito/Library/Developer/Xcode/DerivedData/NanoStore-chlheinkmjvdasaibihjrkurjmxl/Build/Products/Debug" 2 | export CURRENT_ARCH="undefined_arch" 3 | export OBJECT_FILE_DIR_normal="/Users/tito/Library/Developer/Xcode/DerivedData/NanoStore-chlheinkmjvdasaibihjrkurjmxl/Build/Intermediates.noindex/NanoStore.build/Debug/NanoStore.build/Objects-normal" 4 | export OBJROOT="/Users/tito/Library/Developer/Xcode/DerivedData/NanoStore-chlheinkmjvdasaibihjrkurjmxl/Build/Intermediates.noindex" 5 | export SRCROOT="/Users/tito/Desktop/NanoStore" 6 | -------------------------------------------------------------------------------- /Examples/iPhoneTest/Classes/iPhoneTestAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // iPhoneTestAppDelegate.h 3 | // iPhoneTest 4 | // 5 | // Created by Tito Ciuro on 24/08/10. 6 | // Copyright 2010 Webbo, L.L.C. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface iPhoneTestAppDelegate : NSObject { 12 | 13 | UIWindow *window; 14 | UINavigationController *navigationController; 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | @property (nonatomic, retain) IBOutlet UINavigationController *navigationController; 19 | 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /NanoStore.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NanoStore", 3 | "version": "2.7.7", 4 | "license": "BSD", 5 | "summary": "NanoStore is an open source, lightweight schema-less local key-value document store written in Objective-C for Mac OS X and iOS.", 6 | "homepage": "https://github.com/tciuro/NanoStore", 7 | "authors": { 8 | "Tito Ciuro": "tciuro@mac.com" 9 | }, 10 | "source": { 11 | "git": "https://github.com/tciuro/NanoStore.git", 12 | "tag": "2.7.7" 13 | }, 14 | "source_files": "Classes/**/*.{h,m}", 15 | "platforms": { 16 | "ios": "5.0", 17 | "osx": "10.8" 18 | }, 19 | "libraries": "sqlite3", 20 | "requires_arc": true 21 | } 22 | -------------------------------------------------------------------------------- /Examples/iTunesImporter/iTunesImporter.xcodeproj/xcuserdata/tciuro.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | iTunesImporter.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8DD76F960486AA7600D96B5E 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /NanoStore.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'NanoStore' 3 | s.version = '2.8.0' 4 | s.license = 'BSD' 5 | s.summary = 'NanoStore is an open source, lightweight schema-less local key-value document store written in Objective-C for Mac OS X and iOS.' 6 | s.homepage = 'https://github.com/tciuro/NanoStore' 7 | s.authors = { 'Tito Ciuro' => 'tciuro@mac.com' } 8 | s.source = { :git => 'https://github.com/tciuro/NanoStore.git', :tag => s.version.to_s } 9 | s.source_files = 'Classes/**/*.{h,m}' 10 | s.ios.deployment_target = '5.0' 11 | s.osx.deployment_target = '10.8' 12 | 13 | s.library = 'sqlite3' 14 | s.requires_arc = true 15 | end -------------------------------------------------------------------------------- /UnitTestiOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /UnitTestMac/UnitTestMac-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /UnitTestiOS/UnitTestiOS-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Examples/iTunesImporter/iTunesImporter.xcodeproj/xcuserdata/tciuro.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/TestClasses/NanoCarTestClass.m: -------------------------------------------------------------------------------- 1 | // 2 | // NanoCarTestClass.m 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 5/26/12. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import "NanoCarTestClass.h" 10 | 11 | #define kName @"kName" 12 | 13 | @implementation NanoCarTestClass 14 | 15 | - (instancetype)initNanoObjectFromDictionaryRepresentation:(NSDictionary *)theDictionary forKey:(NSString *)aKey store:(NSFNanoStore *)theStore 16 | { 17 | if (self = [self init]) { 18 | _name = theDictionary[kName]; 19 | _key = aKey; 20 | } 21 | 22 | return self; 23 | } 24 | 25 | - (NSDictionary *)nanoObjectDictionaryRepresentation 26 | { 27 | return @{kName: _name}; 28 | } 29 | 30 | - (NSString *)nanoObjectKey 31 | { 32 | return self.key; 33 | } 34 | 35 | - (id)rootObject 36 | { 37 | return self; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Examples/iPhoneTest/iPhoneTest-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /XcodeCoverage/getcov: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright 2012 Jonathan M. Reid. See LICENSE.txt 4 | # Created by: Jon Reid, http://qualitycoding.org/ 5 | # Source: https://github.com/jonreid/XcodeCoverage 6 | # 7 | 8 | source envcov.sh 9 | 10 | remove_old_report() 11 | { 12 | pushd ${BUILT_PRODUCTS_DIR} 13 | if [ -e lcov ]; then 14 | rm -r lcov 15 | fi 16 | popd 17 | } 18 | 19 | enter_lcov_dir() 20 | { 21 | cd ${BUILT_PRODUCTS_DIR} 22 | mkdir lcov 23 | cd lcov 24 | } 25 | 26 | gather_coverage() 27 | { 28 | "${LCOV}" --capture -b "${SRCROOT}" -d "${OBJ_DIR}" -o ${LCOV_INFO} 29 | } 30 | 31 | exclude_data() 32 | { 33 | "${LCOV}" --remove ${LCOV_INFO} "/Applications/Xcode.app/*" -d "${OBJ_DIR}" -o ${LCOV_INFO} 34 | "${LCOV}" --remove ${LCOV_INFO} "main.m" -d "${OBJ_DIR}" -o ${LCOV_INFO} 35 | # Remove other patterns here... 36 | } 37 | 38 | generate_report() 39 | { 40 | "${LCOV_PATH}/genhtml" --output-directory . ${LCOV_INFO} 41 | open index.html 42 | } 43 | 44 | remove_old_report 45 | enter_lcov_dir 46 | gather_coverage 47 | exclude_data 48 | generate_report 49 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/TestClasses/NanoPersonTestClass.m: -------------------------------------------------------------------------------- 1 | // 2 | // NanoPersonTestClass.m 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 5/26/12. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import "NanoPersonTestClass.h" 10 | 11 | NSString *NanoPersonFirst = @"NanoPersonFirst"; 12 | NSString *NanoPersonLast = @"NanoPersonLast"; 13 | 14 | @implementation NanoPersonTestClass 15 | 16 | - (instancetype)initNanoObjectFromDictionaryRepresentation:(NSDictionary *)theDictionary forKey:(NSString *)aKey store:(NSFNanoStore *)theStore 17 | { 18 | if (self = [super initNanoObjectFromDictionaryRepresentation:nil forKey:aKey store:nil]) { 19 | _name = theDictionary[NanoPersonFirst]; 20 | _last = theDictionary[NanoPersonLast]; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | - (NSDictionary *)nanoObjectDictionaryRepresentation 27 | { 28 | return @{NanoPersonFirst: _name, 29 | NanoPersonLast: _last}; 30 | } 31 | 32 | - (NSString *)nanoObjectKey 33 | { 34 | return self.key; 35 | } 36 | 37 | - (id)rootObject 38 | { 39 | return self; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /XcodeCoverage/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2012 Jonathan M. Reid 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | the Software, and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | 21 | (MIT License) 22 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/example/methods/iterate.c: -------------------------------------------------------------------------------- 1 | /* 2 | * methods/iterate.c 3 | * 4 | * Calculate the sum of a given range of integer numbers. 5 | * 6 | * This particular method of implementation works by way of brute force, 7 | * i.e. it iterates over the entire range while adding the numbers to finally 8 | * get the total sum. As a positive side effect, we're able to easily detect 9 | * overflows, i.e. situations in which the sum would exceed the capacity 10 | * of an integer variable. 11 | * 12 | */ 13 | 14 | #include 15 | #include 16 | #include "iterate.h" 17 | 18 | 19 | int iterate_get_sum (int min, int max) 20 | { 21 | int i, total; 22 | 23 | total = 0; 24 | 25 | /* This is where we loop over each number in the range, including 26 | both the minimum and the maximum number. */ 27 | 28 | for (i = min; i <= max; i++) 29 | { 30 | /* We can detect an overflow by checking whether the new 31 | sum would become negative. */ 32 | 33 | if (total + i < total) 34 | { 35 | printf ("Error: sum too large!\n"); 36 | exit (1); 37 | } 38 | 39 | /* Everything seems to fit into an int, so continue adding. */ 40 | 41 | total += i; 42 | } 43 | 44 | return total; 45 | } 46 | -------------------------------------------------------------------------------- /.github/workflows/objc.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the action will run. Triggers the workflow on push or pull request 6 | # events but only for the master branch 7 | on: 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | 13 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 14 | jobs: 15 | # This workflow contains a single job called "build" 16 | build: 17 | # The type of runner that the job will run on 18 | runs-on: macOS-latest 19 | 20 | # Steps represent a sequence of tasks that will be executed as part of the job 21 | steps: 22 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 23 | - uses: actions/checkout@v2 24 | 25 | - name: Import Code-Signing Certificates 26 | uses: apple-actions/import-codesign-certs@v1 27 | with: 28 | p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} 29 | p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} 30 | 31 | # Runs a single command using the runners shell 32 | - name: Run tests 33 | run: xcodebuild test -project NanoStore.xcodeproj -scheme NanoStore -destination 'platform=macOS,arch=x86_64' 34 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoEngineTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // NanoEngineTests.h 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 9/11/10. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import "NanoStore.h" 10 | #import "NanoEngineTests.h" 11 | #import "NSFNanoStore_Private.h" 12 | 13 | @implementation NanoEngineTests 14 | 15 | - (void)setUp 16 | { 17 | [super setUp]; 18 | 19 | _defaultTestInfo = [NSFNanoStore _defaultTestData]; 20 | 21 | NSFSetIsDebugOn (NO); 22 | } 23 | 24 | - (void)tearDown 25 | { 26 | 27 | NSFSetIsDebugOn (NO); 28 | 29 | [super tearDown]; 30 | } 31 | 32 | #pragma mark - 33 | 34 | - (void)testMaxROWUID 35 | { 36 | NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil]; 37 | [nanoStore removeAllObjectsFromStoreAndReturnError:nil]; 38 | 39 | NSFNanoObject *obj1 = [NSFNanoObject nanoObjectWithDictionary:_defaultTestInfo]; 40 | NSFNanoObject *obj2 = [NSFNanoObject nanoObjectWithDictionary:_defaultTestInfo]; 41 | [nanoStore addObjectsFromArray:@[obj1, obj2] error:nil]; 42 | 43 | NSFNanoEngine *engine = nanoStore.nanoStoreEngine; 44 | long long maxRowUID = [engine maxRowUIDForTable:@"NSFKeys"]; 45 | 46 | [nanoStore closeWithError:nil]; 47 | 48 | XCTAssertTrue (maxRowUID == 2, @"Expected to find the max RowUID for the given table."); 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/bin/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # install.sh [--uninstall] sourcefile targetfile [install options] 4 | # 5 | 6 | 7 | # Check for uninstall option 8 | if test "x$1" == "x--uninstall" ; then 9 | UNINSTALL=true 10 | SOURCE=$2 11 | TARGET=$3 12 | shift 3 13 | else 14 | UNINSTALL=false 15 | SOURCE=$1 16 | TARGET=$2 17 | shift 2 18 | fi 19 | 20 | # Check usage 21 | if test -z "$SOURCE" || test -z "$TARGET" ; then 22 | echo Usage: install.sh [--uninstall] source target [install options] >&2 23 | exit 1 24 | fi 25 | 26 | 27 | # 28 | # do_install(SOURCE_FILE, TARGET_FILE) 29 | # 30 | 31 | do_install() 32 | { 33 | local SOURCE=$1 34 | local TARGET=$2 35 | local PARAMS=$3 36 | 37 | install -p -D $PARAMS $SOURCE $TARGET 38 | } 39 | 40 | 41 | # 42 | # do_uninstall(SOURCE_FILE, TARGET_FILE) 43 | # 44 | 45 | do_uninstall() 46 | { 47 | local SOURCE=$1 48 | local TARGET=$2 49 | 50 | # Does target exist? 51 | if test -r $TARGET ; then 52 | # Is target of the same version as this package? 53 | if diff $SOURCE $TARGET >/dev/null; then 54 | rm -f $TARGET 55 | else 56 | echo WARNING: Skipping uninstall for $TARGET - versions differ! >&2 57 | fi 58 | else 59 | echo WARNING: Skipping uninstall for $TARGET - not installed! >&2 60 | fi 61 | } 62 | 63 | 64 | # Call sub routine 65 | if $UNINSTALL ; then 66 | do_uninstall $SOURCE $TARGET 67 | else 68 | do_install $SOURCE $TARGET "$*" 69 | fi 70 | 71 | exit 0 72 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreResultTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreResultTests.m 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 11/11/10. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import "NanoStore.h" 10 | #import "NanoStore_Private.h" 11 | #import "NanoStoreResultTests.h" 12 | #import "NSFNanoStore_Private.h" 13 | 14 | @implementation NanoStoreResultTests 15 | 16 | - (void)setUp 17 | { 18 | [super setUp]; 19 | 20 | _defaultTestInfo = [NSFNanoStore _defaultTestData]; 21 | 22 | NSFSetIsDebugOn (NO); 23 | } 24 | 25 | - (void)tearDown 26 | { 27 | 28 | NSFSetIsDebugOn (NO); 29 | 30 | [super tearDown]; 31 | } 32 | 33 | #pragma mark - 34 | 35 | - (void)testResultNumberValueReturned 36 | { 37 | NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil]; 38 | [nanoStore removeAllObjectsFromStoreAndReturnError:nil]; 39 | 40 | [nanoStore addObjectsFromArray:@[[NSFNanoObject nanoObjectWithDictionary:[NSFNanoStore _defaultTestData]]] error:nil]; 41 | [nanoStore addObjectsFromArray:@[[NSFNanoObject nanoObjectWithDictionary:[NSFNanoStore _defaultTestData]]] error:nil]; 42 | 43 | NSFNanoResult *result = [nanoStore _executeSQL:@"SELECT NSFValue from NSFValues WHERE NSFAttribute = 'SomeNumber'"]; 44 | BOOL success = (nil == result.error); 45 | 46 | XCTAssertTrue (success == YES, @"Expected to find values without an error."); 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/example/methods/gauss.c: -------------------------------------------------------------------------------- 1 | /* 2 | * methods/gauss.c 3 | * 4 | * Calculate the sum of a given range of integer numbers. 5 | * 6 | * Somewhat of a more subtle way of calculation - and it even has a story 7 | * behind it: 8 | * 9 | * Supposedly during math classes in elementary school, the teacher of 10 | * young mathematician Gauss gave the class an assignment to calculate the 11 | * sum of all natural numbers between 1 and 100, hoping that this task would 12 | * keep the kids occupied for some time. The story goes that Gauss had the 13 | * result ready after only a few minutes. What he had written on his black 14 | * board was something like this: 15 | * 16 | * 1 + 100 = 101 17 | * 2 + 99 = 101 18 | * 3 + 98 = 101 19 | * . 20 | * . 21 | * 100 + 1 = 101 22 | * 23 | * s = (1/2) * 100 * 101 = 5050 24 | * 25 | * A more general form of this formula would be 26 | * 27 | * s = (1/2) * (max + min) * (max - min + 1) 28 | * 29 | * which is used in the piece of code below to implement the requested 30 | * function in constant time, i.e. without dependencies on the size of the 31 | * input parameters. 32 | * 33 | */ 34 | 35 | #include "gauss.h" 36 | 37 | 38 | int gauss_get_sum (int min, int max) 39 | { 40 | /* This algorithm doesn't work well with invalid range specifications 41 | so we're intercepting them here. */ 42 | if (max < min) 43 | { 44 | return 0; 45 | } 46 | 47 | return (int) ((max + min) * (double) (max - min + 1) / 2); 48 | } 49 | -------------------------------------------------------------------------------- /Classes/Advanced/NSFOrderedDictionary.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSFOrderedDictionary.h 3 | // OrderedDictionary 4 | // 5 | // Created by Matt Gallagher on 19/12/08. 6 | // Copyright 2008 Matt Gallagher. All rights reserved. 7 | // 8 | // v2 - ARC-compliant (Tito Ciuro) 9 | // v1 - Initial release (Matt Gallagher) 10 | // 11 | // This software is provided 'as-is', without any express or implied 12 | // warranty. In no event will the authors be held liable for any damages 13 | // arising from the use of this software. Permission is granted to anyone to 14 | // use this software for any purpose, including commercial applications, and to 15 | // alter it and redistribute it freely, subject to the following restrictions: 16 | // 17 | // 1. The origin of this software must not be misrepresented; you must not 18 | // claim that you wrote the original software. If you use this software 19 | // in a product, an acknowledgment in the product documentation would be 20 | // appreciated but is not required. 21 | // 2. Altered source versions must be plainly marked as such, and must not be 22 | // misrepresented as being the original software. 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | 27 | @interface NSFOrderedDictionary : NSMutableDictionary 28 | 29 | - (void)insertObject:(nonnull id)anObject forKey:(nonnull id)aKey atIndex:(NSUInteger)anIndex; 30 | - (nullable id)keyAtIndex:(NSUInteger)anIndex; 31 | @property (nonatomic, readonly, strong, nonnull) NSEnumerator *reverseKeyEnumerator; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Tito Ciuro, Webbo, L.L.C. All rights reserved. 2 | Redistribution and use in source and binary forms, with or without 3 | modification, are permitted provided that the following conditions are met: 4 | 5 | * Redistributions of source code must retain the above copyright notice, this 6 | list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, 8 | this list of conditions and the following disclaimer in the documentation 9 | and/or other materials provided with the distribution. 10 | * Neither the name of Tito Ciuro, Webbo, L.L.C. nor the names of its 11 | contributors may be used to endorse or promote products derived from this 12 | software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 17 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 18 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 24 | THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 25 | DAMAGE. 26 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/example/example.c: -------------------------------------------------------------------------------- 1 | /* 2 | * example.c 3 | * 4 | * Calculate the sum of a given range of integer numbers. The range is 5 | * specified by providing two integer numbers as command line argument. 6 | * If no arguments are specified, assume the predefined range [0..9]. 7 | * Abort with an error message if the resulting number is too big to be 8 | * stored as int variable. 9 | * 10 | * This program example is similar to the one found in the GCOV documentation. 11 | * It is used to demonstrate the HTML output generated by LCOV. 12 | * 13 | * The program is split into 3 modules to better demonstrate the 'directory 14 | * overview' function. There are also a lot of bloated comments inserted to 15 | * artificially increase the source code size so that the 'source code 16 | * overview' function makes at least a minimum of sense. 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include "iterate.h" 23 | #include "gauss.h" 24 | 25 | static int start = 0; 26 | static int end = 9; 27 | 28 | 29 | int main (int argc, char* argv[]) 30 | { 31 | int total1, total2; 32 | 33 | /* Accept a pair of numbers as command line arguments. */ 34 | 35 | if (argc == 3) 36 | { 37 | start = atoi(argv[1]); 38 | end = atoi(argv[2]); 39 | } 40 | 41 | 42 | /* Use both methods to calculate the result. */ 43 | 44 | total1 = iterate_get_sum (start, end); 45 | total2 = gauss_get_sum (start, end); 46 | 47 | 48 | /* Make sure both results are the same. */ 49 | 50 | if (total1 != total2) 51 | { 52 | printf ("Failure (%d != %d)!\n", total1, total2); 53 | } 54 | else 55 | { 56 | printf ("Success, sum[%d..%d] = %d\n", start, end, total1); 57 | } 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/man/gendesc.1: -------------------------------------------------------------------------------- 1 | .TH gendesc 1 "LCOV 1.10" 2012\-10\-10 "User Manuals" 2 | .SH NAME 3 | gendesc \- Generate a test case description file 4 | .SH SYNOPSIS 5 | .B gendesc 6 | .RB [ \-h | \-\-help ] 7 | .RB [ \-v | \-\-version ] 8 | .RS 8 9 | .br 10 | .RB [ \-o | \-\-output\-filename 11 | .IR filename ] 12 | .br 13 | .I inputfile 14 | .SH DESCRIPTION 15 | Convert plain text test case descriptions into a format as understood by 16 | .BR genhtml . 17 | .I inputfile 18 | needs to observe the following format: 19 | 20 | For each test case: 21 | .IP " \-" 22 | one line containing the test case name beginning at the start of the line 23 | .RE 24 | .IP " \-" 25 | one or more lines containing the test case description indented with at 26 | least one whitespace character (tab or space) 27 | .RE 28 | 29 | .B Example input file: 30 | 31 | test01 32 | .RS 33 | An example test case description. 34 | .br 35 | Description continued 36 | .RE 37 | 38 | test42 39 | .RS 40 | Supposedly the answer to most of your questions 41 | .RE 42 | 43 | Note: valid test names can consist of letters, decimal digits and the 44 | underscore character ('_'). 45 | .SH OPTIONS 46 | .B \-h 47 | .br 48 | .B \-\-help 49 | .RS 50 | Print a short help text, then exit. 51 | .RE 52 | 53 | .B \-v 54 | .br 55 | .B \-\-version 56 | .RS 57 | Print version number, then exit. 58 | .RE 59 | 60 | 61 | .BI "\-o " filename 62 | .br 63 | .BI "\-\-output\-filename " filename 64 | .RS 65 | Write description data to 66 | .IR filename . 67 | 68 | By default, output is written to STDOUT. 69 | .RE 70 | .SH AUTHOR 71 | Peter Oberparleiter 72 | 73 | .SH SEE ALSO 74 | .BR lcov (1), 75 | .BR genhtml (1), 76 | .BR geninfo (1), 77 | .BR genpng (1), 78 | .BR gcov (1) 79 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/rpm/lcov.spec: -------------------------------------------------------------------------------- 1 | Summary: A graphical GCOV front-end 2 | Name: lcov 3 | Version: 1.10 4 | Release: 1 5 | License: GPL 6 | Group: Development/Tools 7 | URL: http://ltp.sourceforge.net/coverage/lcov.php 8 | Source0: http://downloads.sourceforge.net/ltp/lcov-%{version}.tar.gz 9 | BuildRoot: /var/tmp/%{name}-%{version}-root 10 | BuildArch: noarch 11 | Requires: perl >= 5.8.8 12 | 13 | %description 14 | LCOV is a graphical front-end for GCC's coverage testing tool gcov. It collects 15 | gcov data for multiple source files and creates HTML pages containing the 16 | source code annotated with coverage information. It also adds overview pages 17 | for easy navigation within the file structure. 18 | 19 | %prep 20 | %setup -q -n lcov-%{version} 21 | 22 | %build 23 | exit 0 24 | 25 | %install 26 | rm -rf $RPM_BUILD_ROOT 27 | make install PREFIX=$RPM_BUILD_ROOT 28 | 29 | %clean 30 | rm -rf $RPM_BUILD_ROOT 31 | 32 | %files 33 | %defattr(-,root,root) 34 | /usr/bin 35 | /usr/share 36 | /etc 37 | 38 | %changelog 39 | * Mon May 07 2012 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com) 40 | - added dependency on perl 5.8.8 for >>& open mode support 41 | * Wed Aug 13 2008 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com) 42 | - changed description + summary text 43 | * Mon Aug 20 2007 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com) 44 | - fixed "Copyright" tag 45 | * Mon Jul 14 2003 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com) 46 | - removed variables for version/release to support source rpm building 47 | - added initial rm command in install section 48 | * Mon Apr 7 2003 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com) 49 | - implemented variables for version/release 50 | * Fri Oct 8 2002 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com) 51 | - created initial spec file 52 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/contrib/galaxy/README: -------------------------------------------------------------------------------- 1 | ------------------------------------------------- 2 | - README file for the LCOV galaxy mapping tool - 3 | - Last changes: 2003-09-04 - 4 | ------------------------------------------------- 5 | 6 | Description 7 | ----------- 8 | 9 | Further README contents 10 | ----------------------- 11 | 1. Included files 12 | 2. Installing 13 | 3. Notes and Comments 14 | 15 | 16 | 17 | 1. Important files 18 | ------------------ 19 | README - This README file 20 | CHANGES - List of changes between releases 21 | conglomerate_functions.pl - Replacement file - Generates shading 22 | genflat.pl - Generates info for shading from .info files 23 | gen_makefile.sh - Replacement file - updates to postscript 24 | posterize.pl - Replacement file - generates a final ps file 25 | 26 | 2. Installing 27 | ------------- 28 | This install requires fcgp, which means the target kernel src must be on 29 | the system creating the map. 30 | 31 | Download and copy the new files into the fcgp directory, (Note: its always 32 | a good idea to have backups). 33 | 34 | Run genflat.pl against your kernel info files 35 | ./genflat.pl kernel.info kernel2.info > coverage.dat 36 | 37 | Run the make command for the fcgp (Note: this can take a while) 38 | make KERNEL_DIR=/usr/src/linux 39 | 40 | Update posterize.pl as needed, normally page size, margins, titles. 41 | Most of these settings will be broken out as command line options in the future. 42 | 43 | Run posterize.pl this will generate the file poster.ps. 44 | 45 | 3. Notes and Comments 46 | --------------------- 47 | This is a quick and dirty implementation suited for my needs. It does not 48 | perform any of the tiling the original did. 49 | -------------------------------------------------------------------------------- /Classes/Private/NSFNanoPredicate_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoSearch_Private.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NanoStore.h" 28 | 29 | /** \cond */ 30 | 31 | @interface NSFNanoPredicate (Private) 32 | // Just a placeholder. 33 | @end 34 | 35 | /** \endcond */ -------------------------------------------------------------------------------- /Classes/Private/NSFNanoExpression_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoExpression_Private.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NSFNanoExpression.h" 28 | 29 | /** \cond */ 30 | 31 | @interface NSFNanoExpression (Private) 32 | - (nonnull NSArray *)arrayDescription; 33 | @end 34 | 35 | /** \endcond */ 36 | -------------------------------------------------------------------------------- /NanoStore.xcodeproj/xcshareddata/xcschemes/UnitTestiOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 37 | 38 | 44 | 45 | 47 | 48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Classes/Private/NanoStore_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | NanoStore_Private.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NSFNanoGlobals_Private.h" 28 | #import "NSFNanoSearch_Private.h" 29 | #import "NSFNanoResult_Private.h" 30 | #import "NSFNanoStore_Private.h" 31 | #import "NSFNanoBag_Private.h" 32 | #import "NSFNanoPredicate_Private.h" 33 | #import "NSFNanoExpression_Private.h" 34 | #import "NSFNanoGlobals_Private.h" 35 | #import "NSFNanoEngine_Private.h" 36 | #import "NSFNanoObject_Private.h" 37 | #import "NSFNanoStore_Private.h" -------------------------------------------------------------------------------- /Classes/Private/NSFNanoBag_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoBag_Private.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NSFNanoBag.h" 28 | 29 | /** \cond */ 30 | 31 | @interface NSFNanoBag (Private) 32 | @property (nonatomic, readwrite) BOOL hasUnsavedChanges; 33 | 34 | - (void)_setStore:(nonnull NSFNanoStore *)aStore; 35 | - (BOOL)_saveInStore:(nonnull NSFNanoStore *)someStore error:(NSError * _Nullable * _Nullable)outError; 36 | - (void)_inflateObjectsWithKeys:(nonnull NSArray *)someKeys; 37 | @end 38 | 39 | /** \endcond */ 40 | -------------------------------------------------------------------------------- /Classes/Private/NSFNanoResult_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoResult_Private.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NSFNanoResult.h" 28 | 29 | /** \cond */ 30 | 31 | @interface NSFNanoResult (Private) 32 | + (nonnull NSFNanoResult *)_resultWithDictionary:(nonnull NSDictionary *)results; 33 | + (nonnull NSFNanoResult *)_resultWithError:(nonnull NSError *)error; 34 | 35 | - (nonnull id)_initWithDictionary:(nonnull NSDictionary *)results; 36 | - (nonnull id)_initWithError:(nonnull NSError *)error; 37 | 38 | - (void)_setError:(nonnull NSError *)error; 39 | - (void)_reset; 40 | - (void)_calculateNumberOfRows; 41 | @end 42 | 43 | /** \endcond */ 44 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/man/genpng.1: -------------------------------------------------------------------------------- 1 | .TH genpng 1 "LCOV 1.10" 2012\-10\-10 "User Manuals" 2 | .SH NAME 3 | genpng \- Generate an overview image from a source file 4 | .SH SYNOPSIS 5 | .B genpng 6 | .RB [ \-h | \-\-help ] 7 | .RB [ \-v | \-\-version ] 8 | .RS 7 9 | .br 10 | .RB [ \-t | \-\-tab\-size 11 | .IR tabsize ] 12 | .RB [ \-w | \-\-width 13 | .IR width ] 14 | .br 15 | .RB [ \-o | \-\-output\-filename 16 | .IR output\-filename ] 17 | .br 18 | .IR source\-file 19 | .SH DESCRIPTION 20 | .B genpng 21 | creates an overview image for a given source code file of either 22 | plain text or .gcov file format. 23 | 24 | Note that the 25 | .I GD.pm 26 | Perl module has to be installed for this script to work 27 | (it may be obtained from 28 | .IR http://www.cpan.org ). 29 | 30 | Note also that 31 | .B genpng 32 | is called from within 33 | .B genhtml 34 | so that there is usually no need to call it directly. 35 | 36 | .SH OPTIONS 37 | .B \-h 38 | .br 39 | .B \-\-help 40 | .RS 41 | Print a short help text, then exit. 42 | .RE 43 | 44 | .B \-v 45 | .br 46 | .B \-\-version 47 | .RS 48 | Print version number, then exit. 49 | .RE 50 | 51 | .BI "\-t " tab\-size 52 | .br 53 | .BI "\-\-tab\-size " tab\-size 54 | .RS 55 | Use 56 | .I tab\-size 57 | spaces in place of tab. 58 | 59 | All occurrences of tabulator signs in the source code file will be replaced 60 | by the number of spaces defined by 61 | .I tab\-size 62 | (default is 4). 63 | .RE 64 | 65 | .BI "\-w " width 66 | .br 67 | .BI "\-\-width " width 68 | .RS 69 | Set width of output image to 70 | .I width 71 | pixel. 72 | 73 | The resulting image will be exactly 74 | .I width 75 | pixel wide (default is 80). 76 | 77 | Note that source code lines which are longer than 78 | .I width 79 | will be truncated. 80 | .RE 81 | 82 | 83 | .BI "\-o " filename 84 | .br 85 | .BI "\-\-output\-filename " filename 86 | .RS 87 | Write image to 88 | .IR filename . 89 | 90 | Specify a name for the resulting image file (default is 91 | .IR source\-file .png). 92 | .RE 93 | .SH AUTHOR 94 | Peter Oberparleiter 95 | 96 | .SH SEE ALSO 97 | .BR lcov (1), 98 | .BR genhtml (1), 99 | .BR geninfo (1), 100 | .BR gendesc (1), 101 | .BR gcov (1) 102 | -------------------------------------------------------------------------------- /XcodeCoverage/README.md: -------------------------------------------------------------------------------- 1 | These scripts provide a simple way to generate HTML reports of the code coverage 2 | of your Xcode 4.5 project. 3 | For a detailed blog post, see http://qualitycoding.org/xcode-code-coverage/ 4 | 5 | 6 | Installation 7 | ============ 8 | 9 | 1. Fork this repository; you're probably going to want to make your own 10 | modifications. 11 | 2. Place the XcodeCoverage folder in the same folder as your Xcode project. 12 | 3. [Dowload lcov-1.10](http://downloads.sourceforge.net/ltp/lcov-1.10.tar.gz). 13 | Place the lcov-1.10 folder inside the XcodeCoverage folder. 14 | 4. Get Xcode's coverage instrumentation by going to Xcode Preferences, into Downloads, and installing Command Line Tools. 15 | 5. In your Xcode project, enable these two build settings at the project level 16 | for your Debug configuration only: 17 | * Instrument Program Flow 18 | * Generate Test Coverage Files 19 | 6. In your main target, add a Run Script build phase to execute 20 | ``XcodeCoverage/exportenv.sh`` 21 | 22 | A few people have been tripped up by the last step: Make sure you add the 23 | script to your main target (your app or library), not your test target. 24 | 25 | 26 | Execution 27 | ========= 28 | 29 | 1. Run your unit tests 30 | 2. In Terminal, cd to your project's XcodeCoverage folder, then 31 | 32 | $ ./getcov 33 | 34 | If you make changes to your test code without changing the production code and 35 | want a clean slate, use the ``cleancov`` script: 36 | 37 | $ ./cleancov 38 | 39 | If you make changes to your production code, you should clear out all build 40 | artifacts before measuring code coverage again. "Clean Build Folder" by holding 41 | down the Option key in Xcode's "Product" menu. 42 | 43 | 44 | Modification 45 | ============ 46 | 47 | There are two places you may want to modify: 48 | 49 | 1. In envcov.sh, ``LCOV_INFO`` determines the name shown in the report. 50 | 2. In getcov, edit ``exclude_data()`` to specify which files to exclude, for 51 | example, third-party libraries. 52 | 53 | 54 | More resources 55 | ============== 56 | 57 | * [Sources](https://github.com/jonreid/XcodeCoverage) 58 | * Testing tools: [OCHamcrest](https://github.com/hamcrest/OCHamcrest), 59 | [OCMockito](https://github.com/jonreid/OCMockito), 60 | [JMRTestTools](https://github.com/jonreid/JMRTestTools) 61 | * [Quality Coding](http://qualitycoding.org/) blog - Tools, tips & techniques 62 | for _building quality in_ to iOS development 63 | -------------------------------------------------------------------------------- /Classes/Private/NSFNanoObject_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoObject_Private.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NSFNanoObject.h" 28 | 29 | /** \cond */ 30 | 31 | @interface NSFNanoObject () 32 | @property (nonatomic, readwrite, nullable) NSFNanoStore *store; 33 | @property (nonatomic, copy, readwrite, nullable) NSString *key; 34 | @property (nonatomic, readwrite) BOOL hasUnsavedChanges; 35 | 36 | - (void)_setOriginalClassString:(nullable NSString *)theClassString; 37 | + (nonnull NSString *)_NSObjectToJSONString:(nonnull id)object error:(NSError * _Nullable * _Nullable)error; 38 | + (nonnull NSDictionary *)_safeDictionaryFromDictionary:(nonnull NSDictionary *)dictionary; 39 | + (nonnull NSArray *)_safeArrayFromArray:(nonnull NSArray *)array; 40 | + (nonnull id)_safeObjectFromObject:(nonnull id)object; 41 | @end 42 | 43 | /** \endcond */ 44 | -------------------------------------------------------------------------------- /NanoStore.xcodeproj/xcshareddata/xcschemes/Universal.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /NanoStore.xcodeproj/xcshareddata/xcschemes/libnanostore2.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /NanoStore.xcodeproj/xcshareddata/xcschemes/UnitTestMac.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | 36 | 42 | 43 | 44 | 45 | 46 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/example/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for the LCOV example program. 3 | # 4 | # Make targets: 5 | # - example: compile the example program 6 | # - output: run test cases on example program and create HTML output 7 | # - clean: clean up directory 8 | # 9 | 10 | CC := gcc 11 | CFLAGS := -Wall -I. -fprofile-arcs -ftest-coverage 12 | 13 | LCOV := ../bin/lcov 14 | GENHTML := ../bin/genhtml 15 | GENDESC := ../bin/gendesc 16 | GENPNG := ../bin/genpng 17 | 18 | # Depending on the presence of the GD.pm perl module, we can use the 19 | # special option '--frames' for genhtml 20 | USE_GENPNG := $(shell $(GENPNG) --help >/dev/null 2>/dev/null; echo $$?) 21 | 22 | ifeq ($(USE_GENPNG),0) 23 | FRAMES := --frames 24 | else 25 | FRAMES := 26 | endif 27 | 28 | .PHONY: clean output test_noargs test_2_to_2000 test_overflow 29 | 30 | all: output 31 | 32 | example: example.o iterate.o gauss.o 33 | $(CC) example.o iterate.o gauss.o -o example -lgcov 34 | 35 | example.o: example.c iterate.h gauss.h 36 | $(CC) $(CFLAGS) -c example.c -o example.o 37 | 38 | iterate.o: methods/iterate.c iterate.h 39 | $(CC) $(CFLAGS) -c methods/iterate.c -o iterate.o 40 | 41 | gauss.o: methods/gauss.c gauss.h 42 | $(CC) $(CFLAGS) -c methods/gauss.c -o gauss.o 43 | 44 | output: example descriptions test_noargs test_2_to_2000 test_overflow 45 | @echo 46 | @echo '*' 47 | @echo '* Generating HTML output' 48 | @echo '*' 49 | @echo 50 | $(GENHTML) trace_noargs.info trace_args.info trace_overflow.info \ 51 | --output-directory output --title "Basic example" \ 52 | --show-details --description-file descriptions $(FRAMES) \ 53 | --legend 54 | @echo 55 | @echo '*' 56 | @echo '* See '`pwd`/output/index.html 57 | @echo '*' 58 | @echo 59 | 60 | descriptions: descriptions.txt 61 | $(GENDESC) descriptions.txt -o descriptions 62 | 63 | all_tests: example test_noargs test_2_to_2000 test_overflow 64 | 65 | test_noargs: 66 | @echo 67 | @echo '*' 68 | @echo '* Test case 1: running ./example without parameters' 69 | @echo '*' 70 | @echo 71 | $(LCOV) --zerocounters --directory . 72 | ./example 73 | $(LCOV) --capture --directory . --output-file trace_noargs.info --test-name test_noargs --no-external 74 | 75 | test_2_to_2000: 76 | @echo 77 | @echo '*' 78 | @echo '* Test case 2: running ./example 2 2000' 79 | @echo '*' 80 | @echo 81 | $(LCOV) --zerocounters --directory . 82 | ./example 2 2000 83 | $(LCOV) --capture --directory . --output-file trace_args.info --test-name test_2_to_2000 --no-external 84 | 85 | test_overflow: 86 | @echo 87 | @echo '*' 88 | @echo '* Test case 3: running ./example 0 100000 (causes an overflow)' 89 | @echo '*' 90 | @echo 91 | $(LCOV) --zerocounters --directory . 92 | ./example 0 100000 || true 93 | $(LCOV) --capture --directory . --output-file trace_overflow.info --test-name "test_overflow" --no-external 94 | 95 | clean: 96 | rm -rf *.o *.bb *.bbg *.da *.gcno *.gcda *.info output example \ 97 | descriptions 98 | 99 | -------------------------------------------------------------------------------- /Examples/iPhoneTest/Classes/iPhoneTestAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // iPhoneTestAppDelegate.m 3 | // iPhoneTest 4 | // 5 | // Created by Tito Ciuro on 24/08/10. 6 | // Copyright 2010 Webbo, L.L.C. All rights reserved. 7 | // 8 | 9 | #import "iPhoneTestAppDelegate.h" 10 | #import "RootViewController.h" 11 | 12 | 13 | @implementation iPhoneTestAppDelegate 14 | 15 | @synthesize window; 16 | @synthesize navigationController; 17 | 18 | 19 | #pragma mark - 20 | #pragma mark Application lifecycle 21 | 22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 23 | 24 | // Override point for customization after application launch. 25 | 26 | // Add the navigation controller's view to the window and display. 27 | [window addSubview:navigationController.view]; 28 | [window makeKeyAndVisible]; 29 | 30 | return YES; 31 | } 32 | 33 | 34 | - (void)applicationWillResignActive:(UIApplication *)application { 35 | /* 36 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 37 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 38 | */ 39 | } 40 | 41 | 42 | - (void)applicationDidEnterBackground:(UIApplication *)application { 43 | /* 44 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 45 | If your application supports background execution, called instead of applicationWillTerminate: when the user quits. 46 | */ 47 | } 48 | 49 | 50 | - (void)applicationWillEnterForeground:(UIApplication *)application { 51 | /* 52 | Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. 53 | */ 54 | } 55 | 56 | 57 | - (void)applicationDidBecomeActive:(UIApplication *)application { 58 | /* 59 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 60 | */ 61 | } 62 | 63 | 64 | - (void)applicationWillTerminate:(UIApplication *)application { 65 | /* 66 | Called when the application is about to terminate. 67 | See also applicationDidEnterBackground:. 68 | */ 69 | } 70 | 71 | 72 | #pragma mark - 73 | #pragma mark Memory management 74 | 75 | - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { 76 | /* 77 | Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. 78 | */ 79 | } 80 | 81 | 82 | - (void)dealloc { 83 | [navigationController release]; 84 | [window release]; 85 | [super dealloc]; 86 | } 87 | 88 | 89 | @end 90 | 91 | -------------------------------------------------------------------------------- /Examples/iTunesImporter/iTunesImporter.xcodeproj/xcuserdata/tciuro.xcuserdatad/xcschemes/iTunesImporter.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /NanoStore.xcodeproj/xcshareddata/xcschemes/NanoStore.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 54 | 60 | 61 | 62 | 63 | 69 | 70 | 72 | 73 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Classes/Private/NSFNanoSearch_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoSearch_Private.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NanoStore.h" 28 | 29 | /** \cond */ 30 | 31 | @interface NSFNanoSearch (Private) 32 | - (nullable NSDictionary *)_retrieveDataWithError:(NSError * _Nullable * _Nullable)outError; 33 | - (nullable NSDictionary *)_retrieveDataAdded:(NSFDateMatchType)aDateMatch calendarDate:(nonnull NSDate *)aDate error:(NSError * _Nullable * _Nullable)outError; 34 | @property (nonatomic, readonly, copy, nonnull) NSString *_preparedSQL; 35 | - (nonnull NSString *)_prepareSQLQueryStringWithKey:(nullable NSString *)aKey attribute:(nullable NSString *)anAttribute value:(nullable id)aValue matching:(NSFMatchType)match; 36 | - (nonnull NSString *)_prepareSQLQueryStringWithExpressions:(nonnull NSArray *)someExpressions; 37 | - (nonnull NSArray *)_resultsFromSQLQuery:(nonnull NSString *)theSQLStatement; 38 | + (nonnull NSString *)_prepareSQLQueryStringWithKeys:(nonnull NSArray *)someKeys; 39 | + (nonnull NSString *)_querySegmentForColumn:(nonnull NSString *)aColumn value:(nonnull id)aValue matching:(NSFMatchType)match; 40 | + (nonnull NSString *)_querySegmentForAttributeColumnWithValue:(nonnull id)anAttributeValue matching:(NSFMatchType)match valueColumnWithValue:(nullable id)aValue; 41 | - (nonnull NSDictionary *)_dictionaryForKeyPath:(nonnull NSString *)keyPath value:(nonnull id)value; 42 | + (nonnull NSString *)_quoteStrings:(nonnull NSArray *)strings joiningWithDelimiter:(nonnull NSString *)delimiter; 43 | - (nonnull id)_sortResultsIfApplicable:(nonnull NSDictionary *)results returnType:(NSFReturnType)theReturnType; 44 | @end 45 | 46 | /** \endcond */ 47 | -------------------------------------------------------------------------------- /Examples/iTunesImporter/iTunesImporter.1: -------------------------------------------------------------------------------- 1 | .\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. 2 | .\"See Also: 3 | .\"man mdoc.samples for a complete listing of options 4 | .\"man mdoc for the short list of editing options 5 | .\"/usr/share/misc/mdoc.template 6 | .Dd 1/16/11 \" DATE 7 | .Dt iTunesImporter 1 \" Program name and manual section number 8 | .Os Darwin 9 | .Sh NAME \" Section Header - required - don't modify 10 | .Nm iTunesImporter, 11 | .\" The following lines are read in generating the apropos(man -k) database. Use only key 12 | .\" words here as the database is built based on the words here and in the .ND line. 13 | .Nm Other_name_for_same_program(), 14 | .Nm Yet another name for the same program. 15 | .\" Use .Nm macro to designate other names for the documented program. 16 | .Nd This line parsed for whatis database. 17 | .Sh SYNOPSIS \" Section Header - required - don't modify 18 | .Nm 19 | .Op Fl abcd \" [-abcd] 20 | .Op Fl a Ar path \" [-a path] 21 | .Op Ar file \" [file] 22 | .Op Ar \" [file ...] 23 | .Ar arg0 \" Underlined argument - use .Ar anywhere to underline 24 | arg2 ... \" Arguments 25 | .Sh DESCRIPTION \" Section Header - required - don't modify 26 | Use the .Nm macro to refer to your program throughout the man page like such: 27 | .Nm 28 | Underlining is accomplished with the .Ar macro like this: 29 | .Ar underlined text . 30 | .Pp \" Inserts a space 31 | A list of items with descriptions: 32 | .Bl -tag -width -indent \" Begins a tagged list 33 | .It item a \" Each item preceded by .It macro 34 | Description of item a 35 | .It item b 36 | Description of item b 37 | .El \" Ends the list 38 | .Pp 39 | A list of flags and their descriptions: 40 | .Bl -tag -width -indent \" Differs from above in tag removed 41 | .It Fl a \"-a flag as a list item 42 | Description of -a flag 43 | .It Fl b 44 | Description of -b flag 45 | .El \" Ends the list 46 | .Pp 47 | .\" .Sh ENVIRONMENT \" May not be needed 48 | .\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 49 | .\" .It Ev ENV_VAR_1 50 | .\" Description of ENV_VAR_1 51 | .\" .It Ev ENV_VAR_2 52 | .\" Description of ENV_VAR_2 53 | .\" .El 54 | .Sh FILES \" File used or created by the topic of the man page 55 | .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact 56 | .It Pa /usr/share/file_name 57 | FILE_1 description 58 | .It Pa /Users/joeuser/Library/really_long_file_name 59 | FILE_2 description 60 | .El \" Ends the list 61 | .\" .Sh DIAGNOSTICS \" May not be needed 62 | .\" .Bl -diag 63 | .\" .It Diagnostic Tag 64 | .\" Diagnostic informtion here. 65 | .\" .It Diagnostic Tag 66 | .\" Diagnostic informtion here. 67 | .\" .El 68 | .Sh SEE ALSO 69 | .\" List links in ascending order by section, alphabetically within a section. 70 | .\" Please do not reference files that do not exist without filing a bug report 71 | .Xr a 1 , 72 | .Xr b 1 , 73 | .Xr c 1 , 74 | .Xr a 2 , 75 | .Xr b 2 , 76 | .Xr a 3 , 77 | .Xr b 3 78 | .\" .Sh BUGS \" Document known, unremedied bugs 79 | .\" .Sh HISTORY \" Document history if command behaves in a unique manner -------------------------------------------------------------------------------- /Examples/iTunesImporter/iTunesImporter.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "NanoStore.h" 3 | 4 | void importDataUsingNanoStore(NSDictionary *iTunesInfo); 5 | 6 | int main (int argc, const char * argv[]) { 7 | NSAutoreleasePool * pool = [NSAutoreleasePool new]; 8 | NSString *iTunesXMLPath = @"~/Music/iTunes/iTunes Music Library.xml"; 9 | NSUInteger executionResult = 0; 10 | 11 | if (argc > 1) { 12 | iTunesXMLPath = [NSString stringWithUTF8String:argv[1]]; 13 | } 14 | 15 | // Expand the tilde 16 | iTunesXMLPath = [iTunesXMLPath stringByExpandingTildeInPath]; 17 | 18 | // Read the iTunes XML plist 19 | NSFileManager *fm = [NSFileManager defaultManager]; 20 | if (YES == [fm fileExistsAtPath:iTunesXMLPath]) { 21 | NSDictionary *iTunesInfo = [NSDictionary dictionaryWithContentsOfFile:iTunesXMLPath]; 22 | NSUInteger numOfTracks = [[iTunesInfo objectForKey:@"Tracks"]count]; 23 | 24 | NSLog(@"There are %ld items in the iTunes XML file", numOfTracks); 25 | 26 | importDataUsingNanoStore(iTunesInfo); 27 | 28 | } else { 29 | executionResult = 1; 30 | NSLog(@"The file iTunes XML file doesn't exist at path: %@", iTunesXMLPath); 31 | } 32 | 33 | [pool drain]; 34 | return executionResult; 35 | } 36 | 37 | void importDataUsingNanoStore(NSDictionary *iTunesInfo) 38 | { 39 | // Instantiate a NanoStore and open it 40 | NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil]; 41 | 42 | // Configure NanoStore 43 | NSFSetIsDebugOn(YES); 44 | NSUInteger saveInterval = 1000; 45 | [nanoStore setSaveInterval:saveInterval]; 46 | 47 | NSDictionary *tracks = [iTunesInfo objectForKey:@"Tracks"]; 48 | NSDate *startStoringDate = [NSDate date]; 49 | NSMutableArray *keys = [NSMutableArray arrayWithCapacity:[tracks count]]; 50 | 51 | NSAutoreleasePool *pool = [NSAutoreleasePool new]; 52 | NSUInteger iterations = 0; 53 | 54 | for (NSString *trackID in tracks) { 55 | // Generate an empty NanoObject 56 | NSFNanoObject *object = [NSFNanoObject nanoObjectWithDictionary:[tracks objectForKey:trackID]]; 57 | 58 | [keys addObject:object.key]; 59 | 60 | // Collect the object 61 | [nanoStore addObject:object error:nil]; 62 | iterations++; 63 | 64 | // Drain the memory every 'saveInterval' iterations 65 | if (0 == iterations%saveInterval) { 66 | [pool drain]; 67 | pool = [NSAutoreleasePool new]; 68 | } 69 | } 70 | 71 | // Don't forget that some objects could be lingering in memory. Force a save. 72 | [nanoStore saveStoreAndReturnError:nil]; 73 | 74 | NSTimeInterval secondsStoring = [[NSDate date]timeIntervalSinceDate:startStoringDate]; 75 | NSLog(@"Done importing. Storing the objects took %.3f seconds.", secondsStoring); 76 | 77 | NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore]; 78 | NSUInteger numImportedItems = [[search aggregateOperation:NSFCount onAttribute:@"Track ID"]longValue]; 79 | NSLog(@"Number of items imported: %ld", numImportedItems); 80 | 81 | startStoringDate = [NSDate date]; 82 | [nanoStore removeObjectsWithKeysInArray:keys error:nil]; 83 | secondsStoring = [[NSDate date]timeIntervalSinceDate:startStoringDate]; 84 | NSLog(@"Done removing. Removing the objects took %.3f seconds.", secondsStoring); 85 | 86 | [pool drain]; 87 | 88 | // Close the document store 89 | [nanoStore closeWithError:nil]; 90 | } -------------------------------------------------------------------------------- /Classes/Private/NSFNanoEngine_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NSFNanoEngine_Private.h 3 | * A lightweight Cocoa wrapper for SQLite 4 | * 5 | * Written by Tito Ciuro (21-Jan-2003) 6 | 7 | Copyright (c) 2004, Tito Ciuro 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without modification, are permitted 11 | provided that the following conditions are met: 12 | 13 | • Redistributions of source code must retain the above copyright notice, this list of conditions 14 | and the following disclaimer. 15 | • Redistributions in binary form must reproduce the above copyright notice, this list of conditions 16 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 17 | • Neither the name of Tito Ciuro nor the names of its contributors may be used to endorse or promote 18 | products derived from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 21 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 22 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | SUCH DAMAGE. 28 | */ 29 | 30 | #import "NSFNanoEngine.h" 31 | #import "NSFNanoGlobals_Private.h" 32 | #import "NSFNanoResult.h" 33 | #import "NSFOrderedDictionary.h" 34 | 35 | /** \cond */ 36 | 37 | @interface NSFNanoEngine (Private) 38 | - (nonnull NSFOrderedDictionary *)dictionaryDescription; 39 | + (nonnull NSArray *)NSFP_sharedROWIDKeywords; 40 | @property (nonatomic, readonly, copy, nonnull ) NSString *NSFP_cacheMethodToString; 41 | - (nonnull NSString *)NSFP_nestedDescriptionWithPrefixedSpace:(nonnull NSString *)prefixedSpace; 42 | + (nullable NSDictionary *)_plistToDictionary:(nonnull NSString *)aPlist; 43 | + (void)NSFP_decodeQuantum:(unsigned char * _Nonnull)dest andSource:(const char * _Nonnull)src; 44 | @property (nonatomic, readonly, copy, nonnull) NSArray *NSFP_flattenAllTables; 45 | - (NSInteger)NSFP_prepareSQLite3Statement:(sqlite3_stmt * _Nonnull * _Nonnull)aStatement theSQLStatement:(nonnull NSString *)aSQLQuery; 46 | + (int)NSFP_stripBitsFromExtendedResultCode:(int)extendedResult; 47 | 48 | - (BOOL)NSFP_beginTransactionMode:(nonnull NSString *)theSQLStatement; 49 | - (BOOL)NSFP_createTable:(nonnull NSString *)table withColumns:(nonnull NSArray *)tableColumns datatypes:(nonnull NSArray *)tableDatatypes isTemporary:(BOOL)isTemporaryFlag; 50 | - (BOOL)NSFP_removeColumn:(nonnull NSString *)column fromTable:(nonnull NSString *)table; 51 | - (void)NSFP_rebuildDatatypeCache; 52 | - (BOOL)NSFP_insertStringValues:(nonnull NSArray *)values forColumns:(nonnull NSArray *)columns table:(nonnull NSString *)table; 53 | 54 | - (void)NSFP_sqlString:(nonnull NSMutableString *)theSQLStatement appendingTags:(nonnull NSArray *)tags quoteTags:(BOOL)flag; 55 | - (void)NSFP_sqlString:(nonnull NSMutableString *)theSQLStatement appendingTags:(nonnull NSArray *)columns; 56 | - (BOOL)NSFP_sqlString:(nonnull NSMutableString *)theSQLStatement forTable:(nonnull NSString *)table withColumns:(nonnull NSArray *)columns datatypes:(nonnull NSArray *)datatypes; 57 | 58 | - (NSInteger)NSFP_ROWIDPresenceLocation:(nonnull NSArray *)tableColumns datatypes:(nonnull NSArray *)datatypes; 59 | 60 | - (nonnull NSString *)NSFP_prefixWithDotDelimiter:(nonnull NSString *)tableAndColumn; 61 | - (nonnull NSString *)NSFP_suffixWithDotDelimiter:(nonnull NSString *)tableAndColumn; 62 | 63 | - (void)NSFP_installCommitCallback; 64 | - (void)NSFP_uninstallCommitCallback; 65 | @end 66 | 67 | /** \endcond */ 68 | -------------------------------------------------------------------------------- /Classes/Public/NSFNanoSortDescriptor.m: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoSortDescriptor.m 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NSFNanoSortDescriptor.h" 28 | #import "NSFNanoGlobals.h" 29 | #import "NSFOrderedDictionary.h" 30 | #import "NSFNanoObject_Private.h" 31 | 32 | @interface NSFNanoSortDescriptor () 33 | 34 | /** \cond */ 35 | @property (nonatomic, copy, readwrite) NSString *attribute; 36 | @property (nonatomic, readwrite) BOOL isAscending; 37 | /** \endcond */ 38 | 39 | @end 40 | 41 | @implementation NSFNanoSortDescriptor 42 | 43 | + (NSFNanoSortDescriptor *)sortDescriptorWithAttribute:(NSString *)theAttribute ascending:(BOOL)ascending 44 | { 45 | return [[self alloc]initWithAttribute:theAttribute ascending:ascending]; 46 | } 47 | 48 | - (instancetype)init 49 | { 50 | #pragma clang diagnostic push 51 | #pragma clang diagnostic ignored "-Wnonnull" 52 | return [self initWithAttribute:nil ascending:NO]; 53 | #pragma clang diagnostic pop 54 | } 55 | 56 | - (instancetype)initWithAttribute:(NSString *)theAttribute ascending:(BOOL)ascending 57 | { 58 | if (theAttribute.length == 0) 59 | [[NSException exceptionWithName:NSFUnexpectedParameterException 60 | reason:[NSString stringWithFormat:@"*** -[%@ %@]: theAttribute is invalid.", [self class], NSStringFromSelector(_cmd)] 61 | userInfo:nil]raise]; 62 | 63 | if ((self = [super init])) { 64 | _attribute = theAttribute; 65 | _isAscending = ascending; 66 | } 67 | 68 | return self; 69 | } 70 | 71 | /** \cond */ 72 | 73 | 74 | /** \endcond */ 75 | 76 | #pragma mark - 77 | 78 | - (NSString *)description 79 | { 80 | return [self JSONDescription]; 81 | } 82 | 83 | - (NSFOrderedDictionary *)dictionaryDescription 84 | { 85 | NSFOrderedDictionary *values = [NSFOrderedDictionary new]; 86 | 87 | values[@"Sort descriptor address"] = [NSString stringWithFormat:@"%p", self]; 88 | values[@"Attribute"] = _attribute; 89 | values[@"Is ascending?"] = (_isAscending ? @"YES" : @"NO"); 90 | 91 | return values; 92 | } 93 | 94 | - (NSString *)JSONDescription 95 | { 96 | NSFOrderedDictionary *values = [self dictionaryDescription]; 97 | 98 | NSError *outError = nil; 99 | NSString *description = [NSFNanoObject _NSObjectToJSONString:values error:&outError]; 100 | 101 | return description; 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /Classes/Private/NSFNanoGlobals_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoGlobals_Private.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import 28 | #import "NSFNanoGlobals.h" 29 | 30 | /** \cond */ 31 | 32 | /* 33 | The following types are supported by Property Lists: 34 | 35 | CFArray 36 | CFDictionary 37 | CFData 38 | CFString 39 | CFDate 40 | CFNumber 41 | CFBoolean 42 | 43 | Since NanoStore associates an attribute with an atomic value (i.e. non-collection), 44 | the following data types are recognized: 45 | 46 | CFData 47 | CFString 48 | CFDate 49 | CFNumber 50 | 51 | Note: there isn't a dedicated data type homologous to CFBoolean in Cocoa. Therefore, 52 | NSNumber will be used for that purpose. 53 | 54 | */ 55 | 56 | extern NSDictionary * safeJSONDictionaryFromDictionary (NSDictionary *dictionary); 57 | extern NSArray * safeJSONArrayFromArray (NSArray *array); 58 | extern id safeJSONObjectFromObject (id object); 59 | 60 | extern NSString * NSFStringFromMatchType (NSFMatchType aMatchType); 61 | 62 | extern void _NSFLog (NSString *format, ...); 63 | 64 | extern NSString * const NSFVersionKey; 65 | extern NSString * const NSFDomainKey; 66 | 67 | extern NSString * const NSFKeys; 68 | extern NSString * const NSFValues; 69 | extern NSString * const NSFKey; 70 | extern NSString * const NSFValue; 71 | extern NSString * const NSFDatatype; 72 | extern NSString * const NSFCalendarDate; 73 | extern NSString * const NSFObjectClass; 74 | extern NSString * const NSFKeyedArchive; 75 | extern NSString * const NSFAttribute; 76 | 77 | #pragma mark - 78 | 79 | extern NSString * const NSF_Private_NSFKeys_NSFKey; 80 | extern NSString * const NSF_Private_NSFKeys_NSFKeyedArchive; 81 | extern NSString * const NSF_Private_NSFValues_NSFKey; 82 | extern NSString * const NSF_Private_NSFValues_NSFAttribute; 83 | extern NSString * const NSF_Private_NSFValues_NSFValue; 84 | extern NSString * const NSF_Private_NSFNanoBag_Name; 85 | extern NSString * const NSF_Private_NSFNanoBag_NSFKey; 86 | extern NSString * const NSF_Private_NSFNanoBag_NSFObjectKeys; 87 | extern NSString * const NSF_Private_ToDeleteTableKey; 88 | 89 | extern NSInteger const NSF_Private_InvalidParameterDataCodeKey; 90 | extern NSInteger const NSF_Private_MacOSXErrorCodeKey; 91 | 92 | #pragma mark - 93 | 94 | extern NSString * const NSFP_TableIdentifier; 95 | extern NSString * const NSFP_ColumnIdentifier; 96 | extern NSString * const NSFP_DatatypeIdentifier; 97 | 98 | extern NSString * const NSFRowIDColumnName; // SQLite's standard UID property 99 | 100 | /** \endcond */ -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for LCOV 3 | # 4 | # Make targets: 5 | # - install: install LCOV tools and man pages on the system 6 | # - uninstall: remove tools and man pages from the system 7 | # - dist: create files required for distribution, i.e. the lcov.tar.gz 8 | # and the lcov.rpm file. Just make sure to adjust the VERSION 9 | # and RELEASE variables below - both version and date strings 10 | # will be updated in all necessary files. 11 | # - clean: remove all generated files 12 | # 13 | 14 | VERSION := 1.10 15 | RELEASE := 1 16 | 17 | CFG_DIR := $(PREFIX)/etc 18 | BIN_DIR := $(PREFIX)/usr/bin 19 | MAN_DIR := $(PREFIX)/usr/share/man 20 | TMP_DIR := /tmp/lcov-tmp.$(shell echo $$$$) 21 | FILES := $(wildcard bin/*) $(wildcard man/*) README CHANGES Makefile \ 22 | $(wildcard rpm/*) lcovrc 23 | 24 | .PHONY: all info clean install uninstall rpms 25 | 26 | all: info 27 | 28 | info: 29 | @echo "Available make targets:" 30 | @echo " install : install binaries and man pages in PREFIX (default /)" 31 | @echo " uninstall : delete binaries and man pages from PREFIX (default /)" 32 | @echo " dist : create packages (RPM, tarball) ready for distribution" 33 | 34 | clean: 35 | rm -f lcov-*.tar.gz 36 | rm -f lcov-*.rpm 37 | make -C example clean 38 | 39 | install: 40 | bin/install.sh bin/lcov $(BIN_DIR)/lcov -m 755 41 | bin/install.sh bin/genhtml $(BIN_DIR)/genhtml -m 755 42 | bin/install.sh bin/geninfo $(BIN_DIR)/geninfo -m 755 43 | bin/install.sh bin/genpng $(BIN_DIR)/genpng -m 755 44 | bin/install.sh bin/gendesc $(BIN_DIR)/gendesc -m 755 45 | bin/install.sh man/lcov.1 $(MAN_DIR)/man1/lcov.1 -m 644 46 | bin/install.sh man/genhtml.1 $(MAN_DIR)/man1/genhtml.1 -m 644 47 | bin/install.sh man/geninfo.1 $(MAN_DIR)/man1/geninfo.1 -m 644 48 | bin/install.sh man/genpng.1 $(MAN_DIR)/man1/genpng.1 -m 644 49 | bin/install.sh man/gendesc.1 $(MAN_DIR)/man1/gendesc.1 -m 644 50 | bin/install.sh man/lcovrc.5 $(MAN_DIR)/man5/lcovrc.5 -m 644 51 | bin/install.sh lcovrc $(CFG_DIR)/lcovrc -m 644 52 | 53 | uninstall: 54 | bin/install.sh --uninstall bin/lcov $(BIN_DIR)/lcov 55 | bin/install.sh --uninstall bin/genhtml $(BIN_DIR)/genhtml 56 | bin/install.sh --uninstall bin/geninfo $(BIN_DIR)/geninfo 57 | bin/install.sh --uninstall bin/genpng $(BIN_DIR)/genpng 58 | bin/install.sh --uninstall bin/gendesc $(BIN_DIR)/gendesc 59 | bin/install.sh --uninstall man/lcov.1 $(MAN_DIR)/man1/lcov.1 60 | bin/install.sh --uninstall man/genhtml.1 $(MAN_DIR)/man1/genhtml.1 61 | bin/install.sh --uninstall man/geninfo.1 $(MAN_DIR)/man1/geninfo.1 62 | bin/install.sh --uninstall man/genpng.1 $(MAN_DIR)/man1/genpng.1 63 | bin/install.sh --uninstall man/gendesc.1 $(MAN_DIR)/man1/gendesc.1 64 | bin/install.sh --uninstall man/lcovrc.5 $(MAN_DIR)/man5/lcovrc.5 65 | bin/install.sh --uninstall lcovrc $(CFG_DIR)/lcovrc 66 | 67 | dist: lcov-$(VERSION).tar.gz lcov-$(VERSION)-$(RELEASE).noarch.rpm \ 68 | lcov-$(VERSION)-$(RELEASE).src.rpm 69 | 70 | lcov-$(VERSION).tar.gz: $(FILES) 71 | mkdir $(TMP_DIR) 72 | mkdir $(TMP_DIR)/lcov-$(VERSION) 73 | cp -r * $(TMP_DIR)/lcov-$(VERSION) 74 | find $(TMP_DIR)/lcov-$(VERSION) -name CVS -type d | xargs rm -rf 75 | make -C $(TMP_DIR)/lcov-$(VERSION) clean 76 | bin/updateversion.pl $(TMP_DIR)/lcov-$(VERSION) $(VERSION) $(RELEASE) 77 | cd $(TMP_DIR) ; \ 78 | tar cfz $(TMP_DIR)/lcov-$(VERSION).tar.gz lcov-$(VERSION) 79 | mv $(TMP_DIR)/lcov-$(VERSION).tar.gz . 80 | rm -rf $(TMP_DIR) 81 | 82 | lcov-$(VERSION)-$(RELEASE).noarch.rpm: rpms 83 | lcov-$(VERSION)-$(RELEASE).src.rpm: rpms 84 | 85 | rpms: lcov-$(VERSION).tar.gz 86 | mkdir $(TMP_DIR) 87 | mkdir $(TMP_DIR)/BUILD 88 | mkdir $(TMP_DIR)/RPMS 89 | mkdir $(TMP_DIR)/SOURCES 90 | mkdir $(TMP_DIR)/SRPMS 91 | cp lcov-$(VERSION).tar.gz $(TMP_DIR)/SOURCES 92 | cd $(TMP_DIR)/BUILD ; \ 93 | tar xfz $(TMP_DIR)/SOURCES/lcov-$(VERSION).tar.gz \ 94 | lcov-$(VERSION)/rpm/lcov.spec 95 | rpmbuild --define '_topdir $(TMP_DIR)' \ 96 | -ba $(TMP_DIR)/BUILD/lcov-$(VERSION)/rpm/lcov.spec 97 | mv $(TMP_DIR)/RPMS/noarch/lcov-$(VERSION)-$(RELEASE).noarch.rpm . 98 | mv $(TMP_DIR)/SRPMS/lcov-$(VERSION)-$(RELEASE).src.rpm . 99 | rm -rf $(TMP_DIR) 100 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/bin/updateversion.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | sub update_man_page($); 6 | sub update_bin_tool($); 7 | sub update_txt_file($); 8 | sub update_spec_file($); 9 | sub get_file_info($); 10 | 11 | our $directory = $ARGV[0]; 12 | our $version = $ARGV[1]; 13 | our $release = $ARGV[2]; 14 | 15 | our @man_pages = ("man/gendesc.1", "man/genhtml.1", "man/geninfo.1", 16 | "man/genpng.1", "man/lcov.1", "man/lcovrc.5"); 17 | our @bin_tools = ("bin/gendesc", "bin/genhtml", "bin/geninfo", 18 | "bin/genpng", "bin/lcov"); 19 | our @txt_files = ("README"); 20 | our @spec_files = ("rpm/lcov.spec"); 21 | 22 | if (!defined($directory) || !defined($version) || !defined($release)) { 23 | die("Usage: $0 \n"); 24 | } 25 | 26 | foreach (@man_pages) { 27 | print("Updating man page $_\n"); 28 | update_man_page($directory."/".$_); 29 | } 30 | foreach (@bin_tools) { 31 | print("Updating bin tool $_\n"); 32 | update_bin_tool($directory."/".$_); 33 | } 34 | foreach (@txt_files) { 35 | print("Updating text file $_\n"); 36 | update_txt_file($directory."/".$_); 37 | } 38 | foreach (@spec_files) { 39 | print("Updating spec file $_\n"); 40 | update_spec_file($directory."/".$_); 41 | } 42 | print("Done.\n"); 43 | 44 | sub get_file_info($) 45 | { 46 | my ($filename) = @_; 47 | my ($sec, $min, $hour, $year, $month, $day); 48 | my @stat; 49 | 50 | @stat = stat($filename); 51 | ($sec, $min, $hour, $day, $month, $year) = localtime($stat[9]); 52 | $year += 1900; 53 | $month += 1; 54 | 55 | return (sprintf("%04d-%02d-%02d", $year, $month, $day), 56 | sprintf("%04d%02d%02d%02d%02d.%02d", $year, $month, $day, 57 | $hour, $min, $sec), 58 | sprintf("%o", $stat[2] & 07777)); 59 | } 60 | 61 | sub update_man_page($) 62 | { 63 | my ($filename) = @_; 64 | my @date = get_file_info($filename); 65 | my $date_string = $date[0]; 66 | local *IN; 67 | local *OUT; 68 | 69 | $date_string =~ s/-/\\-/g; 70 | open(IN, "<$filename") || die ("Error: cannot open $filename\n"); 71 | open(OUT, ">$filename.new") || 72 | die("Error: cannot create $filename.new\n"); 73 | while () { 74 | s/\"LCOV\s+\d+\.\d+\"/\"LCOV $version\"/g; 75 | s/\d\d\d\d\\\-\d\d\\\-\d\d/$date_string/g; 76 | print(OUT $_); 77 | } 78 | close(OUT); 79 | close(IN); 80 | chmod(oct($date[2]), "$filename.new"); 81 | system("mv", "-f", "$filename.new", "$filename"); 82 | system("touch", "$filename", "-t", $date[1]); 83 | } 84 | 85 | sub update_bin_tool($) 86 | { 87 | my ($filename) = @_; 88 | my @date = get_file_info($filename); 89 | local *IN; 90 | local *OUT; 91 | 92 | open(IN, "<$filename") || die ("Error: cannot open $filename\n"); 93 | open(OUT, ">$filename.new") || 94 | die("Error: cannot create $filename.new\n"); 95 | while () { 96 | s/(our\s+\$lcov_version\s*=\s*["']).*(["'].*)$/$1LCOV version $version$2/g; 97 | print(OUT $_); 98 | } 99 | close(OUT); 100 | close(IN); 101 | chmod(oct($date[2]), "$filename.new"); 102 | system("mv", "-f", "$filename.new", "$filename"); 103 | system("touch", "$filename", "-t", $date[1]); 104 | } 105 | 106 | sub update_txt_file($) 107 | { 108 | my ($filename) = @_; 109 | my @date = get_file_info($filename); 110 | local *IN; 111 | local *OUT; 112 | 113 | open(IN, "<$filename") || die ("Error: cannot open $filename\n"); 114 | open(OUT, ">$filename.new") || 115 | die("Error: cannot create $filename.new\n"); 116 | while () { 117 | s/(Last\s+changes:\s+)\d\d\d\d-\d\d-\d\d/$1$date[0]/g; 118 | print(OUT $_); 119 | } 120 | close(OUT); 121 | close(IN); 122 | chmod(oct($date[2]), "$filename.new"); 123 | system("mv", "-f", "$filename.new", "$filename"); 124 | system("touch", "$filename", "-t", $date[1]); 125 | } 126 | 127 | sub update_spec_file($) 128 | { 129 | my ($filename) = @_; 130 | my @date = get_file_info($filename); 131 | local *IN; 132 | local *OUT; 133 | 134 | open(IN, "<$filename") || die ("Error: cannot open $filename\n"); 135 | open(OUT, ">$filename.new") || 136 | die("Error: cannot create $filename.new\n"); 137 | while () { 138 | s/^(Version:\s*)\d+\.\d+.*$/$1$version/; 139 | s/^(Release:\s*).*$/$1$release/; 140 | print(OUT $_); 141 | } 142 | close(OUT); 143 | close(IN); 144 | system("mv", "-f", "$filename.new", "$filename"); 145 | system("touch", "$filename", "-t", $date[1]); 146 | } 147 | -------------------------------------------------------------------------------- /Classes/Private/NSFNanoStore_Private.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoStore_Private.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NSFNanoStore.h" 28 | #import "NSFOrderedDictionary.h" 29 | 30 | /** \cond */ 31 | 32 | @interface NSFNanoStore (Private) 33 | - (nonnull NSFOrderedDictionary *)dictionaryDescription; 34 | + (nonnull NSFNanoStore *)_createAndOpenDebugDatabase; 35 | - (nonnull NSFNanoResult *)_executeSQL:(nonnull NSString *)theSQLStatement; 36 | - (nonnull NSString *)_nestedDescriptionWithPrefixedSpace:(nonnull NSString *)prefixedSpace; 37 | - (BOOL)_initializePreparedStatementsWithError:(NSError * _Nullable * _Nullable)outError; 38 | - (void)_releasePreparedStatements; 39 | - (void)_setIsOurTransaction:(BOOL)value; 40 | @property (nonatomic, readonly) BOOL _isOurTransaction; 41 | @property (nonatomic, readonly) BOOL _setupCachingSchema; 42 | - (BOOL)_storeDictionary:(nonnull NSDictionary *)someInfo forKey:(nonnull NSString *)aKey forClassNamed:(nonnull NSString *)classType error:(NSError * _Nullable * _Nullable)outError; 43 | - (BOOL)__storeDictionaries:(nonnull NSArray *)someObjects forKeys:(nonnull NSArray *)someKeys error:(NSError * _Nullable * _Nullable)outError; 44 | - (BOOL)_bindValue:(nonnull id)aValue forAttribute:(nonnull NSString *)anAttribute parameterNumber:(NSInteger)aParamNumber usingSQLite3Statement:(sqlite3_stmt * _Nonnull)aStatement; 45 | - (BOOL)_checkNanoStoreIsReadyAndReturnError:(NSError * _Nullable * _Nullable)outError; 46 | - (NSFNanoDatatype)_NSFDatatypeOfObject:(nonnull id)value; 47 | - (nonnull NSString *)_stringFromValue:(nonnull id)aValue; 48 | + (nonnull NSString *)_calendarDateToString:(nonnull NSDate *)aDate; 49 | - (void)_flattenCollection:(nonnull NSDictionary *)info keys:(NSMutableArray * _Nullable * _Nullable)flattenedKeys values:(NSMutableArray * _Nullable * _Nullable)flattenedValues; 50 | - (void)_flattenCollection:(nonnull id)someObject keyPath:(NSMutableArray * _Nullable * _Nullable)aKeyPath keys:(NSMutableArray * _Nullable * _Nullable)someKeys values:(NSMutableArray * _Nullable * _Nullable)someValues; 51 | - (BOOL)_prepareSQLite3Statement:(sqlite3_stmt * _Nonnull * _Nonnull)aStatement theSQLStatement:(nonnull NSString *)aSQLQuery; 52 | - (void)_executeSQLite3StepUsingSQLite3Statement:(sqlite3_stmt * _Nonnull)aStatement; 53 | - (BOOL)_addObjectsFromArray:(nonnull NSArray *)someObjects forceSave:(BOOL)forceSave error:(NSError * _Nullable * _Nullable)outError; 54 | + (nonnull NSDictionary *)_defaultTestData; 55 | - (BOOL)_backupFileStoreToDirectoryAtPath:(nonnull NSString *)aPath extension:(nullable NSString *)anExtension compact:(BOOL)flag error:(NSError * _Nullable * _Nullable)outError; 56 | - (BOOL)_backupMemoryStoreToDirectoryAtPath:(nonnull NSString *)aPath extension:(nullable NSString *)anExtension compact:(BOOL)flag error:(NSError * _Nullable * _Nullable)outError; 57 | @end 58 | 59 | /** \endcond */ 60 | -------------------------------------------------------------------------------- /Classes/Advanced/NSFOrderedDictionary.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSFOrderedDictionary.m 3 | // OrderedDictionary 4 | // 5 | // Created by Matt Gallagher on 19/12/08. 6 | // Copyright 2008 Matt Gallagher. All rights reserved. 7 | // 8 | // v2 - ARC-compliant (Tito Ciuro) 9 | // v1 - Initial release (Matt Gallagher) 10 | // 11 | // This software is provided 'as-is', without any express or implied 12 | // warranty. In no event will the authors be held liable for any damages 13 | // arising from the use of this software. Permission is granted to anyone to 14 | // use this software for any purpose, including commercial applications, and to 15 | // alter it and redistribute it freely, subject to the following restrictions: 16 | // 17 | // 1. The origin of this software must not be misrepresented; you must not 18 | // claim that you wrote the original software. If you use this software 19 | // in a product, an acknowledgment in the product documentation would be 20 | // appreciated but is not required. 21 | // 2. Altered source versions must be plainly marked as such, and must not be 22 | // misrepresented as being the original software. 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | 27 | #import "NSFOrderedDictionary.h" 28 | 29 | @interface NSFOrderedDictionary () 30 | @property (nonatomic) NSMutableDictionary *dictionary; 31 | @property (nonatomic) NSMutableArray *array; 32 | @end 33 | 34 | NSString *DescriptionForObject(NSObject *object, id locale, NSUInteger indent) 35 | { 36 | NSString *objectString = nil; 37 | 38 | if ([object isKindOfClass:[NSString class]]) { 39 | objectString = (NSString *)object; 40 | } else if ([object respondsToSelector:@selector(descriptionWithLocale:indent:)]) { 41 | objectString = [(NSDictionary *)object descriptionWithLocale:locale indent:indent]; 42 | } else if ([object respondsToSelector:@selector(descriptionWithLocale:)]) { 43 | objectString = [(NSSet *)object descriptionWithLocale:locale]; 44 | } else { 45 | objectString = object.description; 46 | } 47 | 48 | return objectString; 49 | } 50 | 51 | @implementation NSFOrderedDictionary 52 | 53 | - (instancetype)init 54 | { 55 | self = [super init]; 56 | 57 | if (self) { 58 | _dictionary = [NSMutableDictionary new]; 59 | _array = [NSMutableArray new]; 60 | } 61 | 62 | return self; 63 | } 64 | 65 | - (instancetype)initWithCapacity:(NSUInteger)capacity 66 | { 67 | self = [super init]; 68 | 69 | if (self != nil) { 70 | _dictionary = [[NSMutableDictionary alloc] initWithCapacity:capacity]; 71 | _array = [[NSMutableArray alloc] initWithCapacity:capacity]; 72 | } 73 | 74 | return self; 75 | } 76 | 77 | - (id)copy 78 | { 79 | return [self mutableCopy]; 80 | } 81 | 82 | - (void)setObject:(id)anObject forKey:(id)aKey 83 | { 84 | if (!_dictionary[aKey]) { 85 | [_array addObject:aKey]; 86 | } 87 | 88 | _dictionary[aKey] = anObject; 89 | } 90 | 91 | - (void)removeObjectForKey:(id)aKey 92 | { 93 | [_dictionary removeObjectForKey:aKey]; 94 | [_array removeObject:aKey]; 95 | } 96 | 97 | - (NSUInteger)count 98 | { 99 | return _dictionary.count; 100 | } 101 | 102 | - (id)objectForKey:(id)aKey 103 | { 104 | return _dictionary[aKey]; 105 | } 106 | 107 | - (NSEnumerator *)keyEnumerator 108 | { 109 | return [_array objectEnumerator]; 110 | } 111 | 112 | - (NSEnumerator *)reverseKeyEnumerator 113 | { 114 | return [_array reverseObjectEnumerator]; 115 | } 116 | 117 | - (void)insertObject:(id)anObject forKey:(id)aKey atIndex:(NSUInteger)anIndex 118 | { 119 | if (_dictionary[aKey]) { 120 | [self removeObjectForKey:aKey]; 121 | } 122 | 123 | [_array insertObject:aKey atIndex:anIndex]; 124 | _dictionary[aKey] = anObject; 125 | } 126 | 127 | - (id)keyAtIndex:(NSUInteger)anIndex 128 | { 129 | return _array[anIndex]; 130 | } 131 | 132 | - (NSString *)descriptionWithLocale:(id)locale indent:(NSUInteger)level 133 | { 134 | NSMutableString *indentString = [NSMutableString string]; 135 | NSUInteger i, count = level; 136 | 137 | for (i = 0; i < count; i++) { 138 | [indentString appendFormat:@" "]; 139 | } 140 | 141 | NSMutableString *description = [NSMutableString string]; 142 | [description appendFormat:@"%@{\n", indentString]; 143 | 144 | for (NSObject *key in self) { 145 | [description appendFormat:@"%@ %@ = %@;\n", 146 | indentString, 147 | DescriptionForObject(key, locale, level), 148 | DescriptionForObject(self[key], locale, level)]; 149 | } 150 | 151 | [description appendFormat:@"%@}\n", indentString]; 152 | return description; 153 | } 154 | 155 | @end 156 | -------------------------------------------------------------------------------- /Classes/Public/NSFNanoExpression.m: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoExpression.m 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NSFNanoExpression.h" 28 | #import "NanoStore_Private.h" 29 | #import "NSFOrderedDictionary.h" 30 | 31 | @implementation NSFNanoExpression 32 | { 33 | /** \cond */ 34 | NSMutableArray *_predicates; 35 | NSMutableArray *_operators; 36 | /** \endcond */ 37 | } 38 | 39 | + (NSFNanoExpression*)expressionWithPredicate:(NSFNanoPredicate *)aPredicate 40 | { 41 | return [[self alloc]initWithPredicate:aPredicate]; 42 | } 43 | 44 | - (instancetype)init 45 | { 46 | #pragma clang diagnostic push 47 | #pragma clang diagnostic ignored "-Wnonnull" 48 | return [self initWithPredicate:nil]; 49 | #pragma clang diagnostic pop 50 | } 51 | 52 | - (instancetype)initWithPredicate:(NSFNanoPredicate *)aPredicate 53 | { 54 | if (nil == aPredicate) { 55 | [[NSException exceptionWithName:NSFUnexpectedParameterException 56 | reason:[NSString stringWithFormat:@"*** -[%@ %@]: the predicate is nil.", [self class], NSStringFromSelector(_cmd)] 57 | userInfo:nil]raise]; 58 | } 59 | 60 | if ((self = [super init])) { 61 | _predicates = [NSMutableArray new]; 62 | [_predicates addObject:aPredicate]; 63 | _operators = [NSMutableArray new]; 64 | [_operators addObject:@(NSFAnd)]; 65 | } 66 | 67 | return self; 68 | } 69 | 70 | /** \cond */ 71 | 72 | 73 | /** \endcond */ 74 | 75 | #pragma mark - 76 | 77 | - (void)addPredicate:(NSFNanoPredicate *)aPredicate withOperator:(NSFOperator)someOperator 78 | { 79 | if (nil == aPredicate) 80 | [[NSException exceptionWithName:NSFUnexpectedParameterException 81 | reason:[NSString stringWithFormat:@"*** -[%@ %@]: the predicate is nil.", [self class], NSStringFromSelector(_cmd)] 82 | userInfo:nil]raise]; 83 | 84 | [_predicates addObject:aPredicate]; 85 | [_operators addObject:[NSNumber numberWithInt:someOperator]]; 86 | } 87 | 88 | - (NSString *)description 89 | { 90 | NSArray *values = [self arrayDescription]; 91 | 92 | return [values componentsJoinedByString:@""]; 93 | } 94 | 95 | - (NSArray *)arrayDescription 96 | { 97 | NSUInteger i, count = _predicates.count; 98 | NSMutableArray *values = [NSMutableArray new]; 99 | 100 | // We always have one predicate, so make sure add it 101 | [values addObject:[_predicates[0]description]]; 102 | 103 | for (i = 1; i < count; i++) { 104 | NSString *compound = [[NSString alloc]initWithFormat:@" %@ %@", ([_operators[i]intValue] == NSFAnd) ? @"AND" : @"OR", [_predicates[i]description]]; 105 | [values addObject:compound]; 106 | } 107 | 108 | return values; 109 | } 110 | 111 | - (NSString *)JSONDescription 112 | { 113 | NSArray *values = [self arrayDescription]; 114 | 115 | NSError *outError = nil; 116 | NSString *description = [NSFNanoObject _NSObjectToJSONString:values error:&outError]; 117 | 118 | return description; 119 | } 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreSortTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreSortTests.m 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 5/26/11. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import "NanoStore.h" 10 | #import "NanoStoreSortTests.h" 11 | 12 | @implementation NanoStoreSortTests 13 | 14 | - (void)setUp 15 | { 16 | [super setUp]; 17 | 18 | NSFSetIsDebugOn (NO); 19 | } 20 | 21 | - (void)tearDown 22 | { 23 | NSFSetIsDebugOn (NO); 24 | 25 | [super tearDown]; 26 | } 27 | 28 | #pragma mark - 29 | 30 | - (void)testSortWithNilAttributes 31 | { 32 | NSFNanoSortDescriptor *sort = nil; 33 | @try { 34 | #pragma clang diagnostic push 35 | #pragma clang diagnostic ignored "-Wnonnull" 36 | sort = [NSFNanoSortDescriptor sortDescriptorWithAttribute:nil ascending:YES]; 37 | #pragma clang diagnostic pop 38 | } @catch (NSException *e) { 39 | XCTAssertTrue (e != nil, @"We should have caught the exception."); 40 | } 41 | } 42 | 43 | - (void)testSortParametersAscending 44 | { 45 | NSFNanoSortDescriptor *sort = [NSFNanoSortDescriptor sortDescriptorWithAttribute:@"Foo" ascending:YES]; 46 | XCTAssertTrue ([[sort attribute]isEqualToString:@"Foo"], @"Expected the key to be the same."); 47 | XCTAssertTrue (sort.isAscending, @"Expected the sort order to be the same."); 48 | } 49 | 50 | - (void)testSortParametersDescending 51 | { 52 | NSFNanoSortDescriptor *sort = [NSFNanoSortDescriptor sortDescriptorWithAttribute:@"Bar" ascending:NO]; 53 | XCTAssertTrue ([[sort attribute]isEqualToString:@"Bar"], @"Expected the key to be the same."); 54 | XCTAssertTrue (NO == sort.isAscending, @"Expected the sort order to be the same."); 55 | } 56 | 57 | - (void)testSortObjectsAscending 58 | { 59 | // Instantiate a NanoStore and open it 60 | NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil]; 61 | [nanoStore removeAllObjectsFromStoreAndReturnError:nil]; 62 | 63 | NSFNanoObject *obj1 = [NSFNanoObject nanoObjectWithDictionary:@{@"City": @"Madrid"}]; 64 | NSFNanoObject *obj2 = [NSFNanoObject nanoObjectWithDictionary:@{@"City": @"Barcelona"}]; 65 | NSFNanoObject *obj3 = [NSFNanoObject nanoObjectWithDictionary:@{@"City": @"San Sebastian"}]; 66 | NSFNanoObject *obj4 = [NSFNanoObject nanoObjectWithDictionary:@{@"City": @"Zaragoza"}]; 67 | NSFNanoObject *obj5 = [NSFNanoObject nanoObjectWithDictionary:@{@"City": @"Tarragona"}]; 68 | 69 | [nanoStore addObjectsFromArray:@[obj1, obj2, obj3, obj4, obj5] error:nil]; 70 | 71 | // Prepare the sort 72 | NSFNanoSortDescriptor *sortCities = [[NSFNanoSortDescriptor alloc]initWithAttribute:@"City" ascending: YES]; 73 | 74 | // Prepare the search 75 | NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore]; 76 | search.sort = @[sortCities]; 77 | 78 | // Perform the search 79 | NSArray *searchResults = [search searchObjectsWithReturnType:NSFReturnObjects error:nil]; 80 | XCTAssertTrue ([searchResults count] == 5, @"Expected to find five objects."); 81 | 82 | XCTAssertTrue ([[[[searchResults objectAtIndex:0]info]objectForKey:@"City"]isEqualToString:@"Barcelona"], @"Expected to find Barcelona."); 83 | 84 | XCTAssertTrue ([[searchResults[0] info][@"City"]isEqualToString:@"Barcelona"], @"Expected to find Barcelona."); 85 | 86 | // Cleanup 87 | 88 | // Close the document store 89 | [nanoStore closeWithError:nil]; 90 | } 91 | 92 | - (void)testSortBagsAscending 93 | { 94 | // Instantiate a NanoStore and open it 95 | NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil]; 96 | [nanoStore removeAllObjectsFromStoreAndReturnError:nil]; 97 | 98 | NSFNanoBag *bagOne = [NSFNanoBag bagWithName:@"San Sebastian"]; 99 | NSFNanoBag *bagTwo = [NSFNanoBag bagWithName:@"Barcelona"]; 100 | NSFNanoBag *bagThree = [NSFNanoBag bagWithName:@"Madrid"]; 101 | NSFNanoBag *bagFour = [NSFNanoBag bagWithName:@"Zaragoza"]; 102 | 103 | [nanoStore addObjectsFromArray:@[bagOne, bagTwo, bagThree, bagFour] error:nil]; 104 | 105 | // Prepare the sort 106 | NSFNanoSortDescriptor *sortBagNameDescriptor = [[NSFNanoSortDescriptor alloc]initWithAttribute:@"name" ascending: YES]; 107 | 108 | // Prepare the search 109 | NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore]; 110 | search.sort = @[sortBagNameDescriptor]; 111 | 112 | NSArray *searchResults = [search searchObjectsWithReturnType:NSFReturnObjects error:nil]; 113 | XCTAssertTrue ([searchResults count] == 4, @"Expected to find four objects."); 114 | XCTAssertTrue ([[searchResults[0]name]isEqualToString:@"Barcelona"], @"Expected to find Barcelona."); 115 | 116 | // Cleanup 117 | 118 | // Close the document store 119 | [nanoStore closeWithError:nil]; 120 | } 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/contrib/galaxy/conglomerate_functions.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | 3 | # Takes a set of ps images (belonging to one file) and produces a 4 | # conglomerate picture of that file: static functions in the middle, 5 | # others around it. Each one gets a box about its area. 6 | 7 | use strict; 8 | 9 | my $SCRUNCH = $ARGV [0]; 10 | my $BOXSCRUNCH = $ARGV [1]; 11 | my $Tmp; 12 | my $DEBUG = 1; 13 | 14 | shift @ARGV; # skip SCRUNCH and BOXSCRUNCH 15 | shift @ARGV; 16 | 17 | 18 | DecorateFuncs (@ARGV); 19 | 20 | 21 | #TMPFILE=`mktemp ${TMPDIR:-/tmp}/$$.XXXXXX` 22 | 23 | # Arrange. 24 | my $ArgList = ""; 25 | 26 | foreach $Tmp (@ARGV) { 27 | $ArgList .= "'$Tmp' "; 28 | } 29 | 30 | my @Arranged = `../draw_arrangement $SCRUNCH 0 360 0 $ArgList`; 31 | 32 | my $CFile = $ARGV [0]; 33 | $CFile =~ s/\.c\..*$/.c/; 34 | if ($DEBUG) { print ("% Conglomeration of $CFile\n"); } 35 | 36 | print "gsave angle rotate\n"; 37 | 38 | # Now output the file, except last line. 39 | my $LastLine = pop (@Arranged); 40 | my $Fill = Box_2 ($LastLine,$CFile); 41 | print $Fill; 42 | # Draw box with file name 43 | my @Output = Box ('normal', 'Helvetica-Bold', 32, $CFile, $LastLine); 44 | splice(@Output, $#Output, 0, "grestore\n"); 45 | #print @Output; 46 | 47 | print (@Arranged); 48 | #add a duplicate box to test if this works 49 | print @Output; 50 | 51 | 52 | sub ParseBound 53 | { 54 | my $BBoxLine = shift; 55 | 56 | $BBoxLine =~ /(-?[\d.]+)\s+(-?[\d.]+)\s+(-?[\d.]+)\s+(-?[\d.]+)/; 57 | 58 | # XMin, YMin, XMax, YMax 59 | return ($1 * $BOXSCRUNCH, $2 * $BOXSCRUNCH, 60 | $3 * $BOXSCRUNCH, $4 * $BOXSCRUNCH); 61 | } 62 | 63 | 64 | 65 | # Box (type, font, fontsize, Label, BBoxLine) 66 | sub Box 67 | { 68 | my $Type = shift; 69 | my $Font = shift; 70 | my $Fontsize = shift; 71 | my $Label = shift; 72 | my $BBoxLine = shift; 73 | my @Output = (); 74 | 75 | # print (STDERR "Box ('$Type', '$Font', '$Fontsize', '$Label', '$BBoxLine')\n"); 76 | push (@Output, "% start of box\n"); 77 | 78 | push (@Output, "D5\n") if ($Type eq "dashed"); 79 | 80 | # print (STDERR "BBoxLine: '$BBoxLine'\n"); 81 | # print (STDERR "Parsed: '" . join ("' '", ParseBound ($BBoxLine)) . "\n"); 82 | my ($XMin, $YMin, $XMax, $YMax) = ParseBound ($BBoxLine); 83 | 84 | my $LeftSpaced = $XMin + 6; 85 | my $BottomSpaced = $YMin + 6; 86 | 87 | # Put black box around it 88 | push (@Output, ( 89 | "($Label) $LeftSpaced $BottomSpaced $Fontsize /$Font\n", 90 | "$YMin $XMin $YMax $XMax U\n" 91 | ) 92 | ); 93 | 94 | push (@Output, "D\n") if ($Type eq "dashed"); 95 | # fill bounding box 96 | push (@Output, "% end of box\n"); 97 | 98 | # Output bounding box 99 | push (@Output, "% bound $XMin $YMin $XMax $YMax\n"); 100 | 101 | return @Output; 102 | } 103 | 104 | sub Box_2 105 | { 106 | my $BBoxLine = shift; 107 | my $CFile = shift; 108 | my $CovFile = "./coverage.dat"; 109 | my ($XMin, $YMin, $XMax, $YMax) = ParseBound ($BBoxLine); 110 | my @output = `fgrep $CFile $CovFile`; 111 | chomp $output[0]; 112 | my ($junk, $Class, $per) = split /\t/, $output[0]; 113 | return "$XMin $YMin $XMax $YMax $Class\n"; 114 | } 115 | # Decorate (rgb-vals(1 string) filename) 116 | sub Decorate 117 | { 118 | my $RGB = shift; 119 | my $Filename = shift; 120 | 121 | my @Input = ReadPS ($Filename); 122 | my $LastLine = pop (@Input); 123 | my @Output = (); 124 | 125 | # Color at the beginning. 126 | push (@Output, "C$RGB\n"); 127 | 128 | # Now output the file, except last line. 129 | push (@Output, @Input); 130 | 131 | # Draw dashed box with function name 132 | # FIXME Make bound cover the label as well! 133 | my $FuncName = $Filename; 134 | $FuncName =~ s/^[^.]+\.c\.(.+?)\..*$/$1/; 135 | 136 | push (@Output, Box ('dashed', 'Helvetica', 24, $FuncName, $LastLine)); 137 | 138 | # Slap over the top. 139 | WritePS ($Filename, @Output); 140 | } 141 | 142 | 143 | 144 | # Add colored boxes around functions 145 | sub DecorateFuncs 146 | { 147 | my $FName = ""; 148 | my $FType = ""; 149 | 150 | foreach $FName (@ARGV) 151 | { 152 | $FName =~ /\+([A-Z]+)\+/; 153 | $FType = $1; 154 | 155 | if ($FType eq 'STATIC') { 156 | Decorate ("2", $FName); # Light green. 157 | } 158 | elsif ($FType eq 'INDIRECT') { 159 | Decorate ("3", $FName); # Green. 160 | } 161 | elsif ($FType eq 'EXPORTED') { 162 | Decorate ("4", $FName); # Red. 163 | } 164 | elsif ($FType eq 'NORMAL') { 165 | Decorate ("5", $FName); # Blue. 166 | } 167 | else { 168 | die ("Unknown extension $FName"); 169 | } 170 | } 171 | } 172 | 173 | 174 | sub ReadPS 175 | { 176 | my $Filename = shift; 177 | my @Contents = (); 178 | 179 | open (INFILE, "$Filename") or die ("Could not read $Filename: $!"); 180 | @Contents = ; 181 | close (INFILE); 182 | 183 | return @Contents; 184 | } 185 | 186 | sub WritePS 187 | { 188 | my $Filename = shift; 189 | 190 | open (OUTFILE, ">$Filename") 191 | or die ("Could not write $Filename: $!"); 192 | print (OUTFILE @_); 193 | close (OUTFILE); 194 | } 195 | 196 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/README: -------------------------------------------------------------------------------- 1 | ------------------------------------------------- 2 | - README file for the LTP GCOV extension (LCOV) - 3 | - Last changes: 2012-10-10 - 4 | ------------------------------------------------- 5 | 6 | Description 7 | ----------- 8 | LCOV is an extension of GCOV, a GNU tool which provides information about 9 | what parts of a program are actually executed (i.e. "covered") while running 10 | a particular test case. The extension consists of a set of Perl scripts 11 | which build on the textual GCOV output to implement the following enhanced 12 | functionality: 13 | 14 | * HTML based output: coverage rates are additionally indicated using bar 15 | graphs and specific colors. 16 | 17 | * Support for large projects: overview pages allow quick browsing of 18 | coverage data by providing three levels of detail: directory view, 19 | file view and source code view. 20 | 21 | LCOV was initially designed to support Linux kernel coverage measurements, 22 | but works as well for coverage measurements on standard user space 23 | applications. 24 | 25 | 26 | Further README contents 27 | ----------------------- 28 | 1. Included files 29 | 2. Installing LCOV 30 | 3. An example of how to access kernel coverage data 31 | 4. An example of how to access coverage data for a user space program 32 | 5. Questions and Comments 33 | 34 | 35 | 36 | 1. Important files 37 | ------------------ 38 | README - This README file 39 | CHANGES - List of changes between releases 40 | bin/lcov - Tool for capturing LCOV coverage data 41 | bin/genhtml - Tool for creating HTML output from LCOV data 42 | bin/gendesc - Tool for creating description files as used by genhtml 43 | bin/geninfo - Internal tool (creates LCOV data files) 44 | bin/genpng - Internal tool (creates png overviews of source files) 45 | bin/install.sh - Internal tool (takes care of un-/installing) 46 | descriptions.tests - Test descriptions for the LTP suite, use with gendesc 47 | man - Directory containing man pages for included tools 48 | example - Directory containing an example to demonstrate LCOV 49 | lcovrc - LCOV configuration file 50 | Makefile - Makefile providing 'install' and 'uninstall' targets 51 | 52 | 53 | 2. Installing LCOV 54 | ------------------ 55 | The LCOV package is available as either RPM or tarball from: 56 | 57 | http://ltp.sourceforge.net/coverage/lcov.php 58 | 59 | To install the tarball, unpack it to a directory and run: 60 | 61 | make install 62 | 63 | Use anonymous CVS for the most recent (but possibly unstable) version: 64 | 65 | cvs -d:pserver:anonymous@ltp.cvs.sourceforge.net:/cvsroot/ltp login 66 | 67 | (simply press the ENTER key when asked for a password) 68 | 69 | cvs -z3 -d:pserver:anonymous@ltp.cvs.sourceforge.net:/cvsroot/ltp export -D now utils 70 | 71 | Change to the utils/analysis/lcov directory and type: 72 | 73 | make install 74 | 75 | 76 | 3. An example of how to access kernel coverage data 77 | --------------------------------------------------- 78 | Requirements: get and install the gcov-kernel package from 79 | 80 | http://sourceforge.net/projects/ltp 81 | 82 | Copy the resulting gcov kernel module file to either the system wide modules 83 | directory or the same directory as the Perl scripts. As root, do the following: 84 | 85 | a) Resetting counters 86 | 87 | lcov --zerocounters 88 | 89 | b) Capturing the current coverage state to a file 90 | 91 | lcov --capture --output-file kernel.info 92 | 93 | c) Getting HTML output 94 | 95 | genhtml kernel.info 96 | 97 | Point the web browser of your choice to the resulting index.html file. 98 | 99 | 100 | 4. An example of how to access coverage data for a user space program 101 | --------------------------------------------------------------------- 102 | Requirements: compile the program in question using GCC with the options 103 | -fprofile-arcs and -ftest-coverage. During linking, make sure to specify 104 | -lgcov or -coverage. 105 | 106 | Assuming the compile directory is called "appdir", do the following: 107 | 108 | a) Resetting counters 109 | 110 | lcov --directory appdir --zerocounters 111 | 112 | b) Capturing the current coverage state to a file (works only after the 113 | application has been started and stopped at least once) 114 | 115 | lcov --directory appdir --capture --output-file app.info 116 | 117 | c) Getting HTML output 118 | 119 | genhtml app.info 120 | 121 | Point the web browser of your choice to the resulting index.html file. 122 | 123 | Please note that independently of where the application is installed or 124 | from which directory it is run, the --directory statement needs to 125 | point to the directory in which the application was compiled. 126 | 127 | For further information on the gcc profiling mechanism, please also 128 | consult the gcov man page. 129 | 130 | 131 | 5. Questions and comments 132 | ------------------------- 133 | See the included man pages for more information on how to use the LCOV tools. 134 | 135 | Please email further questions or comments regarding this tool to the 136 | LTP Mailing list at ltp-coverage@lists.sourceforge.net 137 | 138 | -------------------------------------------------------------------------------- /Classes/Public/NSFNanoObjectProtocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoObjectProtocol.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | /*! @file NSFNanoObjectProtocol.h 28 | @brief A protocol declaring the interface that objects interfacing with NanoStore must implement. 29 | */ 30 | 31 | /** @protocol NSFNanoObjectProtocol 32 | * A protocol declaring the interface that objects interfacing with NanoStore must implement. 33 | * 34 | * @note 35 | * Check NSFNanoBag or NSFNanoObject to see a concrete example of how NSFNanoObjectProtocol is implemented. 36 | */ 37 | 38 | @class NSFNanoStore; 39 | 40 | @protocol NSFNanoObjectProtocol 41 | 42 | @required 43 | 44 | /** * Initializes a newly allocated object containing a given key and value associated with a document store. 45 | * @param theDictionary the information associated with the object. 46 | * @param aKey the key associated with the information. 47 | * @param theStore the document store where the object is stored. 48 | * @return An initialized object upon success, nil otherwise. 49 | * @details Example: 50 | @code 51 | - (id)initNanoObjectFromDictionaryRepresentation:(NSDictionary *)aDictionary forKey:(NSString *)aKey store:(NSFNanoStore *)aStore 52 | { 53 | if (self = [self init]) { 54 | info = [aDictionary retain]; 55 | key = [aKey copy]; 56 | } 57 | 58 | return self; 59 | } 60 | @endcode 61 | */ 62 | 63 | - (nullable instancetype)initNanoObjectFromDictionaryRepresentation:(nullable NSDictionary *)theDictionary forKey:(nullable NSString *)aKey store:(nullable NSFNanoStore *)theStore; 64 | 65 | /** * Returns a dictionary that contains the information stored in the object. 66 | * @see \link nanoObjectKey - (NSString *)nanoObjectKey \endlink 67 | */ 68 | 69 | @property (nonatomic, readonly, copy, nonnull) NSDictionary *nanoObjectDictionaryRepresentation; 70 | 71 | /** * Returns the key associated with the object. 72 | * @note 73 | * The class NSFNanoEngine contains a convenience method for this purpose: \ref NSFNanoEngine::stringWithUUID "+(NSString*)stringWithUUID" 74 | * 75 | * @see \link nanoObjectDictionaryRepresentation - (NSDictionary *)nanoObjectDictionaryRepresentation \endlink 76 | */ 77 | 78 | @property (nonatomic, readonly, copy, nonnull) NSString *nanoObjectKey; 79 | 80 | /** * Returns a reference to the object holding the private data or information that will be used for sorting. 81 | * Most custom objects will return self, as is the case for NSFNanoBag. Since we can sort a bag by name, key or hasUnsavedChanges, 82 | * NanoStore requires a hint to find the attribute. This hint is the root object, which KVC uses to perform the sort. Taking NSFNanoBag as an example: 83 | @code 84 | @interface NSFNanoBag : NSObject 85 | { 86 | NSFNanoStore *store; 87 | NSString *name; 88 | NSString *key; 89 | BOOL hasUnsavedChanges; 90 | } 91 | @endcode 92 | * The implementation of rootObject would look like so: 93 | @code 94 | - (id)rootObject 95 | { 96 | return self; 97 | } 98 | @endcode 99 | * Other objects may point directly to the collection that holds the information. NSFNanoObject stores all its data in the info dictionary, so the 100 | * implementation looks like this: 101 | @code 102 | - (id)rootObject 103 | { 104 | return info; 105 | } 106 | @endcode 107 | * Assuming that info contains a key named City, we would specify a NSFNanoSortDescriptor which would sort the cities like so: 108 | @code 109 | NSFNanoSortDescriptor *sortedCities = [[NSFNanoSortDescriptor alloc]initWithAttribute:@"City" ascending:YES]; 110 | @endcode 111 | * If we had returned self as the root object, the sort descriptor would have to be written like so: 112 | @code 113 | NSFNanoSortDescriptor *sortedCities = [[NSFNanoSortDescriptor alloc]initWithAttribute:@"info.City" ascending:YES]; 114 | @endcode 115 | */ 116 | 117 | @property (nonatomic, readonly, nonnull) id rootObject; 118 | 119 | @end 120 | -------------------------------------------------------------------------------- /Classes/Advanced/NSFNanoResult.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoResult.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | /*! @file NSFNanoResult.h 28 | @brief A unit that describes the result of a search. 29 | */ 30 | 31 | /** @class NSFNanoResult 32 | * A unit that describes the result of a search. 33 | * 34 | * @note 35 | * The NanoResult is the object representation of a SQL result set. From it, you can obtain the number of rows, the column names and their 36 | * associated values. 37 | * 38 | * @par 39 | * After obtaining a NanoResult, it's always a good idea to check whether the error property is nil. If so, the result can be assumed to be 40 | * correct. Otherwise, error will point to the main cause of failure. 41 | * 42 | * @details Example: 43 | @code 44 | // Instantiate a NanoStore and open it 45 | NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil]; 46 | 47 | // Add some data to the document store 48 | NSDictionary *info = ...; 49 | NSFNanoBag *bag = [NSFNanoBag bag]; 50 | NSFNanoObject *obj1 = [NSFNanoObject nanoObjectWithDictionary:info]; 51 | NSFNanoObject *obj2 = [NSFNanoObject nanoObjectWithDictionary:info]; 52 | [nanoStore addObjectsFromArray:[NSArray arrayWithObjects:obj1, obj2, nil] error:nil]; 53 | 54 | // Instantiate a search and execute the SQL statement 55 | NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore]; 56 | NSFNanoResult *result = [search executeSQL:@"SELECT COUNT(*) FROM NSFKEYS"]; 57 | 58 | // Obtain the result (given as an NSString) 59 | NSString *value = [result firstValue]; 60 | 61 | // Close the document store 62 | [nanoStore closeWithError:nil]; 63 | @endcode 64 | */ 65 | 66 | #import 67 | 68 | @class NSFNanoStore; 69 | 70 | @interface NSFNanoResult : NSObject 71 | 72 | /** * Number of rows contained in the result set. */ 73 | @property (nonatomic, assign, readonly) NSUInteger numberOfRows; 74 | /** * A reference to the error encountered while processing the request, otherwise nil if the request was successful. */ 75 | @property (nonatomic, strong, readonly, nullable) NSError *error; 76 | 77 | /** @name Accessors 78 | */ 79 | 80 | //@{ 81 | 82 | /** * Returns a new array containing the columns. 83 | * @returns An array with the columns retrieved from the result set. 84 | */ 85 | 86 | @property (nonatomic, readonly, copy, nonnull) NSArray *columns; 87 | 88 | /** * Returns a new array containing the values for a given column. 89 | * @param theIndex is the index of the value in the result set. 90 | * @param theColumn is the name of the column in the result set. 91 | * @returns An array with the values associated with a given column. 92 | * @throws NSRangeException is thrown if the index is out of bounds. 93 | */ 94 | 95 | - (nullable NSString *)valueAtIndex:(NSUInteger)theIndex forColumn:(nonnull NSString *)theColumn; 96 | 97 | /** * Returns a new array containing the values for a given column. 98 | * @param theColumn is the name of the column in the result set. 99 | * @returns An array with the values associated with a given column. 100 | */ 101 | 102 | - (nonnull NSArray *)valuesForColumn:(nonnull NSString *)theColumn; 103 | 104 | /** * Returns the first value. 105 | * @returns The value of the first element from the result set. 106 | */ 107 | 108 | @property (nonatomic, readonly, copy, nullable) NSString *firstValue; 109 | 110 | //@} 111 | 112 | /** @name Exporting the Results to a File 113 | */ 114 | 115 | //@{ 116 | 117 | /** * Saves the result to a file. 118 | * @param thePath is the location where the result will be saved to a file. 119 | */ 120 | 121 | - (void)writeToFile:(nonnull NSString *)thePath; 122 | 123 | //@} 124 | 125 | /** @name Miscellaneous 126 | */ 127 | 128 | //@{ 129 | 130 | /** * Returns a string representation of the result. 131 | */ 132 | 133 | @property (nonatomic, readonly, copy, nonnull) NSString *description; 134 | 135 | /** Returns a JSON representation of the result. 136 | */ 137 | 138 | @property (nonatomic, readonly, copy, nonnull) NSString *JSONDescription; 139 | 140 | //@} 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/bin/gendesc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # 3 | # Copyright (c) International Business Machines Corp., 2002 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or (at 8 | # your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | # 19 | # 20 | # gendesc 21 | # 22 | # This script creates a description file as understood by genhtml. 23 | # Input file format: 24 | # 25 | # For each test case: 26 | # 27 | # 28 | # 29 | # Actual description may consist of several lines. By default, output is 30 | # written to stdout. Test names consist of alphanumeric characters 31 | # including _ and -. 32 | # 33 | # 34 | # History: 35 | # 2002-09-02: created by Peter Oberparleiter 36 | # 37 | 38 | use strict; 39 | use File::Basename; 40 | use Getopt::Long; 41 | 42 | 43 | # Constants 44 | our $lcov_version = 'LCOV version 1.10'; 45 | our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php"; 46 | our $tool_name = basename($0); 47 | 48 | 49 | # Prototypes 50 | sub print_usage(*); 51 | sub gen_desc(); 52 | sub warn_handler($); 53 | sub die_handler($); 54 | 55 | 56 | # Global variables 57 | our $help; 58 | our $version; 59 | our $output_filename; 60 | our $input_filename; 61 | 62 | 63 | # 64 | # Code entry point 65 | # 66 | 67 | $SIG{__WARN__} = \&warn_handler; 68 | $SIG{__DIE__} = \&die_handler; 69 | 70 | # Prettify version string 71 | $lcov_version =~ s/\$\s*Revision\s*:?\s*(\S+)\s*\$/$1/; 72 | 73 | # Parse command line options 74 | if (!GetOptions("output-filename=s" => \$output_filename, 75 | "version" =>\$version, 76 | "help|?" => \$help 77 | )) 78 | { 79 | print(STDERR "Use $tool_name --help to get usage information\n"); 80 | exit(1); 81 | } 82 | 83 | $input_filename = $ARGV[0]; 84 | 85 | # Check for help option 86 | if ($help) 87 | { 88 | print_usage(*STDOUT); 89 | exit(0); 90 | } 91 | 92 | # Check for version option 93 | if ($version) 94 | { 95 | print("$tool_name: $lcov_version\n"); 96 | exit(0); 97 | } 98 | 99 | 100 | # Check for input filename 101 | if (!$input_filename) 102 | { 103 | die("No input filename specified\n". 104 | "Use $tool_name --help to get usage information\n"); 105 | } 106 | 107 | # Do something 108 | gen_desc(); 109 | 110 | 111 | # 112 | # print_usage(handle) 113 | # 114 | # Write out command line usage information to given filehandle. 115 | # 116 | 117 | sub print_usage(*) 118 | { 119 | local *HANDLE = $_[0]; 120 | 121 | print(HANDLE < 143 | # TD: 144 | # 145 | # If defined, write output to OUTPUT_FILENAME, otherwise to stdout. 146 | # 147 | # Die on error. 148 | # 149 | 150 | sub gen_desc() 151 | { 152 | local *INPUT_HANDLE; 153 | local *OUTPUT_HANDLE; 154 | my $empty_line = "ignore"; 155 | 156 | open(INPUT_HANDLE, "<", $input_filename) 157 | or die("ERROR: cannot open $input_filename!\n"); 158 | 159 | # Open output file for writing 160 | if ($output_filename) 161 | { 162 | open(OUTPUT_HANDLE, ">", $output_filename) 163 | or die("ERROR: cannot create $output_filename!\n"); 164 | } 165 | else 166 | { 167 | *OUTPUT_HANDLE = *STDOUT; 168 | } 169 | 170 | # Process all lines in input file 171 | while () 172 | { 173 | chomp($_); 174 | 175 | if (/^(\w[\w-]*)(\s*)$/) 176 | { 177 | # Matched test name 178 | # Name starts with alphanum or _, continues with 179 | # alphanum, _ or - 180 | print(OUTPUT_HANDLE "TN: $1\n"); 181 | $empty_line = "ignore"; 182 | } 183 | elsif (/^(\s+)(\S.*?)\s*$/) 184 | { 185 | # Matched test description 186 | if ($empty_line eq "insert") 187 | { 188 | # Write preserved empty line 189 | print(OUTPUT_HANDLE "TD: \n"); 190 | } 191 | print(OUTPUT_HANDLE "TD: $2\n"); 192 | $empty_line = "observe"; 193 | } 194 | elsif (/^\s*$/) 195 | { 196 | # Matched empty line to preserve paragraph separation 197 | # inside description text 198 | if ($empty_line eq "observe") 199 | { 200 | $empty_line = "insert"; 201 | } 202 | } 203 | } 204 | 205 | # Close output file if defined 206 | if ($output_filename) 207 | { 208 | close(OUTPUT_HANDLE); 209 | } 210 | 211 | close(INPUT_HANDLE); 212 | } 213 | 214 | sub warn_handler($) 215 | { 216 | my ($msg) = @_; 217 | 218 | warn("$tool_name: $msg"); 219 | } 220 | 221 | sub die_handler($) 222 | { 223 | my ($msg) = @_; 224 | 225 | die("$tool_name: $msg"); 226 | } 227 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/lcovrc: -------------------------------------------------------------------------------- 1 | # 2 | # /etc/lcovrc - system-wide defaults for LCOV 3 | # 4 | # To change settings for a single user, place a customized copy of this file 5 | # at location ~/.lcovrc 6 | # 7 | 8 | # Specify an external style sheet file (same as --css-file option of genhtml) 9 | #genhtml_css_file = gcov.css 10 | 11 | # Specify coverage rate limits (in %) for classifying file entries 12 | # HI: hi_limit <= rate <= 100 graph color: green 13 | # MED: med_limit <= rate < hi_limit graph color: orange 14 | # LO: 0 <= rate < med_limit graph color: red 15 | genhtml_hi_limit = 90 16 | genhtml_med_limit = 75 17 | 18 | # Width of line coverage field in source code view 19 | genhtml_line_field_width = 12 20 | 21 | # Width of branch coverage field in source code view 22 | genhtml_branch_field_width = 16 23 | 24 | # Width of overview image (used by --frames option of genhtml) 25 | genhtml_overview_width = 80 26 | 27 | # Resolution of overview navigation: this number specifies the maximum 28 | # difference in lines between the position a user selected from the overview 29 | # and the position the source code window is scrolled to (used by --frames 30 | # option of genhtml) 31 | genhtml_nav_resolution = 4 32 | 33 | # Clicking a line in the overview image should show the source code view at 34 | # a position a bit further up so that the requested line is not the first 35 | # line in the window. This number specifies that offset in lines (used by 36 | # --frames option of genhtml) 37 | genhtml_nav_offset = 10 38 | 39 | # Do not remove unused test descriptions if non-zero (same as 40 | # --keep-descriptions option of genhtml) 41 | genhtml_keep_descriptions = 0 42 | 43 | # Do not remove prefix from directory names if non-zero (same as --no-prefix 44 | # option of genhtml) 45 | genhtml_no_prefix = 0 46 | 47 | # Do not create source code view if non-zero (same as --no-source option of 48 | # genhtml) 49 | genhtml_no_source = 0 50 | 51 | # Replace tabs with number of spaces in source view (same as --num-spaces 52 | # option of genhtml) 53 | genhtml_num_spaces = 8 54 | 55 | # Highlight lines with converted-only data if non-zero (same as --highlight 56 | # option of genhtml) 57 | genhtml_highlight = 0 58 | 59 | # Include color legend in HTML output if non-zero (same as --legend option of 60 | # genhtml) 61 | genhtml_legend = 0 62 | 63 | # Use FILE as HTML prolog for generated pages (same as --html-prolog option of 64 | # genhtml) 65 | #genhtml_html_prolog = FILE 66 | 67 | # Use FILE as HTML epilog for generated pages (same as --html-epilog option of 68 | # genhtml) 69 | #genhtml_html_epilog = FILE 70 | 71 | # Use custom filename extension for pages (same as --html-extension option of 72 | # genhtml) 73 | #genhtml_html_extension = html 74 | 75 | # Compress all generated html files with gzip. 76 | #genhtml_html_gzip = 1 77 | 78 | # Include sorted overview pages (can be disabled by the --no-sort option of 79 | # genhtml) 80 | genhtml_sort = 1 81 | 82 | # Include function coverage data display (can be disabled by the 83 | # --no-func-coverage option of genhtml) 84 | #genhtml_function_coverage = 1 85 | 86 | # Include branch coverage data display (can be disabled by the 87 | # --no-branch-coverage option of genhtml) 88 | #genhtml_branch_coverage = 1 89 | 90 | # Specify the character set of all generated HTML pages 91 | genhtml_charset=UTF-8 92 | 93 | # Location of the gcov tool (same as --gcov-info option of geninfo) 94 | #geninfo_gcov_tool = gcov 95 | 96 | # Adjust test names to include operating system information if non-zero 97 | #geninfo_adjust_testname = 0 98 | 99 | # Calculate checksum for each source code line if non-zero (same as --checksum 100 | # option of geninfo if non-zero, same as --no-checksum if zero) 101 | #geninfo_checksum = 1 102 | 103 | # Specify whether to capture coverage data for external source files (can 104 | # be overridden by the --external and --no-external options of geninfo/lcov) 105 | #geninfo_external = 1 106 | 107 | # Enable libtool compatibility mode if non-zero (same as --compat-libtool option 108 | # of geninfo if non-zero, same as --no-compat-libtool if zero) 109 | #geninfo_compat_libtool = 0 110 | 111 | # Use gcov's --all-blocks option if non-zero 112 | #geninfo_gcov_all_blocks = 1 113 | 114 | # Specify compatiblity modes (same as --compat option of geninfo). 115 | #geninfo_compat = libtool=on, hammer=auto, split_crc=auto 116 | 117 | # Adjust path to source files by removing or changing path components that 118 | # match the specified pattern (Perl regular expression format) 119 | #geninfo_adjust_src_path = /tmp/build => /usr/src 120 | 121 | # Specify if geninfo should try to automatically determine the base-directory 122 | # when collecting coverage data. 123 | geninfo_auto_base = 1 124 | 125 | # Directory containing gcov kernel files 126 | # lcov_gcov_dir = /proc/gcov 127 | 128 | # Location of the insmod tool 129 | lcov_insmod_tool = /sbin/insmod 130 | 131 | # Location of the modprobe tool 132 | lcov_modprobe_tool = /sbin/modprobe 133 | 134 | # Location of the rmmod tool 135 | lcov_rmmod_tool = /sbin/rmmod 136 | 137 | # Location for temporary directories 138 | lcov_tmp_dir = /tmp 139 | 140 | # Show full paths during list operation if non-zero (same as --list-full-path 141 | # option of lcov) 142 | lcov_list_full_path = 0 143 | 144 | # Specify the maximum width for list output. This value is ignored when 145 | # lcov_list_full_path is non-zero. 146 | lcov_list_width = 80 147 | 148 | # Specify the maximum percentage of file names which may be truncated when 149 | # choosing a directory prefix in list output. This value is ignored when 150 | # lcov_list_full_path is non-zero. 151 | lcov_list_truncate_max = 20 152 | 153 | # Specify if function coverage data should be collected and processed. 154 | lcov_function_coverage = 1 155 | 156 | # Specify if branch coverage data should be collected and processed. 157 | lcov_branch_coverage = 0 158 | -------------------------------------------------------------------------------- /XcodeCoverage/lcov-1.10/contrib/galaxy/gen_makefile.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | cd image 4 | 5 | # Space-optimized version: strip comments, drop precision to 3 6 | # figures, eliminate duplicates. 7 | # update(creinig): precision reduction is now done in data2ps and comments 8 | # (except for % bound) now are also ommitted from the start 9 | 10 | echo 'image.ps: image-unop.ps' 11 | #echo ' grep -v "^%" < $< | sed -e "s/\.\([0-9][0-9]\)[0-9]\+/.\1/g" -e "s/\(^\| \|-\)\([0-9][0-9][0-9]\)[0-9][0-9]\.[0-9][0-9]/\1\200/g" -e "s/\(^\| \|-\)\([0-9][0-9][0-9]\)[0-9]\.[0-9][0-9]/\1\20/g" -e "s/\(^\| \|-\)\([0-9][0-9][0-9]\)\.[0-9][0-9]/\1\2/g" -e "s/\(^\| \|-\)\([0-9][0-9]\)\.\([0-9]\)[0-9]/\1\2.\30/g" | awk "\$$0 ~ /lineto/ { if ( LASTLINE == \$$0 ) next; } { LASTLINE=\$$0; print; }" > $@' 12 | echo ' grep -v "^% bound" < $< > $@' 13 | # Need last comment (bounding box) 14 | echo ' tail -1 $< >> $@' 15 | echo ' ls -l image.ps image-unop.ps' 16 | 17 | echo 'image-unop.ps: outline.ps ring1.ps ring2.ps ring3.ps ring4.ps' 18 | echo ' cat ring[1234].ps > $@' 19 | # Bounding box is at bottom now. Next two won't change it. 20 | echo ' tail -1 $@ > bounding-box' 21 | echo ' cat outline.ps >> $@' 22 | echo ' cat ../tux.ps >> $@' 23 | echo ' cat bounding-box >> $@ && rm bounding-box' 24 | 25 | # Finished rings are precious! 26 | echo .SECONDARY: ring1.ps ring2.ps ring3.ps ring4.ps 27 | 28 | # Rings 1 and 4 are all thrown together. 29 | echo RING1_DEPS:=`find $RING1 -name '*.c.*' | sed 's/\.c.*/-all.ps/' | sort | uniq` 30 | echo RING4_DEPS:=`find $RING4 -name '*.c.*' | sed 's/\.c.*/-all.ps/' | sort | uniq` 31 | 32 | # Other rings are divided into dirs. 33 | echo RING2_DEPS:=`for d in $RING2; do echo $d-ring2.ps; done` 34 | echo RING3_DEPS:=`for d in $RING3; do echo $d-ring3.ps; done` 35 | echo 36 | 37 | # First ring starts at inner radius. 38 | echo 'ring1.ps: $(RING1_DEPS)' 39 | echo " @echo Making Ring 1" 40 | echo " @echo /angle 0 def > \$@" 41 | echo " @../draw_arrangement $FILE_SCRUNCH 0 360 $INNER_RADIUS \$(RING1_DEPS) >> \$@" 42 | echo " @echo Done Ring 1" 43 | 44 | # Second ring starts at end of above ring (assume it's circular, so 45 | # grab any bound). 46 | echo 'ring2.ps: ring1.ps $(RING2_DEPS)' 47 | echo " @echo Making Ring 2" 48 | echo " @echo /angle 0 def > \$@" 49 | echo " @../rotary_arrange.sh $DIR_SPACING" `for f in $RING2; do echo $f-ring2.ps $f-ring2.angle; done` '>> $@' 50 | echo " @echo Done Ring 2" 51 | 52 | # Third ring starts at end of second ring. 53 | echo 'ring3.ps: ring2.ps $(RING3_DEPS)' 54 | echo " @echo Making Ring 3" 55 | echo " @echo /angle 0 def > \$@" 56 | echo " @../rotary_arrange.sh $DIR_SPACING" `for f in $RING3; do echo $f-ring3.ps $f-ring3.angle; done` '>> $@' 57 | echo " @echo Done Ring 3" 58 | 59 | # Outer ring starts at end of fourth ring. 60 | # And it's just a big ring of drivers. 61 | echo 'ring4.ps: $(RING4_DEPS) ring3.radius' 62 | echo " @echo Making Ring 4" 63 | echo " @echo /angle 0 def > \$@" 64 | echo " @../draw_arrangement $FILE_SCRUNCH 0 360 \`cat ring3.radius\` \$(RING4_DEPS) >> \$@" 65 | echo " @echo Done Ring 4" 66 | echo 67 | 68 | # How to make directory picture: angle file contains start and end angle. 69 | # Second ring starts at end of above ring (assume it's circular, so 70 | # grab any bound). 71 | echo "%-ring2.ps: %-ring2.angle ring1.radius" 72 | echo " @echo Rendering \$@" 73 | echo " @../draw_arrangement $FILE_SCRUNCH 0 \`cat \$<\` \`cat ring1.radius\` \`find \$* -name '*-all.ps'\` > \$@" 74 | 75 | echo "%-ring3.ps: %-ring3.angle ring2.radius" 76 | echo " @echo Rendering \$@" 77 | echo " @../draw_arrangement $FILE_SCRUNCH 0 \`cat \$<\` \`cat ring2.radius\` \`find \$* -name '*-all.ps'\` > \$@" 78 | 79 | # How to extract radii 80 | echo "%.radius: %.ps" 81 | echo ' @echo scale=2\; `tail -1 $< | sed "s/^.* //"` + '$RING_SPACING' | bc > $@' 82 | echo 83 | 84 | # How to make angle. Need total angle for that directory, and weight. 85 | echo "%-ring2.angle: %-ring2.weight ring2.weight" 86 | echo ' @echo "scale=2; ( 360 - ' `echo $RING2 | wc -w` ' * ' $DIR_SPACING ') * `cat $<` / `cat ring2.weight`" | bc > $@' 87 | 88 | echo "%-ring3.angle: %-ring3.weight ring3.weight" 89 | echo ' @echo "scale=2; ( 360 - ' `echo $RING3 | wc -w` ' * ' $DIR_SPACING ') * `cat $<` / `cat ring3.weight`" | bc > $@' 90 | 91 | # How to make ring weights (sum directory totals). 92 | echo "ring2.weight:" `for d in $RING2; do echo $d-ring2.weight; done` 93 | echo ' @cat $^ | ../tally > $@' 94 | echo "ring3.weight:" `for d in $RING3; do echo $d-ring3.weight; done` 95 | echo ' @cat $^ | ../tally > $@' 96 | 97 | # How to make a wieght. 98 | echo "%-ring2.weight:" `find $RING2 -name '*.c.*' | sed 's/\.c.*/-all.ps/' | sort | uniq` 99 | echo ' @../total_area.pl `find $* -name \*-all.ps` > $@' 100 | echo "%-ring3.weight:" `find $RING3 -name '*.c.*' | sed 's/\.c.*/-all.ps/' | sort | uniq` 101 | echo ' @../total_area.pl `find $* -name \*-all.ps` > $@' 102 | echo 103 | 104 | # Now rule to make the graphs of a function. 105 | #echo %.ps::% 106 | #echo ' @../function2ps `echo $< | sed '\''s/^.*\.\([^.]*\)\.\+.*$$/\1/'\''` > $@ $<' 107 | ## Need the space. 108 | ##echo ' @rm -f $<' 109 | #echo 110 | 111 | # Rule to make all from constituent parts. 112 | echo %-all.ps: 113 | echo " @echo Rendering \$*.c" 114 | echo " @../conglomerate_functions.pl $FUNCTION_SCRUNCH $BOX_SCRUNCH \$^ > \$@" 115 | # Need the space. 116 | #echo ' @rm -f $^' 117 | echo 118 | 119 | # Generating outline, requires all the angles. 120 | echo outline.ps: ../make-outline.sh ring1.ps ring2.ps ring3.ps ring4.ps `for f in $RING2; do echo $f-ring2.angle; done` `for f in $RING3; do echo $f-ring3.angle; done` 121 | echo " ../make-outline.sh $INNER_RADIUS $DIR_SPACING $RING_SPACING \"$RING1\" > \$@" 122 | echo 123 | 124 | # Now all the rules to make each function. 125 | for d in `find . -type d`; do 126 | for f in `cd $d; ls *+.ps 2>/dev/null | sed 's/\.c\..*$//' | uniq`; do 127 | echo $d/$f-all.ps: `cd $d; ls $f.c.* | sed -e "s?^?$d/?"` 128 | done 129 | done 130 | -------------------------------------------------------------------------------- /Classes/Public/NSFNanoExpression.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoExpression.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import 28 | 29 | #import "NSFNanoGlobals.h" 30 | 31 | @class NSFNanoPredicate; 32 | 33 | /*! @file NSFNanoExpression.h 34 | @brief A unit that describes a series of predicates and its operators. 35 | */ 36 | 37 | /** @class NSFNanoExpression 38 | * A unit that describes a series of predicates and its operators. 39 | * @details Example: 40 | @code 41 | // Instantiate a NanoStore and open it 42 | NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil]; 43 | 44 | // Prepare the expression 45 | NSFNanoPredicate *attribute = [NSFNanoPredicate predicateWithColumn:NSFAttributeColumn matching:NSFEqualTo value:@"FirstName"]; 46 | NSFNanoPredicate *value = [NSFNanoPredicate predicateWithColumn:NSFValueColumn matching:NSFEqualTo value:@"Joe"]; 47 | NSFNanoExpression *expression = [NSFNanoExpression expressionWithPredicate:attribute]; 48 | [expression addPredicate:value withOperator:NSFAnd]; 49 | 50 | // Setup the search with the document store and a given expression 51 | NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore]; 52 | [search setExpressions:[NSArray arrayWithObject:expression]]; 53 | 54 | // Obtain the matching objects 55 | NSDictionary *searchResults = [search searchObjectsWithReturnType:NSFReturnObjects error:nil]; 56 | 57 | // Close the document store 58 | [nanoStore closeWithError:nil]; 59 | @endcode 60 | */ 61 | 62 | @interface NSFNanoExpression : NSObject 63 | 64 | /** * Array of NSFNanoPredicate */ 65 | @property (nonatomic, readonly, nonnull) NSArray *predicates; 66 | /** * Array of NSNumber wrapping \link NSFGlobals::NSFOperator NSFOperator \endlink */ 67 | @property (nonatomic, readonly, nonnull) NSArray *operators; 68 | 69 | /** @name Creating and Initializing Expressions 70 | */ 71 | 72 | //@{ 73 | 74 | /** * Creates and returns an expression with a given predicate. 75 | * @param thePredicate the predicate used to initialize the expression. Must not be nil. 76 | * @return An expression upon success, nil otherwise. 77 | * @warning The parameter thePredicate must not be nil. 78 | * @throws NSFUnexpectedParameterException is thrown if the predicate is nil. 79 | * @see \link initWithPredicate: - (id)initWithPredicate:(NSFNanoPredicate *)aPredicate \endlink 80 | */ 81 | 82 | + (nonnull NSFNanoExpression *)expressionWithPredicate:(nonnull NSFNanoPredicate *)thePredicate; 83 | 84 | /** * Initializes a newly allocated expression with a given expression. 85 | * @param thePredicate the predicate used to initialize the expression. Must not be nil. 86 | * @return An expression upon success, nil otherwise. 87 | * @warning The parameter thePredicate must not be nil. 88 | * @throws NSFUnexpectedParameterException is thrown if the predicate is nil. 89 | * @see \link expressionWithPredicate: + (NSFNanoExpression*)expressionWithPredicate:(NSFNanoPredicate *)thePredicate \endlink 90 | */ 91 | 92 | - (nonnull instancetype)initWithPredicate:(nonnull NSFNanoPredicate *)thePredicate NS_DESIGNATED_INITIALIZER; 93 | 94 | //@} 95 | 96 | /** @name Adding a Predicate 97 | */ 98 | 99 | //@{ 100 | 101 | /** * Adds a predicate to the expression. 102 | * @param thePredicate is added to the expression. 103 | * @param theOperator specifies the operation (AND/OR) to be applied. 104 | * @warning The parameter thePredicate must not be nil. 105 | * @throws NSFUnexpectedParameterException is thrown if the predicate is nil. 106 | */ 107 | 108 | - (void)addPredicate:(nonnull NSFNanoPredicate *)thePredicate withOperator:(NSFOperator)theOperator; 109 | 110 | //@} 111 | 112 | /** @name Miscellaneous 113 | */ 114 | 115 | //@{ 116 | 117 | /** * Returns a string representation of the expression. 118 | * @note Check properties predicates and operators to find out the current state of the expression. 119 | */ 120 | 121 | @property (nonatomic, readonly, copy, nonnull) NSString *description; 122 | 123 | /** Returns a JSON representation of the expression. 124 | * @note Check properties predicates and operators to find out the current state of the expression. 125 | */ 126 | 127 | @property (nonatomic, readonly, copy, nonnull) NSString *JSONDescription; 128 | 129 | //@} 130 | 131 | @end 132 | -------------------------------------------------------------------------------- /Classes/Public/NSFNanoPredicate.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoPredicate.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | /*! @file NSFNanoPredicate.h 28 | @brief A predicate is an element of an expression used to perform complex queries. 29 | */ 30 | 31 | /** @class NSFNanoPredicate 32 | * A predicate is an element of an expression used to perform complex queries. 33 | * 34 | * @note 35 | * A predicate must be added to a NSFNanoExpression. 36 | * 37 | * @details Example: 38 | @code 39 | // Instantiate a NanoStore and open it 40 | NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil]; 41 | 42 | // Add some data to the document store 43 | NSDictionary *info = ...; 44 | NSFNanoObject *object = [NSFNanoObject nanoObjectWithDictionary:info]; 45 | [nanoStore addObject:object error:nil]; 46 | 47 | // Prepare the expression 48 | NSFNanoPredicate *attribute = [NSFNanoPredicate predicateWithColumn:NSFAttributeColumn matching:NSFEqualTo value:@"FirstName"]; 49 | NSFNanoPredicate *value = [NSFNanoPredicate predicateWithColumn:NSFValueColumn matching:NSFEqualTo value:@"Hobbes"]; 50 | NSFNanoExpression *expression = [NSFNanoExpression expressionWithPredicate:predicateAttribute]; 51 | [expression addPredicate:predicateValue withOperator:NSFAnd]; 52 | 53 | // Setup the search with the document store and a given expression 54 | NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore]; 55 | [search setExpressions:[NSArray arrayWithObject:expression]]; 56 | 57 | // Obtain the matching objects 58 | NSDictionary *searchResults = [search searchObjectsWithReturnType:NSFReturnObjects error:nil]; 59 | 60 | // Close the document store 61 | [nanoStore closeWithError:nil]; 62 | @endcode 63 | * 64 | * @see \link NSFNanoExpression::expressionWithPredicate: + (NSFNanoExpression*)expressionWithPredicate:(NSFNanoPredicate *)thePredicate \endlink 65 | * @see \link NSFNanoExpression::initWithPredicate: - (id)initWithPredicate:(NSFNanoPredicate *)thePredicate \endlink 66 | * @see \link NSFNanoExpression::addPredicate:withOperator: - (void)addPredicate:(NSFNanoPredicate *)thePredicate withOperator:(NSFOperator)theOperator \endlink 67 | */ 68 | 69 | #import 70 | 71 | #import "NSFNanoGlobals.h" 72 | 73 | @interface NSFNanoPredicate : NSObject 74 | 75 | /** * The type of column being referenced. */ 76 | @property (nonatomic, assign, readonly) NSFTableColumnType column; 77 | /** * The comparison operator to be used. */ 78 | @property (nonatomic, assign, readonly) NSFMatchType match; 79 | /** * The value to be used for comparison. */ 80 | @property (nonatomic, readonly, nonnull) id value; 81 | 82 | /** @name Creating and Initializing a Predicate 83 | */ 84 | 85 | //@{ 86 | 87 | /** * Creates and returns a predicate. 88 | * @param theType is the column type. Can be \link Globals::NSFKeyColumn NSFKeyColumn \endlink, \link Globals::NSFAttributeColumn NSFAttributeColumn \endlink or \link Globals::NSFValueColumn NSFValueColumn \endlink. 89 | * @param theMatch is the match operator. 90 | * @param theValue can be an NSString or [NSNull null] 91 | * @return A predicate which can be used in an NSFNanoExpression. 92 | * @see \link initWithColumn:matching:value: - (id)initWithColumn:(NSFTableColumnType)theType matching:(NSFMatchType)theMatch value:(NSString *)theValue \endlink 93 | */ 94 | 95 | + (nullable NSFNanoPredicate*)predicateWithColumn:(NSFTableColumnType)theType matching:(NSFMatchType)theMatch value:(nonnull id)theValue; 96 | 97 | /** * Initializes a newly allocated predicate. 98 | * @param theType is the column type. Can be \link Globals::NSFKeyColumn NSFKeyColumn \endlink, \link Globals::NSFAttributeColumn NSFAttributeColumn \endlink or \link Globals::NSFValueColumn NSFValueColumn \endlink. 99 | * @param theMatch is the match operator. 100 | * @param theValue can be an NSString or [NSNull null] 101 | * @return A predicate which can be used in an NSFNanoExpression. 102 | * @see \link predicateWithColumn:matching:value: + (NSFNanoPredicate*)predicateWithColumn:(NSFTableColumnType)theType matching:(NSFMatchType)theMatch value:(NSString *)theValue \endlink 103 | */ 104 | 105 | - (nullable instancetype)initWithColumn:(NSFTableColumnType)theType matching:(NSFMatchType)theMatch value:(nonnull id)theValue NS_DESIGNATED_INITIALIZER; 106 | 107 | //@} 108 | 109 | /** @name Miscellaneous 110 | */ 111 | 112 | //@{ 113 | 114 | /** * Returns a string representation of the predicate. 115 | * @note Check properties column, match and value to find out the current state of the predicate. 116 | */ 117 | 118 | @property (nonatomic, readonly, copy, nonnull) NSString *description; 119 | 120 | /** * Returns a JSON representation of the predicate. 121 | * @note Check properties column, match and value to find out the current state of the predicate. 122 | */ 123 | 124 | @property (nonatomic, readonly, copy, nonnull) NSString *JSONDescription; 125 | 126 | //@} 127 | 128 | @end 129 | -------------------------------------------------------------------------------- /Classes/Public/NSFNanoSortDescriptor.h: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoSortDescriptor.h 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import 28 | 29 | #import "NSFNanoGlobals.h" 30 | 31 | /*! @file NSFNanoSortDescriptor.h 32 | @brief A unit that describes a sort to be used in conjunction with a search operation. 33 | */ 34 | 35 | /** @class NSFNanoSortDescriptor 36 | * A unit that describes a sort to be used in conjunction with a search operation. 37 | * @details Example: 38 | @code 39 | // Instantiate a NanoStore and open it 40 | NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil]; 41 | [nanoStore removeAllObjectsFromStoreAndReturnError:nil]; 42 | 43 | NSFNanoObject *obj1 = [NSFNanoObject nanoObjectWithDictionary:[NSDictionary dictionaryWithObject:@"Madrid" forKey:@"City"]]; 44 | NSFNanoObject *obj2 = [NSFNanoObject nanoObjectWithDictionary:[NSDictionary dictionaryWithObject:@"Barcelona" forKey:@"City"]]; 45 | NSFNanoObject *obj3 = [NSFNanoObject nanoObjectWithDictionary:[NSDictionary dictionaryWithObject:@"San Sebastian" forKey:@"City"]]; 46 | NSFNanoObject *obj4 = [NSFNanoObject nanoObjectWithDictionary:[NSDictionary dictionaryWithObject:@"Zaragoza" forKey:@"City"]]; 47 | NSFNanoObject *obj5 = [NSFNanoObject nanoObjectWithDictionary:[NSDictionary dictionaryWithObject:@"Tarragona" forKey:@"City"]]; 48 | 49 | [nanoStore addObjectsFromArray:[NSArray arrayWithObjects:obj1, obj2, obj3, obj4, obj5, nil] error:nil]; 50 | 51 | // Prepare the sort descriptor 52 | NSFNanoSortDescriptor *sortCities = [[NSFNanoSortDescriptor alloc]initWithAttribute:@"City" ascending:YES]; 53 | 54 | // Prepare the search 55 | NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore]; 56 | search.sort = [NSArray arrayWithObjects: sortCities, nil]; 57 | 58 | // Perform the search 59 | NSArray *searchResults = [search searchObjectsWithReturnType:NSFReturnObjects error:nil]; 60 | XCTAssertTrue ([searchResults count] == 5, @"Expected to find five objects."); 61 | XCTAssertTrue ([[[[searchResults objectAtIndex:0]info]objectForKey:@"City"]isEqualToString:@"Barcelona"], @"Expected to find Barcelona."); 62 | 63 | for (NSFNanoObject *object in searchResults) { 64 | NSLog(@"%@", [[object info]objectForKey:@"City"]); 65 | } 66 | 67 | // Close the document store 68 | [nanoStore closeWithError:nil]; 69 | @endcode 70 | */ 71 | 72 | @interface NSFNanoSortDescriptor : NSObject 73 | 74 | /** * The property key to use when performing a comparison */ 75 | @property (nonatomic, copy, readonly, nonnull) NSString *attribute; 76 | /** * The property to indicate whether the comparison should be performed in ascending mode */ 77 | @property (nonatomic, readonly) BOOL isAscending; 78 | 79 | /** @name Creating and Initializing Expressions 80 | */ 81 | 82 | //@{ 83 | 84 | /** * Creates and returns an sort descriptor with the specified key and ordering. 85 | * @param theKey the property key to use when performing a comparison. Must not be nil or empty. 86 | * @param ascending YES if the sort descriptor specifies sorting in ascending order, otherwise NO. 87 | * @return A sort descriptor initialized with the specified key and ordering. 88 | * @warning The parameter theKey must not be nil. 89 | * @throws NSFUnexpectedParameterException is thrown if the key is nil. 90 | * @see \link initWithKey:ascending: - (id)initWithKey:(NSString *)theKey ascending:(BOOL)ascending \endlink 91 | */ 92 | 93 | + (nonnull NSFNanoSortDescriptor *)sortDescriptorWithAttribute:(nonnull NSString *)theAttribute ascending:(BOOL)ascending; 94 | 95 | /** * Initializes a newly allocated sort descriptor with the specified key and ordering. 96 | * @param theKey the property key to use when performing a comparison. Must not be nil or empty. 97 | * @param ascending YES if the sort descriptor specifies sorting in ascending order, otherwise NO. 98 | * @return A sort descriptor initialized with the specified key and ordering. 99 | * @warning The parameter theKey must not be nil. 100 | * @throws NSFUnexpectedParameterException is thrown if the key is nil. 101 | * @see \link sortDescriptorWithKey:ascending: - (NSFNanoSortDescriptor *)sortDescriptorWithKey:(NSString *)theKey ascending:(BOOL)ascending \endlink 102 | */ 103 | 104 | - (nonnull instancetype)initWithAttribute:(nonnull NSString *)theAttribute ascending:(BOOL)ascending NS_DESIGNATED_INITIALIZER; 105 | 106 | //@} 107 | 108 | /** @name Miscellaneous 109 | */ 110 | 111 | //@{ 112 | 113 | /** * Returns a string representation of the sort. 114 | * @note Check properties attribute and isAscending to find out the current state of the sort. 115 | */ 116 | 117 | @property (nonatomic, readonly, copy, nonnull) NSString *description; 118 | 119 | /** Returns a JSON representation of the sort. 120 | * @note Check properties attribute and isAscending to find out the current state of the sort. 121 | */ 122 | 123 | @property (nonatomic, readonly, copy, nonnull) NSString *JSONDescription; 124 | 125 | //@} 126 | 127 | @end 128 | -------------------------------------------------------------------------------- /Tests/UnitTests/NanoStore/NanoStoreGlobalsTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // NanoStoreGlobalsTests.m 3 | // NanoStore 4 | // 5 | // Created by Tito Ciuro on 4/18/12. 6 | // Copyright (c) 2013 Webbo, Inc. All rights reserved. 7 | // 8 | 9 | #import "NanoStore.h" 10 | #import "NanoStoreGlobalsTests.h" 11 | #import "NSFNanoGlobals.h" 12 | #import "NSFNanoGlobals_Private.h" 13 | #import "NSFNanoStore_Private.h" 14 | 15 | @interface NanoStoreGlobalsTests () 16 | @property (nonatomic) NSDictionary *defaultTestInfo; 17 | @end 18 | 19 | @implementation NanoStoreGlobalsTests 20 | 21 | - (void)setUp 22 | { 23 | [super setUp]; 24 | 25 | _defaultTestInfo = [NSFNanoStore _defaultTestData]; 26 | 27 | NSFSetIsDebugOn (NO); 28 | } 29 | 30 | - (void)tearDown 31 | { 32 | _defaultTestInfo = nil; 33 | 34 | NSFSetIsDebugOn (NO); 35 | 36 | [super tearDown]; 37 | } 38 | 39 | #pragma mark - 40 | 41 | - (void)testCheckDebugOn 42 | { 43 | NSFSetIsDebugOn (YES); 44 | BOOL isDebugOn = NSFIsDebugOn(); 45 | XCTAssertTrue (isDebugOn, @"Expected isDebugOn to be YES."); 46 | } 47 | 48 | - (void)testCheckDebugOff 49 | { 50 | NSFSetIsDebugOn (NO); 51 | BOOL isDebugOn = NSFIsDebugOn(); 52 | XCTAssertTrue (NO == isDebugOn, @"Expected isDebugOn to be NO."); 53 | } 54 | 55 | - (void)testStringFromNanoDataType 56 | { 57 | XCTAssertTrue([NSFStringFromNanoDataType(NSFNanoTypeUnknown) isEqualToString:@"UNKNOWN"], @"Expected to receive UNKNOWN."); 58 | XCTAssertTrue([NSFStringFromNanoDataType(NSFNanoTypeData) isEqualToString:@"BLOB"], @"Expected to receive BLOB."); 59 | XCTAssertTrue([NSFStringFromNanoDataType(NSFNanoTypeString) isEqualToString:@"TEXT"], @"Expected to receive TEXT."); 60 | XCTAssertTrue([NSFStringFromNanoDataType(NSFNanoTypeDate) isEqualToString:@"TEXT"], @"Expected to receive TEXT."); 61 | XCTAssertTrue([NSFStringFromNanoDataType(NSFNanoTypeNumber) isEqualToString:@"REAL"], @"Expected to receive REAL."); 62 | XCTAssertTrue([NSFStringFromNanoDataType(NSFNanoTypeRowUID) isEqualToString:@"INTEGER"], @"Expected to receive INTEGER."); 63 | } 64 | 65 | - (void)testNanoDataTypeFromString 66 | { 67 | XCTAssertTrue(NSFNanoTypeUnknown == NSFNanoDatatypeFromString(@"UNKNOWN"), @"Expected to receive NSFNanoTypeUnknown."); 68 | XCTAssertTrue(NSFNanoTypeData == NSFNanoDatatypeFromString(@"BLOB"), @"Expected to receive NSFNanoTypeData."); 69 | XCTAssertTrue(NSFNanoTypeString || NSFNanoTypeDate == NSFNanoDatatypeFromString(@"TEXT"), @"Expected to receive NSFNanoTypeString or NSFNanoTypeDate."); 70 | XCTAssertTrue(NSFNanoTypeNumber == NSFNanoDatatypeFromString(@"REAL"), @"Expected to receive NSFNanoTypeNumber."); 71 | XCTAssertTrue(NSFNanoTypeRowUID == NSFNanoDatatypeFromString(@"INTEGER"), @"Expected to receive NSFNanoTypeRowUID."); 72 | } 73 | 74 | - (void)testStringFromMatchType 75 | { 76 | XCTAssertTrue([NSFStringFromMatchType(NSFEqualTo) isEqualToString:@"Equal to"], @"Expected to receive UNKNOWN."); 77 | XCTAssertTrue([NSFStringFromMatchType(NSFBeginsWith) isEqualToString:@"Begins with"], @"Expected to receive Begins with."); 78 | XCTAssertTrue([NSFStringFromMatchType(NSFContains) isEqualToString:@"Contains"], @"Expected to receive Contains."); 79 | XCTAssertTrue([NSFStringFromMatchType(NSFEndsWith) isEqualToString:@"Ends with"], @"Expected to receive Ends with."); 80 | XCTAssertTrue([NSFStringFromMatchType(NSFInsensitiveEqualTo) isEqualToString:@"Equal to (case insensitive)"], @"Expected to receive Equal to (case insensitive)."); 81 | XCTAssertTrue([NSFStringFromMatchType(NSFInsensitiveBeginsWith) isEqualToString:@"Begins with (case insensitive)"], @"Expected to receive Begins with (case insensitive)."); 82 | XCTAssertTrue([NSFStringFromMatchType(NSFInsensitiveContains) isEqualToString:@"Contains (case insensitive)"], @"Expected to receive Contains (case insensitive)."); 83 | XCTAssertTrue([NSFStringFromMatchType(NSFInsensitiveEndsWith) isEqualToString:@"Ends with (case insensitive)"], @"Expected to receive Ends with (case insensitive)."); 84 | XCTAssertTrue([NSFStringFromMatchType(NSFGreaterThan) isEqualToString:@"Greater than"], @"Expected to receive Greater than."); 85 | XCTAssertTrue([NSFStringFromMatchType(NSFLessThan) isEqualToString:@"Less than"], @"Expected to receive Less than."); 86 | } 87 | 88 | - (void)testNSFLog 89 | { 90 | NSFSetIsDebugOn (YES); 91 | _NSFLog(@"Testing testNSFLog's coverage."); 92 | } 93 | 94 | - (void)testAllClassDescriptions 95 | { 96 | NSString *description = nil; 97 | 98 | NSFNanoEngine *engine = [NSFNanoEngine databaseWithPath:@":memory:"]; 99 | description = [engine JSONDescription]; 100 | XCTAssertTrue([description length] > 0, @"Expected NSFNanoEngine's JSONDescription value to be valid."); 101 | 102 | NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil]; 103 | description = [nanoStore JSONDescription]; 104 | XCTAssertTrue([description length] > 0, @"Expected NSFNanoStore's JSONDescription value to be valid."); 105 | 106 | NSFNanoObject *obj1 = [NSFNanoObject nanoObjectWithDictionary:_defaultTestInfo]; 107 | description = [obj1 JSONDescription]; 108 | XCTAssertTrue([description length] > 0, @"Expected NSFNanoObject's JSONDescription value to be valid."); 109 | 110 | NSFNanoObject *obj2 = [NSFNanoObject nanoObjectWithDictionary:_defaultTestInfo]; 111 | [nanoStore addObjectsFromArray:@[obj1, obj2] error:nil]; 112 | 113 | NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore]; 114 | description = [search JSONDescription]; 115 | XCTAssertTrue([description length] > 0, @"Expected NSFNanoSearch's JSONDescription value to be valid."); 116 | 117 | NSFNanoResult *result = [search executeSQL:@"SELECT COUNT(*) FROM NSFKEYS"]; 118 | description = [result JSONDescription]; 119 | XCTAssertTrue([description length] > 0, @"Expected NSFNanoResult's JSONDescription value to be valid."); 120 | 121 | NSFNanoSortDescriptor *sortDescriptor = [[NSFNanoSortDescriptor alloc]initWithAttribute:@"foo" ascending:YES]; 122 | description = [sortDescriptor JSONDescription]; 123 | XCTAssertTrue([description length] > 0, @"Expected NSFNanoSortDescriptor's JSONDescription value to be valid."); 124 | 125 | NSFNanoPredicate *predicate = [[NSFNanoPredicate alloc]initWithColumn:NSFAttributeColumn matching:NSFEqualTo value:@"foo"]; 126 | description = [predicate JSONDescription]; 127 | XCTAssertTrue([description length] > 0, @"Expected NSFNanoPredicate's JSONDescription value to be valid."); 128 | 129 | NSFNanoExpression *expression = [NSFNanoExpression expressionWithPredicate:predicate]; 130 | description = [expression JSONDescription]; 131 | XCTAssertTrue([description length] > 0, @"Expected NSFNanoExpression's JSONDescription value to be valid."); 132 | 133 | NSFNanoBag *bag = [NSFNanoBag bagWithObjects:@[obj1]]; 134 | description = [bag JSONDescription]; 135 | XCTAssertTrue([description length] > 0, @"Expected NSFNanoBag's JSONDescription value to be valid."); 136 | } 137 | 138 | @end 139 | -------------------------------------------------------------------------------- /Classes/Public/NSFNanoPredicate.m: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoExpression.m 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NSFNanoExpression.h" 28 | #import "NanoStore_Private.h" 29 | #import "NSFOrderedDictionary.h" 30 | 31 | @interface NSFNanoPredicate () 32 | 33 | /** \cond */ 34 | @property (nonatomic, assign, readwrite) NSFTableColumnType column; 35 | @property (nonatomic, assign, readwrite) NSFMatchType match; 36 | @property (nonatomic, readwrite) id value; 37 | /** \endcond */ 38 | 39 | @end 40 | 41 | @implementation NSFNanoPredicate 42 | 43 | // ---------------------------------------------- 44 | // Initialization / Cleanup 45 | // ---------------------------------------------- 46 | 47 | + (NSFNanoPredicate*)predicateWithColumn:(NSFTableColumnType)type matching:(NSFMatchType)matching value:(id)aValue 48 | { 49 | return [[self alloc]initWithColumn:type matching:matching value:aValue]; 50 | } 51 | 52 | - (instancetype)init 53 | { 54 | #pragma clang diagnostic push 55 | #pragma clang diagnostic ignored "-Wnonnull" 56 | return [self initWithColumn:NSFKeyColumn matching:NSFEqualTo value:nil]; 57 | #pragma clang diagnostic pop 58 | } 59 | 60 | - (instancetype)initWithColumn:(NSFTableColumnType)type matching:(NSFMatchType)matching value:(id)aValue 61 | { 62 | NSAssert(nil != aValue, @"*** -[%@ %@]: value is nil.", [self class], NSStringFromSelector(_cmd)); 63 | NSAssert([aValue isKindOfClass:[NSString class]] || [aValue isKindOfClass:[NSNull class]], @"*** -[%@ %@]: value must be of type NSString or NSNull.", [self class], NSStringFromSelector(_cmd)); 64 | 65 | if ((self = [super init])) { 66 | _column = type; 67 | _match = matching; 68 | _value = aValue; 69 | } 70 | 71 | return self; 72 | } 73 | 74 | - (NSString *)description 75 | { 76 | return [self arrayDescription].lastObject; 77 | } 78 | 79 | - (NSArray *)arrayDescription 80 | { 81 | NSMutableArray *values = [NSMutableArray new]; 82 | 83 | NSString *columnValue = nil; 84 | NSMutableString *mutatedString = nil; 85 | NSInteger mutatedStringLength = 0; 86 | 87 | switch (_column) { 88 | case NSFKeyColumn: 89 | columnValue = NSFKey; 90 | break; 91 | case NSFAttributeColumn: 92 | columnValue = NSFAttribute; 93 | break; 94 | default: 95 | columnValue = NSFValue; 96 | break; 97 | } 98 | 99 | // Make sure we escape quotes if present and the value is a string 100 | if ([_value isKindOfClass:[NSString class]]) { 101 | _value = [_value stringByReplacingOccurrencesOfString:@"'" withString:@"''"]; 102 | } else { 103 | _value = NSFStringFromNanoDataType(NSFNanoTypeNULL); 104 | columnValue = NSFDatatype; 105 | } 106 | 107 | switch (_match) { 108 | case NSFEqualTo: 109 | [values addObject:[NSString stringWithFormat:@"%@ = '%@'", columnValue, _value]]; 110 | break; 111 | case NSFBeginsWith: 112 | mutatedString = [NSMutableString stringWithString:_value]; 113 | mutatedStringLength = [_value length]; 114 | [mutatedString replaceCharactersInRange:NSMakeRange(mutatedStringLength - 1, 1) withString:[NSString stringWithFormat:@"%c", [mutatedString characterAtIndex:mutatedStringLength - 1]+1]]; 115 | [values addObject:[NSString stringWithFormat:@"(%@ >= '%@' AND %@ < '%@')", columnValue, _value, columnValue, mutatedString]]; 116 | break; 117 | case NSFContains: 118 | [values addObject:[NSString stringWithFormat:@"%@ GLOB '*%@*'", columnValue, _value]]; 119 | break; 120 | case NSFEndsWith: 121 | [values addObject:[NSString stringWithFormat:@"%@ GLOB '*%@'", columnValue, _value]]; 122 | break; 123 | case NSFInsensitiveEqualTo: 124 | [values addObject:[NSString stringWithFormat:@"upper(%@) = '%@'", columnValue, [_value uppercaseString]]]; 125 | break; 126 | case NSFInsensitiveBeginsWith: 127 | mutatedString = [NSMutableString stringWithString:_value]; 128 | mutatedStringLength = [_value length]; 129 | [mutatedString replaceCharactersInRange:NSMakeRange(mutatedStringLength - 1, 1) withString:[NSString stringWithFormat:@"%c", [mutatedString characterAtIndex:mutatedStringLength - 1]+1]]; 130 | [values addObject:[NSString stringWithFormat:@"(upper(%@) >= '%@' AND upper(%@) < '%@')", columnValue, [_value uppercaseString], columnValue, mutatedString.uppercaseString]]; 131 | break; 132 | case NSFInsensitiveContains: 133 | [values addObject:[NSString stringWithFormat:@"%@ LIKE '%@%@%@'", columnValue, @"%", _value, @"%"]]; 134 | break; 135 | case NSFInsensitiveEndsWith: 136 | [values addObject:[NSString stringWithFormat:@"%@ LIKE '%@%@'", columnValue, @"%", _value]]; 137 | break; 138 | case NSFGreaterThan: 139 | [values addObject:[NSString stringWithFormat:@"%@ > '%@'", columnValue, _value]]; 140 | break; 141 | case NSFLessThan: 142 | [values addObject:[NSString stringWithFormat:@"%@ < '%@'", columnValue, _value]]; 143 | break; 144 | case NSFNotEqualTo: 145 | [values addObject:[NSString stringWithFormat:@"%@ <> '%@'", columnValue, _value]]; 146 | break; 147 | } 148 | 149 | return values; 150 | } 151 | 152 | - (NSString *)JSONDescription 153 | { 154 | NSArray *values = [self arrayDescription]; 155 | 156 | NSError *outError = nil; 157 | NSString *description = [NSFNanoObject _NSObjectToJSONString:values error:&outError]; 158 | 159 | return description; 160 | } 161 | 162 | /** \cond */ 163 | 164 | 165 | /** \endcond */ 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /Classes/Public/NSFNanoGlobals.m: -------------------------------------------------------------------------------- 1 | /* 2 | NSFNanoGlobals.m 3 | NanoStore 4 | 5 | Copyright (c) 2013 Webbo, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted 8 | provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions 11 | and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions 13 | and the following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote 15 | products derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | SUCH DAMAGE. 25 | */ 26 | 27 | #import "NSFNanoGlobals.h" 28 | 29 | static BOOL __NSFDebugIsOn = NO; 30 | 31 | void NSFSetIsDebugOn (BOOL flag) 32 | { 33 | __NSFDebugIsOn = flag; 34 | } 35 | 36 | BOOL NSFIsDebugOn (void) 37 | { 38 | return __NSFDebugIsOn; 39 | } 40 | 41 | NSString * NSFStringFromNanoDataType (NSFNanoDatatype aNanoDatatype) 42 | { 43 | NSString *value = nil; 44 | 45 | switch (aNanoDatatype) { 46 | case NSFNanoTypeUnknown: value = @"UNKNOWN"; break; 47 | case NSFNanoTypeData: value = @"BLOB"; break; 48 | case NSFNanoTypeString: value = @"TEXT"; break; 49 | case NSFNanoTypeDate: value = @"TEXT"; break; 50 | case NSFNanoTypeNumber: value = @"REAL"; break; 51 | case NSFNanoTypeRowUID: value = @"INTEGER"; break; 52 | case NSFNanoTypeNULL: value = @"NULL"; break; 53 | case NSFNanoTypeURL: value = @"URL"; break; 54 | } 55 | 56 | return value; 57 | } 58 | 59 | NSFNanoDatatype NSFNanoDatatypeFromString (NSString *aNanoDatatype) 60 | { 61 | NSFNanoDatatype value = NSFNanoTypeUnknown; 62 | 63 | if ([aNanoDatatype isEqualToString:@"BLOB"]) value = NSFNanoTypeData; 64 | else if ([aNanoDatatype isEqualToString:@"TEXT"]) value = NSFNanoTypeString; 65 | else if ([aNanoDatatype isEqualToString:@"TEXT"]) value = NSFNanoTypeDate; 66 | else if ([aNanoDatatype isEqualToString:@"REAL"]) value = NSFNanoTypeNumber; 67 | else if ([aNanoDatatype isEqualToString:@"INTEGER"]) value = NSFNanoTypeRowUID; 68 | else if ([aNanoDatatype isEqualToString:@"NULL"]) value = NSFNanoTypeNULL; 69 | else if ([aNanoDatatype isEqualToString:@"URL"]) value = NSFNanoTypeURL; 70 | return value; 71 | } 72 | 73 | NSString * NSFStringFromMatchType (NSFMatchType aMatchType) 74 | { 75 | NSString *value = nil; 76 | 77 | switch (aMatchType) { 78 | case NSFEqualTo: value = @"Equal to"; break; 79 | case NSFBeginsWith: value = @"Begins with"; break; 80 | case NSFContains: value = @"Contains"; break; 81 | case NSFEndsWith: value = @"Ends with"; break; 82 | case NSFInsensitiveEqualTo: value = @"Equal to (case insensitive)"; break; 83 | case NSFInsensitiveBeginsWith: value = @"Begins with (case insensitive)"; break; 84 | case NSFInsensitiveContains: value = @"Contains (case insensitive)"; break; 85 | case NSFInsensitiveEndsWith: value = @"Ends with (case insensitive)"; break; 86 | case NSFGreaterThan: value = @"Greater than"; break; 87 | case NSFLessThan: value = @"Less than"; break; 88 | case NSFNotEqualTo: value = @"Not equal to"; break; 89 | } 90 | 91 | return value; 92 | } 93 | 94 | void _NSFLog (NSString *format, ...) 95 | { 96 | if (__NSFDebugIsOn) { 97 | va_list args; 98 | va_start(args, format); 99 | NSString *string = [[NSString alloc]initWithFormat:format arguments:args]; 100 | NSLog(@"%@", string); 101 | va_end(args); 102 | } 103 | } 104 | 105 | NSString * const NSFVersionKey = @"2.0a"; 106 | NSString * const NSFDomainKey = @"com.Webbo.NanoStore.ErrorDomain"; 107 | 108 | NSString * const NSFMemoryDatabase = @":memory:"; 109 | NSString * const NSFTemporaryDatabase = @""; 110 | NSString * const NSFUnexpectedParameterException = @"NSFUnexpectedParameterException"; 111 | NSString * const NSFNonConformingNanoObjectProtocolException = @"NSFNonConformingNanoObjectProtocolException"; 112 | NSString * const NSFNanoObjectBehaviorException = @"NSFNanoObjectBehaviorException"; 113 | NSString * const NSFNanoStoreUnableToManipulateStoreException = @"NSFNanoStoreUnableToManipulateStoreException"; 114 | NSString * const NSFKeys = @"NSFKeys"; 115 | NSString * const NSFValues = @"NSFValues"; 116 | NSString * const NSFKey = @"NSFKey"; 117 | NSString * const NSFAttribute = @"NSFAttribute"; 118 | NSString * const NSFValue = @"NSFValue"; 119 | NSString * const NSFDatatype = @"NSFDatatype"; 120 | NSString * const NSFCalendarDate = @"NSFCalendarDate"; 121 | NSString * const NSFObjectClass = @"NSFObjectClass"; 122 | NSString * const NSFKeyedArchive = @"NSFKeyedArchive"; 123 | 124 | #pragma mark - 125 | 126 | NSString * const NSF_Private_NSFKeys_NSFKey = @"NSFKeys.NSFKey"; 127 | NSString * const NSF_Private_NSFKeys_NSFKeyedArchive = @"NSFKeys.NSFKeyedArchive"; 128 | NSString * const NSF_Private_NSFValues_NSFKey = @"NSFValues.NSFKey"; 129 | NSString * const NSF_Private_NSFValues_NSFAttribute = @"NSFValues.NSFAttribute"; 130 | NSString * const NSF_Private_NSFValues_NSFValue = @"NSFValues.NSFValue"; 131 | NSString * const NSF_Private_NSFNanoBag_Name = @"NSF_Private_NSFNanoBag_Name"; 132 | NSString * const NSF_Private_NSFNanoBag_NSFKey = @"NSF_Private_NSFNanoBag_NSFKey"; 133 | NSString * const NSF_Private_NSFNanoBag_NSFObjectKeys = @"NSF_Private_NSFNanoBag_NSFObjectKeys"; 134 | NSString * const NSF_Private_ToDeleteTableKey = @"NSF_Private_ToDeleteTableKey"; 135 | 136 | NSString * const NSFRowIDColumnName = @"ROWID"; 137 | 138 | NSInteger const NSF_Private_InvalidParameterDataCodeKey = -10000; 139 | NSInteger const NSF_Private_MacOSXErrorCodeKey = -10001; 140 | NSInteger const NSFNanoStoreErrorKey = -10002; 141 | 142 | #pragma mark Private section 143 | 144 | NSString * const NSFP_TableIdentifier = @"NSFP_TableIdentifier"; 145 | NSString * const NSFP_ColumnIdentifier = @"NSFP_ColumnIdentifier"; 146 | NSString * const NSFP_DatatypeIdentifier = @"NSFP_DatatypeIdentifier"; 147 | -------------------------------------------------------------------------------- /Examples/iTunesImporter/iTunesImporter.xcodeproj/tciuro.pbxuser: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | 08FB7793FE84155DC02AAC07 /* Project object */ = { 4 | activeBuildConfigurationName = Debug; 5 | activeExecutable = 74CACA5D12E3787100D98931 /* iTunesImporter */; 6 | activeTarget = 8DD76F960486AA7600D96B5E /* iTunesImporter */; 7 | addToTargets = ( 8 | 8DD76F960486AA7600D96B5E /* iTunesImporter */, 9 | ); 10 | breakpoints = ( 11 | 7401411312F7418300F204CF /* NSFNanoStore.m:621 */, 12 | ); 13 | codeSenseManager = 74CACA6512E3788F00D98931 /* Code sense */; 14 | executables = ( 15 | 74CACA5D12E3787100D98931 /* iTunesImporter */, 16 | ); 17 | perUserDictionary = { 18 | PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { 19 | PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; 20 | PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; 21 | PBXFileTableDataSourceColumnWidthsKey = ( 22 | 20, 23 | 827, 24 | 20, 25 | 48, 26 | 43, 27 | 43, 28 | 20, 29 | ); 30 | PBXFileTableDataSourceColumnsKey = ( 31 | PBXFileDataSource_FiletypeID, 32 | PBXFileDataSource_Filename_ColumnID, 33 | PBXFileDataSource_Built_ColumnID, 34 | PBXFileDataSource_ObjectSize_ColumnID, 35 | PBXFileDataSource_Errors_ColumnID, 36 | PBXFileDataSource_Warnings_ColumnID, 37 | PBXFileDataSource_Target_ColumnID, 38 | ); 39 | }; 40 | PBXPerProjectTemplateStateSaveDate = 319272806; 41 | PBXWorkspaceStateSaveDate = 319272806; 42 | }; 43 | perUserProjectItems = { 44 | 743486511307B7D600653409 /* PBXTextBookmark */ = 743486511307B7D600653409 /* PBXTextBookmark */; 45 | 7434866A1307B80600653409 /* PBXTextBookmark */ = 7434866A1307B80600653409 /* PBXTextBookmark */; 46 | 7434866B1307B80600653409 /* PBXTextBookmark */ = 7434866B1307B80600653409 /* PBXTextBookmark */; 47 | 74E5F9D112E7DE2600818795 /* PBXTextBookmark */ = 74E5F9D112E7DE2600818795 /* PBXTextBookmark */; 48 | 74FB595812E3C77C0070E4D0 /* PBXTextBookmark */ = 74FB595812E3C77C0070E4D0 /* PBXTextBookmark */; 49 | 74FB595912E3C77C0070E4D0 /* PBXTextBookmark */ = 74FB595912E3C77C0070E4D0 /* PBXTextBookmark */; 50 | }; 51 | sourceControlManager = 74CACA6412E3788F00D98931 /* Source Control */; 52 | userBuildSettings = { 53 | }; 54 | }; 55 | 08FB7796FE84155DC02AAC07 /* iTunesImporter.m */ = { 56 | uiCtxt = { 57 | sepNavIntBoundsRect = "{{0, 0}, {754, 1372}}"; 58 | sepNavSelRange = "{1490, 0}"; 59 | sepNavVisRange = "{1158, 1197}"; 60 | }; 61 | }; 62 | 7401411312F7418300F204CF /* NSFNanoStore.m:621 */ = { 63 | isa = PBXFileBreakpoint; 64 | actions = ( 65 | ); 66 | breakpointStyle = 0; 67 | continueAfterActions = 0; 68 | countType = 0; 69 | delayBeforeContinue = 0; 70 | fileReference = 74FB58F312E3C1B60070E4D0 /* NSFNanoStore.m */; 71 | functionName = "-_initializePreparedStatements"; 72 | hitCount = 1; 73 | ignoreCount = 0; 74 | lineNumber = 621; 75 | location = iTunesImporter; 76 | modificationTime = 318194059.266837; 77 | originalNumberOfMultipleMatches = 1; 78 | state = 1; 79 | }; 80 | 743486511307B7D600653409 /* PBXTextBookmark */ = { 81 | isa = PBXTextBookmark; 82 | fRef = 74FB58F312E3C1B60070E4D0 /* NSFNanoStore.m */; 83 | name = "NSFNanoStore.m: 32"; 84 | rLen = 29; 85 | rLoc = 1731; 86 | rType = 0; 87 | vrLen = 2334; 88 | vrLoc = 919; 89 | }; 90 | 7434866A1307B80600653409 /* PBXTextBookmark */ = { 91 | isa = PBXTextBookmark; 92 | fRef = 08FB7796FE84155DC02AAC07 /* iTunesImporter.m */; 93 | name = "iTunesImporter.m: 46"; 94 | rLen = 0; 95 | rLoc = 1490; 96 | rType = 0; 97 | vrLen = 1197; 98 | vrLoc = 1158; 99 | }; 100 | 7434866B1307B80600653409 /* PBXTextBookmark */ = { 101 | isa = PBXTextBookmark; 102 | fRef = 08FB7796FE84155DC02AAC07 /* iTunesImporter.m */; 103 | name = "iTunesImporter.m: 46"; 104 | rLen = 0; 105 | rLoc = 1490; 106 | rType = 0; 107 | vrLen = 2050; 108 | vrLoc = 1107; 109 | }; 110 | 74CACA5D12E3787100D98931 /* iTunesImporter */ = { 111 | isa = PBXExecutable; 112 | activeArgIndices = ( 113 | ); 114 | argumentStrings = ( 115 | ); 116 | autoAttachOnCrash = 1; 117 | breakpointsEnabled = 0; 118 | configStateDict = { 119 | }; 120 | customDataFormattersEnabled = 1; 121 | dataTipCustomDataFormattersEnabled = 1; 122 | dataTipShowTypeColumn = 1; 123 | dataTipSortType = 0; 124 | debuggerPlugin = GDBDebugging; 125 | disassemblyDisplayState = 0; 126 | dylibVariantSuffix = ""; 127 | enableDebugStr = 1; 128 | environmentEntries = ( 129 | ); 130 | executableSystemSymbolLevel = 0; 131 | executableUserSymbolLevel = 0; 132 | libgmallocEnabled = 0; 133 | name = iTunesImporter; 134 | savedGlobals = { 135 | }; 136 | showTypeColumn = 0; 137 | sourceDirectories = ( 138 | ); 139 | variableFormatDictionary = { 140 | }; 141 | }; 142 | 74CACA6412E3788F00D98931 /* Source Control */ = { 143 | isa = PBXSourceControlManager; 144 | fallbackIsa = XCSourceControlManager; 145 | isSCMEnabled = 0; 146 | scmConfiguration = { 147 | repositoryNamesForRoots = { 148 | "" = ""; 149 | }; 150 | }; 151 | }; 152 | 74CACA6512E3788F00D98931 /* Code sense */ = { 153 | isa = PBXCodeSenseManager; 154 | indexTemplatePath = ""; 155 | }; 156 | 74E5F9D112E7DE2600818795 /* PBXTextBookmark */ = { 157 | isa = PBXTextBookmark; 158 | fRef = 74FB58E912E3C1B60070E4D0 /* NSFNanoGlobals.h */; 159 | name = "NSFNanoGlobals.h: 91"; 160 | rLen = 27; 161 | rLoc = 5046; 162 | rType = 0; 163 | vrLen = 2183; 164 | vrLoc = 3878; 165 | }; 166 | 74FB58D512E3C1B60070E4D0 /* NSFNanoEngine.m */ = { 167 | uiCtxt = { 168 | sepNavIntBoundsRect = "{{0, 0}, {810, 25984}}"; 169 | sepNavSelRange = "{7787, 0}"; 170 | sepNavVisRange = "{7627, 557}"; 171 | }; 172 | }; 173 | 74FB58DD12E3C1B60070E4D0 /* NSFNanoGlobals_Private.h */ = { 174 | uiCtxt = { 175 | sepNavIntBoundsRect = "{{0, 0}, {1017, 1330}}"; 176 | sepNavSelRange = "{2141, 7}"; 177 | sepNavVisRange = "{1697, 1345}"; 178 | }; 179 | }; 180 | 74FB58E912E3C1B60070E4D0 /* NSFNanoGlobals.h */ = { 181 | uiCtxt = { 182 | sepNavIntBoundsRect = "{{0, 0}, {1258, 4438}}"; 183 | sepNavSelRange = "{5046, 27}"; 184 | sepNavVisRange = "{3878, 2183}"; 185 | }; 186 | }; 187 | 74FB58EA12E3C1B60070E4D0 /* NSFNanoGlobals.m */ = { 188 | uiCtxt = { 189 | sepNavIntBoundsRect = "{{0, 0}, {1017, 1918}}"; 190 | sepNavSelRange = "{1680, 15}"; 191 | sepNavVisRange = "{46, 2233}"; 192 | }; 193 | }; 194 | 74FB58EC12E3C1B60070E4D0 /* NSFNanoObject.m */ = { 195 | uiCtxt = { 196 | sepNavIntBoundsRect = "{{0, 0}, {1237, 2492}}"; 197 | sepNavSelRange = "{4768, 0}"; 198 | sepNavVisRange = "{1672, 910}"; 199 | }; 200 | }; 201 | 74FB58F012E3C1B60070E4D0 /* NSFNanoSearch.h */ = { 202 | uiCtxt = { 203 | sepNavIntBoundsRect = "{{0, 0}, {1867, 4802}}"; 204 | sepNavSelRange = "{4750, 0}"; 205 | sepNavVisRange = "{4238, 1584}"; 206 | }; 207 | }; 208 | 74FB58F112E3C1B60070E4D0 /* NSFNanoSearch.m */ = { 209 | uiCtxt = { 210 | sepNavIntBoundsRect = "{{0, 0}, {1440, 12936}}"; 211 | sepNavSelRange = "{5473, 112}"; 212 | sepNavVisRange = "{4349, 1601}"; 213 | }; 214 | }; 215 | 74FB58F212E3C1B60070E4D0 /* NSFNanoStore.h */ = { 216 | uiCtxt = { 217 | sepNavIntBoundsRect = "{{0, 0}, {1356, 6454}}"; 218 | sepNavSelRange = "{4655, 55}"; 219 | sepNavVisRange = "{3211, 2831}"; 220 | }; 221 | }; 222 | 74FB58F312E3C1B60070E4D0 /* NSFNanoStore.m */ = { 223 | uiCtxt = { 224 | sepNavIntBoundsRect = "{{0, 0}, {1017, 18536}}"; 225 | sepNavSelRange = "{1731, 29}"; 226 | sepNavVisRange = "{919, 2334}"; 227 | sepNavWindowFrame = "{{81, 0}, {1729, 1178}}"; 228 | }; 229 | }; 230 | 74FB595812E3C77C0070E4D0 /* PBXTextBookmark */ = { 231 | isa = PBXTextBookmark; 232 | fRef = 74FB58DD12E3C1B60070E4D0 /* NSFNanoGlobals_Private.h */; 233 | name = "NSFNanoGlobals_Private.h: 56"; 234 | rLen = 7; 235 | rLoc = 2141; 236 | rType = 0; 237 | vrLen = 1345; 238 | vrLoc = 1697; 239 | }; 240 | 74FB595912E3C77C0070E4D0 /* PBXTextBookmark */ = { 241 | isa = PBXTextBookmark; 242 | fRef = 74FB58EA12E3C1B60070E4D0 /* NSFNanoGlobals.m */; 243 | name = "NSFNanoGlobals.m: 31"; 244 | rLen = 15; 245 | rLoc = 1680; 246 | rType = 0; 247 | vrLen = 2233; 248 | vrLoc = 46; 249 | }; 250 | 8DD76F960486AA7600D96B5E /* iTunesImporter */ = { 251 | activeExec = 0; 252 | executables = ( 253 | 74CACA5D12E3787100D98931 /* iTunesImporter */, 254 | ); 255 | }; 256 | } 257 | --------------------------------------------------------------------------------