Index

DKBlobDES

Purpose:

This class defines a binary large object (BLOB) for Extended Search (DES).

Class summary:

class DKBlobDES : public dkBlob  
{
public:
 
   DKBlobDES(DKDatastoreDES* pdsDES);
   DKBlobDES(DKDatastoreDES* pdsDES, const DKString& data);
   DKBlobDES (const DKBlobDES& blob);
 
   virtual ~DKBlobDES ();
 
   virtual DKString  getObjectType () const;
   virtual void       setNull ();
   virtual DKBoolean  isNull () const;
   virtual dkXDOBase&  operator= (const dkXDOBase& xdo);
   virtual DKBoolean   operator== (const dkXDOBase& xdo) const;
   virtual DKBoolean   operator!= (const dkXDOBase& xdo) const;
   virtual void  deletingValue ();
   virtual void  open ();
   virtual void  setPidObject (const DKPidXDO* pid);
   virtual const DKPidXDO*  getPidObject ();
   virtual dkXDO&  add ();
   virtual dkXDO&  retrieve ();
   virtual dkXDO&  update ();
   virtual dkXDO&  del ();
   virtual dkXDO&     copyData (const dkXDO& xdo);
   virtual DKBoolean  compareData (const dkXDO& xdo);
   virtual DKBoolean  isContentChanged () const;
   virtual DKBoolean  isSet () const;
   virtual dkXDO& cloneSkeleton ();
   virtual DKString  getContent () const;
   virtual dkXDO&    setContent (const DKString& data);
   virtual dkBlob&   getContentToClientFile (const char* fName,
                                             int fOpt) const;
   virtual dkBlob&  setContentFromClientFile (const char* fName);
   virtual dkBlob&  operator += (const dkBlob& blob);
   virtual dkBlob&  operator += (const DKString& data);
   virtual long  length () const;
   virtual long  indexOf (const DKString& data,
                          long startPos = 1) const;
   virtual long  indexOf (const dkBlob& blob,
                          long startPos = 1) const;
   virtual DKString  subString (long startPos,
                                   long len) const;
   virtual dkBlob&  remove (long startPos,
                               long len);
   virtual dkBlob&  insert (const DKString& data,
                               long startPos);
   virtual dkBlob&  insert (const dkBlob& blob,
                            long  startPos);
   virtual void  open (const char*  fName);
   virtual void  setClassOpenHandler (const char* hOpen,
                                      DKBoolean sysFlag);
   virtual void  setInstanceOpenHandler (const char* hOpen,
                                            DKBoolean sysFlag);
   virtual DKString   getOpenHandler ();
   virtual DKBoolean  isOpenSynchronous ();
   virtual dkBlob&  add (const char* fName);
   virtual dkBlob&  retrieve (const char* fName);
   virtual dkBlob&  update (const char* fName);
   virtual dkBlob&  del (DKBoolean flush);
   virtual DKString getMimeType();    
   virtual void setMimeType(const char* mimeType);
   DKString       getItemId () const;
   void           setItemId (const char* itemId);
   DKString          getDatabaseName() const;
   void              setDatabaseName(const char* pszDBName );
   DKString          getDocId() const;
   void              setDocId(const char* pszDocId );
   DKString		  getFieldName() const;
   void			  setFieldName(const char* fieldName);
   virtual DKBlobDES&  operator= (const DKBlobDES& aDKBlobDES);
   virtual DKBlobDES&  operator+ (const DKBlobDES& blob) const;
   virtual DKBlobDES&  operator+ (const DKString& data) const;
   friend  DKBlobDES&  operator+ (const DKString& data, const DKBlobDES& blob);
   virtual DKBlobDES&  subLob (long startPos,
                               long len) const;
   long  getRank ();
   void  setRank (long r);
   void  addExtension (const DKString& name,
                       const dkExtension* object);
   void  removeExtension (const DKString& name);
   void  setExtension (const DKString& name,
						const dkExtension* object);
   const dkExtension*  getExtension (const DKString& name);
};

Members:

Constructors and destructor
   DKBlobDES(DKDatastoreDES* pdsDES);
   DKBlobDES(DKDatastoreDES* pdsDES, const DKString& data);
   DKBlobDES (const DKBlobDES& blob);
   virtual ~DKBlobDES ();
 

Member functions

getObjectType
Gets the object type.
   virtual DKString  getObjectType () const;
 

