home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dbutil.zip / BUFOP.ZIP / CSQLTYPE.HPP < prev    next >
Text File  |  1993-09-01  |  2KB  |  57 lines

  1. #include <IString.hpp>
  2. #include <IDate.hpp>
  3. #include <ITime.hpp>
  4.  
  5. /*******************************************************************
  6. *   C S Q L T Y P E s
  7. *  Types needed in support of IBM CPP & tools
  8. *
  9. *  Support for IDATE, ITIME & ISTRING is provided by
  10. *  inheriting the above types and providing a function
  11. *  to transform the data type into one of the tools types
  12. *
  13. *  ALSO - CLASS vchar is provided for variable char with 2-byte length
  14. *
  15. *********************************************************************
  16.  
  17. class vchar             // var length char with 2byte length
  18.                         // N O T E This call is not intened to be very robust
  19.                         // IT IS ONLY INTENDED TO GET DATA INTO AND OUT OF
  20.                         // THE DATABASE AND SERVER AS A BASIS FOR
  21.                         // NSTRING AND ZSTRING
  22. {
  23.  
  24.   int len;              // amount allocated
  25.   char * theStr;        // the pointer to the allocated string
  26.  public:
  27.   vchar();              // default constructor
  28.   vchar(int len);       // construct & allocate
  29.   ~vchar();             // destructor;
  30.  
  31. void setLen(int len);      // allocate new
  32. void setV(short sqldaID, short index);
  33. }
  34.  
  35. class ZString : public IString, public vchar
  36. {
  37. public:
  38.   void setData();       // moves data from vchar to IString after read
  39.   void setV(short sqldaID, short index, Boolean input);  // redefine of setv
  40. }
  41.  
  42. class dIDate : public IDate
  43. {
  44.  char theDate[11];
  45.  public: 
  46.   setDate();
  47.   setV(short sqlaID short index, Boolean input, Boolean withNull);
  48. }
  49.  
  50. class dITime : public ITime
  51.  { char theTime[15];
  52.  public:
  53.   setDate();
  54.   setV(short sqlaID short index, Boolean input, Boolean withNull);
  55. }
  56.  
  57.