home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / dbkit / DBValue.h < prev    next >
Text File  |  1993-07-21  |  1KB  |  73 lines

  1. /*
  2. **      DBValue.h
  3. **      Database Kit, Release 3.0
  4. **      Copyright (c) 1992, NeXT Computer, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <dbkit/types.h>
  8. #import <dbkit/expressionValues.h>
  9. #import <objc/Object.h>
  10. #import <ansi/math.h>
  11.  
  12. /*
  13. ** Reserved null value for int -- this is intentionally different than the
  14. **  MININT found in math.h, to avoid conflict with existing flagged values.
  15. */
  16. #define DB_NullInt ((int)0x7ffffffe)
  17. #define DB_NullFloat (NAN)
  18. #define DB_NullDouble (NAN)
  19.  
  20. @class DBDatabase;
  21. @class DBValue;
  22. @class NXData;
  23. @class List;
  24.  
  25. /*
  26. ** This class implements a handle onto arbitrary objective-C values.
  27. */
  28. @interface DBValue : Object <DBExpressionValues>
  29. {
  30. @private
  31.   id _type;
  32.   union _valBuf {
  33.     id o;
  34.     int i;
  35.     float f;
  36.     double d;
  37.     char *s;
  38.   } _value;
  39.   char *_stringbuf;
  40.   BOOL isNull;
  41. }
  42.  
  43. + initialize;
  44.  
  45. - init;
  46. - free;
  47. - (id<DBTypes>)valueType;
  48.  
  49. - setNull;
  50. - (BOOL)isNull;
  51. - (BOOL)isEqual:(DBValue*)aValue;
  52.  
  53. - objectValue;
  54. - (int)intValue;
  55. - (float)floatValue;
  56. - (double)doubleValue;
  57. - (const char*)stringValue;
  58.  
  59. - setObjectValue:(id)anObject;
  60. - setIntValue:(int)anInt;
  61. - setFloatValue:(float)aFloat;
  62. - setDoubleValue:(double)aDouble;
  63. - setStringValue:(const char*)aString;
  64.  
  65. - setObjectValueNoCopy:(id)anObject;
  66. - setStringValueNoCopy:(const char*)aString;
  67. - setValueFrom:(DBValue*)aValue;
  68.  
  69. - read:(NXTypedStream*)s;
  70. - write:(NXTypedStream*)s;
  71.  
  72. @end
  73.