setNull
Sets the part content to null (in memory).
    virtual void setNull ();
 

isNull
Checks to see if the part content is null (in memory).
   virtual DKBoolean isNull () const;
 

operator=
Assignment operator.
    virtual dkXDOBase&  operator= (const dkXDOBase& xdo);
 

operator==
Returns true if both objects are equal. (Does not compare all the bytes in the data, but instead, compares pointers to data. Use the compareData() function to compare all the bytes in the data.)
    virtual DKBoolean   operator== (const dkXDOBase& xdo) const;
 

operator!=
Returns true if both objects are not equal.
    virtual DKBoolean   operator!= (const dkXDOBase& xdo) const;
 

deletingValue
deletingValue has been deprecated.
    virtual void  deletingValue ();
 

open
Unloads the object content to a client file with a system generated name, then synchronously invokes a default handler against the file.
    virtual void  open ();
 

setPidObject
Sets the persistent identifier (PID) information of this object with the new provided PID.

Parameters
pid -- A DKPidXDO object.

    virtual void  setPidObject (const DKPidXDO* pid);
 

getPidObject
Gets a copy of the persistent ID object of this object.
    virtual const DKPidXDO*  getPidObject ();
 

add
Adds the object content from memory to the datastore.
    virtual dkXDO&  add ();
 

retrieve
Retrieves the object content from the datastore to the memory buffer.
    virtual dkXDO&  retrieve ();
 

update
Updates the object content in the datastore with the content in memory.
    virtual dkXDO&  update ();
 

del
Deletes the object content from the datastore.
    virtual dkXDO&  del ();
 

copyData
Replaces the content of this object with the content of the other extended data object (XDO).

Parameters
xdo -- The other extended data object (XDO).

    virtual dkXDO& copyData (const dkXDO& xdo);
 

compareData
Compares the content of this object with the content of the other extended data object (XDO).

Parameters
xdo -- The other extended data object (XDO) object.

    virtual DKBoolean  compareData (const dkXDO& xdo);
 

isContentChanged
Checks to see if the part content has changed (in memory).
    virtual DKBoolean  isContentChanged () const;
 

isSet
Checks if the part content is set (in memory).
    virtual DKBoolean  isSet () const;
 

cloneSkeleton
Creates a clone of this extended data object (XDO) with its persistent ID only (with its data content set to empty).
    virtual dkXDO& cloneSkeleton ();
 

getContent
Gets the content of this object.
    virtual DKString  getContent () const;
 

setContent
Sets the content of this object with a byte-array-stream argument.

Parameters
data -- A byte array.

    virtual dkXDO& setContent (const DKString& data);
 

getContentToClientFile
Copies the large object (lob) data of this object to the given file.

Parameters

fName
A fully qualified path with a file name. The default is the current directory (if no path is specified).

fOpt
A 1 will create or overwrite an existing file; a 2 will not only create a file, but will also throw an exception if the file already exists; a 3 appends to an existing file.

    virtual dkBlob&   getContentToClientFile (const char* fName, 
                                              int fOpt) const;
 

setContentFromClientFile
Replaces the large object (lob) data of this object with the contents of the file.

Parameters

fName
A fully qualified path with a file name. The default is the current directory (if no path is specified).

    virtual dkBlob&  setContentFromClientFile (const char* fName);
 

operator +=
Concatenates this object with another DKBlobDES object. The resulting object replaces the existing contents of this object.
    virtual dkBlob&  operator += (const dkBlob& blob);
 

operator +=
Concatenates this object with another string. The resulting object replaces the existing contents of this object.
    virtual dkBlob&  operator += (const DKString& data);
 

length
Gets the length of this object content from memory.
    virtual long  length () const;
 

indexOf
Gets the byte offset of the first occurrence of the search argument within this object (starting the search at offset startPos).
    virtual long  indexOf (const DKString& data, 
                           long startPos = 1) const;
    virtual long  indexOf (const dkBlob& blob, 
                           long startPos = 1) const;
 

subString
Gets a string object containing a substring of the large object (lob) of this object.
    virtual DKString  subString (long startPos,
                              long len) const;
 

remove
Deletes the portion of the large object (lob) data of this object (starting at startPos for len bytes).
    virtual dkBlob&  remove (long startPos, long len);
 

insert
Inserts the argument data, starting at position startPos in the large object (lob) data of this object.
    virtual dkBlob&  insert (const DKString& data, 
                                     long startPos); 
    virtual dkBlob&  insert (const dkBlob& blob, 
                                     long  startPos);
 

