Poco::Data

template < typename T >

class LOB

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

Description

Representation of a Large OBject.

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

The LOBInputStream and LOBOutputStream classes provide a convenient way to access the data in a LOB.

Member Summary

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

Types Aliases

Container

using Container = std::vector < T >;

ContentPtr

using ContentPtr = Poco::SharedPtr < Container >;

Iterator

using Iterator = typename std::vector < T >::const_iterator;

ValueType

using ValueType = T;

Constructors

LOB inline

LOB();

Creates an empty LOB.

LOB inline

LOB(
    const std::vector < T > & content
);

Creates the LOB, content is deep-copied.

LOB inline

template < typename U = T > LOB(
    const std::enable_if_t < std::is_same_v < T, U > && std::is_same_v < U, char >, std::string > & content
);

Creates a LOB from a string.

LOB inline

template < typename U = T > LOB(
    const std::enable_if_t < std::is_same_v < T, U > && std::is_same_v < U, wchar_t >, std::wstring > & content
);

Creates a LOB from a string.

LOB inline

LOB(
    const LOB & other
);

Creates a LOB by copying another one.

LOB inline

LOB(
    LOB && other
) noexcept;

LOB inline

LOB(
    const T * const pContent,
    std::size_t size
);

Creates the LOB by deep-copying pContent.

Destructor

~LOB inline

~LOB();

Destroys the LOB.

Member Functions

appendRaw inline

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

Assigns raw content to internal storage.

assignRaw inline

void assignRaw(
    const T * ptr,
    std::size_t count
);

Assigns raw content to internal storage.

assignVal inline

void assignVal(
    std::size_t count,
    const T & val
);

Assigns raw content to internal storage.

begin inline

Iterator begin() const;

capacity inline

std::size_t capacity() const;

Returns the capacity of the underlying buffer.

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 < T > & content() const;

Returns the content.

end inline

Iterator end() const;

operator != inline

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

Compares for inequality LOB by value.

operator = inline

LOB & operator = (
    const LOB & other
);

Assignment operator.

operator = inline

LOB & operator = (
    LOB && other
) noexcept;

operator == inline

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

Compares for equality LOB by value.

rawContent inline

const T * rawContent() const;

Returns the raw content.

If the LOB is empty, returns NULL.

rawContent inline

T * rawContent();

Returns the raw content.

If the LOB is empty, returns NULL.

reserve inline

void reserve(
    std::size_t size
);

Sets the capacity of the internal buffer.

resize inline

void resize(
    std::size_t size
);

Resizes the internal buffer.

size inline

std::size_t size() const;

Returns the size of the LOB in bytes.

swap inline

void swap(
    LOB & other
) noexcept;

Swaps the LOB with another one.