Binary Large Objects (blob)

Chapter Updated 9/12/25




The objective of this chapter is to provide information regarding the xbBlob functionality contained within the Xbase64 library.

The xbBlob class:

  • Misc utility class for supporting blob data.
  • A blob is a series ASCII bytes that can potentially include null 0x00 bytes.
  • Max size of a xbBlob is the size of a 32 bit integer which is 2,147,483,647 or 2G
  • Includes an integer user field that can be used as needed by an application program.


    Methods for managing the logfile

    MethodDescription
    xbBlob()
    xbBlob( unsigned char *pIn, xbInt32 lBlobLen )
    Constructors
    ~xbBlob()Destructor
    xbInt16 Append( const xbBlob &bAppendBlob )Append data to blob object
    void Clear()Clear blob contents and free associated memory.
    void Dump()Dump xbBlob internals.
    Available if XB_DEBUG_SUPPORT is compiled into library.
    xbInt32 GetLen() constReturn the length of the blob.
    unsigned char *GetBlob() constReturn pointer to blob data.
    char GetDbaseType() constReturn dBASE type field. Defaults to space if not set.
    U - User value (field type B)
    S - Sound or noise (field type B)
    I - Image or video (field type B)
    O - OLE field (field type G)
    xbInt32 GetUser1() constReturn the user field. Get user integer field. Defaults to 0 if not set.
    xbInt16 Set( unsigned char *vpIn, xbInt32 lBlobLen = 0 )Set the blob object to data at vpIn for lBlobLen bytes.
    void SetUser1( xbInt32 iUser1 )Set user field to value in iUser1
    void SetDbaseType( char cDbaseType )Set dBASE type.
    U - User value
    S - Sound or noise
    I - Image or video 0 - OLE field
    xbInt16 ReadFromFile( xbXBase &x, xbString &sFileName, xbInt32 lStartPos = 0, xbInt32 lLen = 0 ) Read blob from an input file.
    x - Pointer to main xbXBase instance.
    sFileName - Input file to read blob data from.
    lStartPos - Starting position within file to read.
    lLen - Length of data to read. 0 for the entire file contents (is if fits).
    xbInt16 ReadFromFile( xbFile &f, xbInt32 lStartPos = 0, xbInt32 lLen = 0 ) Read blob from an open input file.
    f - Pointer to xbFile object.
    lStartPos - Starting position within file to read.
    lLen - Length of data to read. 0 for the entire file contents (is if fits).
    xbInt16 WriteToFile( xbXBase &x, xbString &sFileName, xbInt16 iMode = 0, xbInt32 lStartPos = 0, xbInt32 lLen = 0 ) Write blob to an output file. x - Pointer to main xbXBase instance.
    sFileName - Input write blob data to.
    iMode 0 - Truncate file if it exists and place data at the beginning of the file.
    1 - Append data to the end of the file.
    lStartPos Starting position within blob to write to the file. 0 is default and beginning of blob.
    lLen - Length of data to write or 0 to write the entire blob contents to the file.
    xbBool operator == (const xbBlob &b) constCompare for equality operator
    b Blob to compare.
    Returns xbTrue if xbBlobs match or xbFalse if xbBlobs don't match.
    xbBool operator != (const xbBlob &b) constCompare for inequality operator
    b Blob to compare.
    Returns xbTrue if xbBlobs don't match or xbFalse if xbBlobs match.