Poco::Data

class BLOB

Library: Data
Package: DataCore
Header: Poco/Data/BLOB.h

Description

Representation of a Binary Large OBject.

A BLOB can hold arbitrary binary data. The maximum size depends on the underlying database.

The BLOBInputStream and BLOBOutputStream classes provide a convenient way to access the data in a BLOB.

Member Summary

Member Functions: appendRaw, assignRaw, begin, clear, compact, content, end, operator, operator !=, operator =, rawContent, size, swap

Types

Iterator

typedef std::vector < char >::const_iterator Iterator;

Constructors

BLOB

BLOB();

Creates an empty BLOB.

BLOB

BLOB(
    const std::vector < char > & content
);

Creates the BLOB, content is deep-copied.

BLOB

BLOB(
    const std::string & content
);

Creates a BLOB from a string.

BLOB

BLOB(
    const BLOB & other
);

Creates a BLOB by copying another one.

BLOB

BLOB(
    const char * const pContent,
    std::size_t size
);

Creates the BLOB by deep-copying pContent.

Destructor

~BLOB

~BLOB();

Destroys the BLOB.

Member Functions

appendRaw inline

void appendRaw(
    const char * pChar,
    std::size_t count
);

Assigns raw content to internal storage.

assignRaw inline

void assignRaw(
    const char * pChar,
    std::size_t count
);

Assigns raw content to internal storage.

begin inline

Iterator begin() const;

clear inline

void clear(
    bool doCompact = false
);

Clears the content of the blob. If doCompact is true, trims the excess capacity.

compact inline

void compact();

Trims the internal storage excess capacity.

content inline

const std::vector < char > & content() const;

Returns the content.

end inline

Iterator end() const;

operator inline

bool operator == (
    const BLOB & other
) const;

Compares for equality BLOB by value.

operator != inline

bool operator != (
    const BLOB & other
) const;

Compares for inequality BLOB by value.

operator =

BLOB & operator = (
    const BLOB & other
);

Assignment operator.

rawContent inline

const char * rawContent() const;

Returns the raw content.

If the BLOB is empty, returns NULL.

size inline

std::size_t size() const;

Returns the size of the BLOB in bytes.

swap inline

void swap(
    BLOB & other
);

Swaps the BLOB with another one.