Permalink
Browse files

Initial NanoStore 2.0 release

  • Loading branch information...
0 parents commit 0a58f266511de6862f96034336df821c36658235 @tciuro committed May 9, 2011
Showing with 44,938 additions and 0 deletions.
  1. +554 −0 Classes/Advanced/NSFNanoEngine.h
  2. +1,819 −0 Classes/Advanced/NSFNanoEngine.m
  3. +146 −0 Classes/Advanced/NSFNanoResult.h
  4. +259 −0 Classes/Advanced/NSFNanoResult.m
  5. +43 −0 Classes/Private/NSFNanoBag_Private.h
  6. +69 −0 Classes/Private/NSFNanoEngine_Private.h
  7. +35 −0 Classes/Private/NSFNanoExpression_Private.h
  8. +96 −0 Classes/Private/NSFNanoGlobals_Private.h
  9. +37 −0 Classes/Private/NSFNanoObject_Private.h
  10. +35 −0 Classes/Private/NSFNanoPredicate_Private.h
  11. +43 −0 Classes/Private/NSFNanoResult_Private.h
  12. +50 −0 Classes/Private/NSFNanoSearch_Private.h
  13. +59 −0 Classes/Private/NSFNanoStore_Private.h
  14. +37 −0 Classes/Private/NanoStore_Private.h
  15. +280 −0 Classes/Public/NSFNanoBag.h
  16. +438 −0 Classes/Public/NSFNanoBag.m
  17. +131 −0 Classes/Public/NSFNanoExpression.h
  18. +107 −0 Classes/Public/NSFNanoExpression.m
  19. +323 −0 Classes/Public/NSFNanoGlobals.h
  20. +127 −0 Classes/Public/NSFNanoGlobals.m
  21. +303 −0 Classes/Public/NSFNanoObject.h
  22. +191 −0 Classes/Public/NSFNanoObject.m
  23. +80 −0 Classes/Public/NSFNanoObjectProtocol.h
  24. +128 −0 Classes/Public/NSFNanoPredicate.h
  25. +137 −0 Classes/Public/NSFNanoPredicate.m
  26. +389 −0 Classes/Public/NSFNanoSearch.h
  27. +876 −0 Classes/Public/NSFNanoSearch.m
  28. +459 −0 Classes/Public/NSFNanoStore.h
  29. +1,331 −0 Classes/Public/NSFNanoStore.m
  30. +355 −0 Classes/Public/NanoStore.h
  31. +2 −0 English.lproj/InfoPlist.strings
  32. +18 −0 Examples/iPhoneTest/Classes/RootViewController.h
  33. +228 −0 Examples/iPhoneTest/Classes/RootViewController.m
  34. +21 −0 Examples/iPhoneTest/Classes/iPhoneTestAppDelegate.h
  35. +90 −0 Examples/iPhoneTest/Classes/iPhoneTestAppDelegate.m
  36. +542 −0 Examples/iPhoneTest/MainWindow.xib
  37. +384 −0 Examples/iPhoneTest/RootViewController.xib
  38. +30 −0 Examples/iPhoneTest/iPhoneTest-Info.plist
  39. +374 −0 Examples/iPhoneTest/iPhoneTest.xcodeproj/project.pbxproj
  40. +580 −0 Examples/iPhoneTest/iPhoneTest.xcodeproj/tciuro.pbxuser
  41. +1,520 −0 Examples/iPhoneTest/iPhoneTest.xcodeproj/tciuro.perspectivev3
  42. +14 −0 Examples/iPhoneTest/iPhoneTest_Prefix.pch
  43. +17 −0 Examples/iPhoneTest/main.m
  44. +79 −0 Examples/iTunesImporter/iTunesImporter.1
  45. +90 −0 Examples/iTunesImporter/iTunesImporter.m
  46. +343 −0 Examples/iTunesImporter/iTunesImporter.xcodeproj/project.pbxproj
  47. +7 −0 Examples/iTunesImporter/iTunesImporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  48. +2,141 −0 ...porter.xcodeproj/project.xcworkspace/xcuserdata/tciuro.xcuserdatad/UserInterfaceState.xcuserstate
  49. +256 −0 Examples/iTunesImporter/iTunesImporter.xcodeproj/tciuro.pbxuser
  50. +1,502 −0 Examples/iTunesImporter/iTunesImporter.xcodeproj/tciuro.perspectivev3
  51. +19 −0 ...Importer/iTunesImporter.xcodeproj/xcuserdata/tciuro.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  52. +76 −0 ...Importer/iTunesImporter.xcodeproj/xcuserdata/tciuro.xcuserdatad/xcschemes/iTunesImporter.xcscheme
  53. +22 −0 ...mporter/iTunesImporter.xcodeproj/xcuserdata/tciuro.xcuserdatad/xcschemes/xcschememanagement.plist
  54. +7 −0 Examples/iTunesImporter/iTunesImporter_Prefix.pch
  55. BIN Images/NanoStore_Logo.png
  56. +28 −0 Info.plist
  57. BIN LICENSE.pdf
  58. +694 −0 NanoStore.xcodeproj/project.pbxproj
  59. +7 −0 NanoStore.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  60. +14,748 −0 NanoStore.xcodeproj/project.xcworkspace/xcuserdata/tciuro.xcuserdatad/UserInterfaceState.xcuserstate
  61. +18 −0 NanoStore.xcodeproj/project.xcworkspace/xcuserdata/tciuro.xcuserdatad/WorkspaceSettings.xcsettings
  62. +6,157 −0 NanoStore.xcodeproj/project.xcworkspace/xcuserdata/tciuro.xcuserdatad/WorkspaceState.xcuserstate
  63. +1,047 −0 NanoStore.xcodeproj/tciuro.pbxuser
  64. +1,578 −0 NanoStore.xcodeproj/tciuro.perspectivev3
  65. +14 −0 NanoStore.xcodeproj/xcuserdata/tciuro.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  66. +55 −0 NanoStore.xcodeproj/xcuserdata/tciuro.xcuserdatad/xcschemes/NanoStore.xcscheme
  67. +68 −0 NanoStore.xcodeproj/xcuserdata/tciuro.xcuserdatad/xcschemes/UnitTests.xcscheme
  68. +32 −0 NanoStore.xcodeproj/xcuserdata/tciuro.xcuserdatad/xcschemes/xcschememanagement.plist
  69. +7 −0 NanoStore_Prefix.pch
  70. 0 README
  71. +21 −0 Read Me.txt
  72. +14 −0 Tests/EasyDebugging/NanoStore.m
  73. +18 −0 Tests/EasyDebugging/NanoStoreTester.h
  74. +101 −0 Tests/EasyDebugging/NanoStoreTester.m
  75. +40 −0 Tests/OCUnitExtensions/OCUnitExtensions.h
  76. +119 −0 Tests/OCUnitExtensions/OCUnitExtensions.m
  77. BIN Tests/Resources/Icon-Fail.tiff
  78. BIN Tests/Resources/Icon-Pass.tiff
  79. +16 −0 Tests/UnitTests/NanoStore/NanoEngineTests.h
  80. +52 −0 Tests/UnitTests/NanoStore/NanoEngineTests.m
  81. +16 −0 Tests/UnitTests/NanoStore/NanoStoreBagTests.h
  82. +719 −0 Tests/UnitTests/NanoStore/NanoStoreBagTests.m
  83. +16 −0 Tests/UnitTests/NanoStore/NanoStoreExpressionTests.h
  84. +253 −0 Tests/UnitTests/NanoStore/NanoStoreExpressionTests.m
  85. +16 −0 Tests/UnitTests/NanoStore/NanoStoreObjectTests.h
  86. +138 −0 Tests/UnitTests/NanoStore/NanoStoreObjectTests.m
  87. +16 −0 Tests/UnitTests/NanoStore/NanoStoreResultTests.h
  88. +50 −0 Tests/UnitTests/NanoStore/NanoStoreResultTests.m
  89. +16 −0 Tests/UnitTests/NanoStore/NanoStoreSearchTests.h
  90. +788 −0 Tests/UnitTests/NanoStore/NanoStoreSearchTests.m
  91. +16 −0 Tests/UnitTests/NanoStore/NanoStoreTests.h
  92. +739 −0 Tests/UnitTests/NanoStore/NanoStoreTests.m
  93. +22 −0 UnitTests-Info.plist

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,146 @@
+/*
+ NSFNanoResult.h
+ NanoStore
+
+ Copyright (c) 2010 Webbo, L.L.C. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted
+ provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions
+ and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
+ and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ */
+
+/*! @file NSFNanoResult.h
+ @brief A unit that describes the result of a search.
+ */
+
+/** @class NSFNanoResult
+ * A unit that describes the result of a search.
+ *
+ * @note
+ * 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
+ * associated values.
+ *
+ * @par
+ * After obtaining a NanoResult, it's always a good idea to check whether the <i>error</i> property is nil. If so, the result can be assumed to be
+ * correct. Otherwise, <i>error</i> will point to the main cause of failure.
+ *
+ * @details <b>Example:</b>
+ @code
+ // Instantiate a NanoStore and open it
+ NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil];
+
+ // Add some data to the document store
+ NSDictionary *info = ...;
+ NSFNanoBag *bag = [NSFNanoBag bag];
+ NSFNanoObject *obj1 = [NSFNanoObject nanoObjectWithDictionary:info];
+ NSFNanoObject *obj2 = [NSFNanoObject nanoObjectWithDictionary:info];
+ [nanoStore addObjectsFromArray:[NSArray arrayWithObjects:obj1, obj2, nil] error:nil];
+
+ // Instantiate a search and execute the SQL statement
+ NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore];
+ NSFNanoResult *result = [search executeSQL:@"SELECT COUNT(*) FROM NSFKEYS"];
+
+ // Obtain the result (given as an NSString)
+ NSString *value = [result firstValue];
+
+ // Close the document store
+ [nanoStore closeWithError:nil];
+ @endcode
+ */
+
+#import <Foundation/Foundation.h>
+
+@class NSFNanoStore;
+
+@interface NSFNanoResult : NSObject
+{
+ NSUInteger numberOfRows;
+ NSError *error;
+
+ @protected
+ /** \cond */
+ NSDictionary *results;
+ /** \endcond */
+}
+
+/** * Number of rows contained in the result set. */
+@property (assign, readonly) NSUInteger numberOfRows;
+/** * A reference to the error encountered while processing the request, otherwise nil if the request was successful. */
+@property (retain, readonly) NSError *error;
+
+/** @name Accessors
+ */
+
+//@{
+
+/** * Returns a new array containing the columns.
+ * @returns An array with the columns retrieved from the result set.
+ */
+
+- (NSArray *)columns;
+
+/** * Returns a new array containing the values for a given column.
+ * @param theIndex is the index of the value in the result set.
+ * @param theColumn is the name of the column in the result set.
+ * @returns An array with the values associated with a given column.
+ * @throws NSRangeException is thrown if the index is out of bounds.
+ */
+
+- (NSString *)valueAtIndex:(NSUInteger)theIndex forColumn:(NSString *)theColumn;
+
+/** * Returns a new array containing the values for a given column.
+ * @param theColumn is the name of the column in the result set.
+ * @returns An array with the values associated with a given column.
+ */
+
+- (NSArray *)valuesForColumn:(NSString *)theColumn;
+
+/** * Returns the first value.
+ * @returns The value of the first element from the result set.
+ */
+
+- (NSString *)firstValue;
+
+//@}
+
+/** @name Exporting the Results to a File
+ */
+
+//@{
+
+/** * Saves the result to a file.
+ * @param thePath is the location where the result will be saved to a file.
+ */
+
+- (void)writeToFile:(NSString *)thePath;
+
+//@}
+
+/** @name Miscellaneous
+ */
+
+//@{
+
+/** * Returns a string representation of the result.
+ */
+
+- (NSString *)description;
+
+//@}
+
+@end
Oops, something went wrong.

0 comments on commit 0a58f26

Please sign in to comment.