home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / Vcl / ibblob.hpp < prev    next >
C/C++ Source or Header  |  2000-02-01  |  5KB  |  116 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1999 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'IBBlob.pas' rev: 5.00
  6.  
  7. #ifndef IBBlobHPP
  8. #define IBBlobHPP
  9.  
  10. #pragma delphiheader begin
  11. #pragma option push -w-
  12. #pragma option push -Vx
  13. #include <IBUtils.hpp>    // Pascal unit
  14. #include <IBDatabase.hpp>    // Pascal unit
  15. #include <IB.hpp>    // Pascal unit
  16. #include <Db.hpp>    // Pascal unit
  17. #include <IBExternals.hpp>    // Pascal unit
  18. #include <IBErrorCodes.hpp>    // Pascal unit
  19. #include <IBHeader.hpp>    // Pascal unit
  20. #include <Forms.hpp>    // Pascal unit
  21. #include <Classes.hpp>    // Pascal unit
  22. #include <SysUtils.hpp>    // Pascal unit
  23. #include <Windows.hpp>    // Pascal unit
  24. #include <SysInit.hpp>    // Pascal unit
  25. #include <System.hpp>    // Pascal unit
  26.  
  27. //-- user supplied -----------------------------------------------------------
  28.  
  29. namespace Ibblob
  30. {
  31. //-- type declarations -------------------------------------------------------
  32. class DELPHICLASS TIBBlobStream;
  33. class PASCALIMPLEMENTATION TIBBlobStream : public Classes::TStream 
  34. {
  35.     typedef Classes::TStream inherited;
  36.     
  37. private:
  38.     Ibdatabase::TIBBase* FBase;
  39.     Ibheader::TGDS_QUAD FBlobID;
  40.     int FBlobMaxSegmentSize;
  41.     int FBlobNumSegments;
  42.     int FBlobSize;
  43.     short FBlobType;
  44.     char *FBuffer;
  45.     bool FBlobInitialized;
  46.     void * *FHandle;
  47.     Db::TBlobStreamMode FMode;
  48.     bool FModified;
  49.     int FPosition;
  50.     
  51. protected:
  52.     void __fastcall CloseBlob(void);
  53.     void __fastcall CreateBlob(void);
  54.     void __fastcall EnsureBlobInitialized(void);
  55.     void __fastcall GetBlobInfo(void);
  56.     Ibdatabase::TIBDatabase* __fastcall GetDatabase(void);
  57.     Ibheader::PISC_DB_HANDLE __fastcall GetDBHandle(void);
  58.     Ibdatabase::TIBTransaction* __fastcall GetTransaction(void);
  59.     Ibheader::PISC_TR_HANDLE __fastcall GetTRHandle(void);
  60.     void __fastcall OpenBlob(void);
  61.     void __fastcall SetBlobID(const Ibheader::TGDS_QUAD &Value);
  62.     void __fastcall SetDatabase(Ibdatabase::TIBDatabase* Value);
  63.     void __fastcall SetMode(Db::TBlobStreamMode Value);
  64.     void __fastcall SetTransaction(Ibdatabase::TIBTransaction* Value);
  65.     
  66. public:
  67.     __fastcall TIBBlobStream(void);
  68.     __fastcall virtual ~TIBBlobStream(void);
  69.     int __fastcall Call(int ErrCode, bool RaiseError);
  70.     void __fastcall CheckReadable(void);
  71.     void __fastcall CheckWritable(void);
  72.     void __fastcall Finalize(void);
  73.     void __fastcall LoadFromFile(AnsiString Filename);
  74.     void __fastcall LoadFromStream(Classes::TStream* Stream);
  75.     virtual int __fastcall Read(void *Buffer, int Count);
  76.     void __fastcall SaveToFile(AnsiString Filename);
  77.     void __fastcall SaveToStream(Classes::TStream* Stream);
  78.     virtual int __fastcall Seek(int Offset, Word Origin);
  79.     virtual void __fastcall SetSize(int NewSize);
  80.     void __fastcall Truncate(void);
  81.     virtual int __fastcall Write(const void *Buffer, int Count);
  82.     __property Ibexternals::PVoid Handle = {read=FHandle};
  83.     __property Ibheader::TGDS_QUAD BlobID = {read=FBlobID, write=SetBlobID};
  84.     __property int BlobMaxSegmentSize = {read=FBlobMaxSegmentSize, nodefault};
  85.     __property int BlobNumSegments = {read=FBlobNumSegments, nodefault};
  86.     __property int BlobSize = {read=FBlobSize, nodefault};
  87.     __property short BlobType = {read=FBlobType, nodefault};
  88.     __property Ibdatabase::TIBDatabase* Database = {read=GetDatabase, write=SetDatabase};
  89.     __property Ibheader::PISC_DB_HANDLE DBHandle = {read=GetDBHandle};
  90.     __property Db::TBlobStreamMode Mode = {read=FMode, write=SetMode, nodefault};
  91.     __property bool Modified = {read=FModified, nodefault};
  92.     __property Ibdatabase::TIBTransaction* Transaction = {read=GetTransaction, write=SetTransaction};
  93.     __property Ibheader::PISC_TR_HANDLE TRHandle = {read=GetTRHandle};
  94. };
  95.  
  96.  
  97. //-- var, const, procedure ---------------------------------------------------
  98. static const Word DefaultBlobSegmentSize = 0x4000;
  99. extern PACKAGE void __fastcall GetBlobInfo(Ibheader::PISC_BLOB_HANDLE hBlobHandle, int &NumSegments, 
  100.     int &MaxSegmentSize, int &TotalSize, short &BlobType);
  101. extern PACKAGE void __fastcall ReadBlob(Ibheader::PISC_BLOB_HANDLE hBlobHandle, char * Buffer, int BlobSize
  102.     );
  103. extern PACKAGE void __fastcall WriteBlob(Ibheader::PISC_BLOB_HANDLE hBlobHandle, char * Buffer, int 
  104.     BlobSize);
  105.  
  106. }    /* namespace Ibblob */
  107. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  108. using namespace Ibblob;
  109. #endif
  110. #pragma option pop    // -w-
  111. #pragma option pop    // -Vx
  112.  
  113. #pragma delphiheader end.
  114. //-- end unit ----------------------------------------------------------------
  115. #endif    // IBBlob
  116.