home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / dbkit / DBValue.h < prev    next >
Text File  |  1992-03-27  |  1KB  |  72 lines

  1. /*
  2. **      DBValue.h
  3. **      Database Kit, Release 3.0
  4. **      Copyright (c) 1992, NeXT Computer, Inc.  All $    Sts 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. }
  41.  
  42. + initialize;
  43.  
  44. - init;
  45. - free;
  46. - (id<DBTypes>)valueType;
  47.  
  48. - setNull;
  49. - (BOOL)isNull;
  50. - (BOOL)isEqual:(DBValue*)aValue;
  51.  
  52. - objectValue;
  53. - (int)intValue;
  54. - (float)floatValue;
  55. - (double)doubleValue;
  56. - (const char*)stringValue;
  57.  
  58. - setObjectValue:(id)anObject;
  59. - setIntValue:(int)anInt;
  60. - setFloatValue:(float)aFloat;
  61. - setDoubleValue:(double)aDouble;
  62. - setStringValue:(const char*)aString;
  63.  
  64. - setObjectValueNoCopy:(id)anObject;
  65. - setStringValueNoCopy:(const char*)aString;
  66. - setValueFrom:(DBValue*)aValue;
  67.  
  68. - read:(NXTypedStream*)s;
  69. - write:(NXTypedStream*)s;
  70.  
  71. @end
  72.