Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

FBwBlobField.h

00001 
00005 //---------------------------------------------------------------------------
00006 
00007 #ifndef FBwBlobFieldH
00008 #define FBwBlobFieldH
00009 #include <ibase.h>
00010 #include <string>
00011 #include <FBwError.h>
00012 #include <FBwConect.h>
00013 #include <FBwDPB.h>
00014 #include <FBwTransac.h>
00015 #include <FBwBlob.h>
00016 
00017 //---------------------------------------------------------------------------
00018 
00020 namespace fbwrap
00021 {
00022 
00023 // What are we using from standard libraries
00024 using std::string;
00025 
00026 // Avoid Circular dependencies
00027 class FBwDb;
00028 
00030 class FBwBlobField : public FBwField
00031 {
00032     ISC_QUAD blob_id;
00033     string value;   // This is a text blob so we can put it on a string
00034 protected:
00035     FBwBlob blb;
00036     virtual void bCopy(const FBwField *fld)
00037     {
00038         value=fld->AsString();
00039     }
00040     virtual void *GetPtr()
00041     {
00042         return (void *)&blob_id;
00043     }
00044 
00045 public:
00047     FBwBlobField(string pName,FBwDb *pdb)
00048         : FBwField(pName,masf_blob),blb(pdb)
00049     {
00050         value = "";
00051     }
00053     FBwBlobField(string pName,FBwDb *pdb,string Tabla)
00054         : FBwField(pName,masf_blob),blb(pdb,Tabla,pName)
00055     {
00056         value = "";
00057     }
00059     FBwBlobField(const FBwBlobField &f);
00060     virtual void ConvertStoV();
00061     virtual void ConvertVtoS();
00062     virtual void BindPtr(char  **p)
00063     {
00064         *p =(char *)&blob_id;
00065     }
00067     virtual string AsString() const;
00069     virtual void SetAsString(const string &pvalue) 
00070     {
00071         ClearNull();
00072         value = pvalue;
00073     }
00074     FBwField *Clone() const
00075     {
00076         return new FBwBlobField(*this);
00077     }
00078     virtual ~FBwBlobField()
00079     {
00080     }
00081     virtual int ByteSize() const
00082     {
00083         return sizeof(blob_id);
00084     }
00085 };
00086 
00087 //-------------------------------------------------------------------------
00088 }
00089 #endif

Generated on Fri Jan 31 08:30:01 2003 for fbwrap by doxygen1.2.17