OZO 「お象」
Boost.Asio and libpq based asynchronous PostgreSQL unofficial header-only C++17 client library.
ozo::value Class Reference

#include <ozo/result.h>

Description

Database request result value proxy.

Provides access to values of a database request result. The library is designed to do not obligate a user to have a deal with raw and untyped results representation. But sometimes it is really needed to have an access to raw representation of the result. E.g. for reducing memory consumption or performance reason. For that case the library provides this mechanism.

Public Member Functions

oid_t oid () const noexcept
 
bool is_text () const noexcept
 
bool is_binary () const noexcept
 
const char * data () const noexcept
 
std::size_t size () const noexcept
 
bool is_null () const noexcept
 

Member Function Documentation

◆ data()

const char* ozo::value::data ( ) const
noexcept

Get value raw data buffer access.

Returns
const char* — pointer to raw data buffer
See also
ozo::value::size()

◆ is_binary()

bool ozo::value::is_binary ( ) const
noexcept

Determine whether the value is in binary format. Should be always true for current implementation.

Returns
true — value in binary format
false — value in text format

◆ is_null()

bool ozo::value::is_null ( ) const
noexcept

Determine whether the value is in NULL state.

Returns
true — if value is NULL
false — value is not NULL

◆ is_text()

bool ozo::value::is_text ( ) const
noexcept

Determine whether the value is in text format. Should be always false for current implementation.

Returns
true — value in text format
false — value in binary format

◆ oid()

oid_t ozo::value::oid ( ) const
noexcept

Get value type OID

Returns
oid_t — type OID

◆ size()

std::size_t ozo::value::size ( ) const
noexcept

Get value raw data buffer size.

Returns
std::size_t — size of raw data buffer in bytes.
See also
ozo::value::data()