Couchbase Lite C++
Couchbase Lite C++ API
Loading...
Searching...
No Matches
cbl::BlobReadStream Class Reference

A stream for reading a blob's content from the database. More...

#include <cbl++/Blob.hh>

Public Types

using SeekBase = CBLSeekBase
 Alias for the C CBLSeekBase enum describing the reference point used by seek.

Public Member Functions

 BlobReadStream (Blob *blob)
 Opens a stream for reading a blob's content.
 ~BlobReadStream ()
 Closes the underlying read stream.
size_t read (void *dst, size_t maxLength)
 Reads data from a blob.
int64_t seek (int64_t offset, SeekBase base)
 Sets the position of a CBLBlobReadStream.
uint64_t position ()
 Returns the current position of a CBLBlobReadStream.

Detailed Description

A stream for reading a blob's content from the database.

Member Typedef Documentation

◆ SeekBase

Alias for the C CBLSeekBase enum describing the reference point used by seek.

Constructor & Destructor Documentation

◆ BlobReadStream()

cbl::BlobReadStream::BlobReadStream ( Blob * blob)
inline

Opens a stream for reading a blob's content.

Parameters
blobThe blob whose content will be read.

◆ ~BlobReadStream()

cbl::BlobReadStream::~BlobReadStream ( )
inline

Closes the underlying read stream.

Member Function Documentation

◆ position()

uint64_t cbl::BlobReadStream::position ( )
inline

Returns the current position of a CBLBlobReadStream.

◆ read()

size_t cbl::BlobReadStream::read ( void * dst,
size_t maxLength )
inline

Reads data from a blob.

Parameters
dstThe address to copy the read data to.
maxLengthThe maximum number of bytes to read.
Returns
The actual number of bytes read; 0 if at EOF.

◆ seek()

int64_t cbl::BlobReadStream::seek ( int64_t offset,
SeekBase base )
inline

Sets the position of a CBLBlobReadStream.

Parameters
offsetThe byte offset in the stream (relative to the mode).
baseThe base position from which the offset is calculated.
Returns
The new absolute position, or throw on failure.

The documentation for this class was generated from the following file: