Author: rfm
Date: Wed Apr 27 09:55:26 2016
New Revision: 39698

URL: http://svn.gna.org/viewcvs/gnustep?rev=39698&view=rev
Log:
Add -isNull

Modified:
    libs/sqlclient/trunk/ChangeLog
    libs/sqlclient/trunk/SQLClient.h
    libs/sqlclient/trunk/SQLClient.m

Modified: libs/sqlclient/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/ChangeLog?rev=39698&r1=39697&r2=39698&view=diff
==============================================================================
--- libs/sqlclient/trunk/ChangeLog      (original)
+++ libs/sqlclient/trunk/ChangeLog      Wed Apr 27 09:55:26 2016
@@ -1,3 +1,10 @@
+2016-04-27 Richard Frith-Macdonald  <[email protected]>
+
+       * SQLClient.h:
+       * SQLClient.m:
+       Add -isNull helper method for testing for null fields in records
+       returned from the database.
+
 2016-02-18 Richard Frith-Macdonald  <[email protected]>
 
        * configure.ac: get host and cpu with more recent gnustep-make

Modified: libs/sqlclient/trunk/SQLClient.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/SQLClient.h?rev=39698&r1=39697&r2=39698&view=diff
==============================================================================
--- libs/sqlclient/trunk/SQLClient.h    (original)
+++ libs/sqlclient/trunk/SQLClient.h    Wed Apr 27 09:55:26 2016
@@ -208,6 +208,17 @@
 #define SQLCLIENT_PRIVATE       @private
 #endif
 
+/** This category is to extend NSObject with SQL oriented helper methods.
+ */
+@interface      NSObject(SQLClient)
+
+/** Trivial method to test a field in a record returned from the database
+ * to see if it is a NULL.  This is equivalent to<br />
+ * (receiver == [NSNull null] ? YES : NO)<br />
+ */
+- (BOOL) isNull;
+@end
+
 /** This class is used to hold key information for a set of SQLRecord
  * objects produced by a single query.
  */

Modified: libs/sqlclient/trunk/SQLClient.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/SQLClient.m?rev=39698&r1=39697&r2=39698&view=diff
==============================================================================
--- libs/sqlclient/trunk/SQLClient.m    (original)
+++ libs/sqlclient/trunk/SQLClient.m    Wed Apr 27 09:55:26 2016
@@ -217,7 +217,7 @@
 + (void) initialize
 {
   GSTickerTimeNow();
-  if (null == nil)
+  if (nil == null)
     {
       null = [NSNull new];
       aClass = [NSMutableArray class];
@@ -917,6 +917,10 @@
     {
       static id        modes[1];
       
+      if (nil == null)
+        {
+          null = [NSNull new];
+        }
       SQLClientClass = self;
       modes[0] = NSDefaultRunLoopMode;
       queryModes = [[NSArray alloc] initWithObjects: modes count: 1];
@@ -4125,3 +4129,14 @@
 
 @end
 
+@implementation NSObject (SQLClient)
+- (BOOL) isNull
+{
+  if (nil == null)
+    {
+      null = [NSNull new];
+    }
+  return (self == null ? YES : NO);
+}
+@end
+


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to