open
Unloads the object content to a file (fName) provided by the application, then synchronously invokes a default handler against the file.

Parameters
fName -- A provided file name.

    virtual void  open (const char*  fName);
 

setClassOpenHandler
Sets the executable handler program name and indicates whether this handler should be invoked synchronously or asynchronously for this object class.

Parameters

ahandler
The handler program name to view the content.

newSynchronousFlag
true for a synchronous process.

    virtual void  setClassOpenHandler (const char* hOpen, 
                                       DKBoolean sysFlag);
 

setInstanceOpenHandler
Sets the executable handler program name and indicates whether this handler should be invoked synchronously or asynchronously for this object instant.

Parameters

ahandler
The handler program name to view the content.

newSynchronousFlag
true for the synchronous process.
    virtual void  setInstanceOpenHandler (const char* hOpen, DKBoolean sysFlag);
 

getOpenHandler
Gets the current program name of the handler for this object instance.
    virtual DKString getOpenHandler ();
 

isOpenSynchronous
Gets the current synchronization property (true or false).
    virtual DKBoolean  isOpenSynchronous ();
 

add
Adds the object content from an existing file to the datastore.

Parameters

fName
A fully qualified path and file name. The default is the current directory.
    virtual dkBlob&  add (const char* fName);
 

retrieve
Retrieves the object content from the datastore to a file name.

Parameters

fName
A fully qualified path and file name. The default is the current directory.
    virtual dkBlob&  retrieve (const char* fName);
 

update
Updates the object content in datastore with a file.

Parameters

fName
A fully qualified path and file name. The default is the current directory.
    virtual dkBlob&  update (const char* fName);
 

del
Deletes the object content from the datastore.

Parameters

flush
If true, the memory content will be flush. If false and the content is not set, the object will be retrieved before deleting it. The default is flush.
    virtual dkBlob&  del (DKBoolean flush);
 

getMimeType
Gets the MIME type (for example, text or html).
    virtual DKString getMimeType();    
 

setMimeType
Sets the MIME type (for example, text or html).
    virtual void setMimeType(const char* mimeType);    
 

getItemId
Gets the Extended Search (DES) item ID of the object content.
    DKString getItemId () const;
 

setItemId
Sets the Extended Search (DES) item ID of the object content.
    void setItemId (const char* itemId);
 

getDatabaseName
Gets the database name.
    DKString getDatabaseName() const;
 

setDatabaseName
Sets the database name.
    void setDatabaseName(const char* pszDBName );
 

getDocId
Gets the document ID.
    DKString getDocId() const;
 

setDocId
Sets the document ID.
    void setDocId(const char* pszDocId );
 

getFieldName
Gets the field name from the persistent identifier (PID).
    DKString getFieldName() const;
 

setFieldName
Sets the fieldName in the persistent identifier (PID).
    void setFieldName(const char* fieldName);
 

operator=
Assignment operator.
    virtual DKBlobDES&  operator= (const DKBlobDES& aDKBlobDES);
 

operator+
Concatenates this object with another DKBlobDES object, and returns the resulting DKBlobDES object.
    virtual DKBlobDES&  operator+ (const DKBlobDES& blob) const;
 

operator+
Concatenates this object and the specified DKString object, and returns the resulting DKBlobDES object.
    virtual DKBlobDES&  operator+ (const DKString& data) const;
 

operator+
Concatenates the specified DKString object and the specified DKBlobDES object, and returns the resulting object.
    friend  DKBlobDES&  operator+ (const DKString& data, 
                                           const DKBlobDES& blob);
 

subLob
Similar to subString, but returns the subString data in the form of a new DKBlobDES object.
    virtual DKBlobDES&  subLob (long startPos, long len) const; 

getRank
Gets the ranking value of a query.
    long  getRank ();
 

setRank
Sets the ranking value of a query.
    void  setRank (long r);
 

addExtension
Adds the extension object.
    void  addExtension (const DKString& name,
                        const dkExtension* object);
 

removeExtension
Removes the extension object.
    void  removeExtension (const DKString& name);
 

setExtension
Sets the extension object.
    void  setExtension (const DKString& name,
                        const dkExtension* object);
 

getExtension
Gets the extension object.
    const dkExtension*  getExtension (const DKString& name);
 

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.