iceberg-cpp
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
iceberg::Conversions Class Reference

Conversion utilities for primitive types. More...

#include <conversions.h>

Static Public Member Functions

static Result< std::vector< uint8_t > > ToBytes (const PrimitiveType &type, const Literal::Value &value)
 Serializes a raw literal value into a byte vector according to its type.
 
static Result< std::vector< uint8_t > > ToBytes (const Literal &literal)
 Serializes a complete Literal object into a byte vector.
 
static Result< Literal::Value > FromBytes (const PrimitiveType &type, std::span< const uint8_t > data)
 Deserializes a span of bytes into a raw literal value based on the given type.
 
static Result< LiteralFromBytes (std::shared_ptr< PrimitiveType > type, std::span< const uint8_t > data)
 Deserializes a span of bytes into a complete Literal object.
 

Detailed Description

Conversion utilities for primitive types.

Member Function Documentation

◆ FromBytes() [1/2]

Result< Literal::Value > iceberg::Conversions::FromBytes ( const PrimitiveType type,
std::span< const uint8_t >  data 
)
static

Deserializes a span of bytes into a raw literal value based on the given type.

Parameters
typeThe target primitive type to interpret the bytes as.
dataA std::span of bytes representing the serialized value.
Returns
A Result containing the deserialized value.

◆ FromBytes() [2/2]

Result< Literal > iceberg::Conversions::FromBytes ( std::shared_ptr< PrimitiveType type,
std::span< const uint8_t >  data 
)
static

Deserializes a span of bytes into a complete Literal object.

Parameters
typeA shared pointer to the target primitive type.
dataA std::span of bytes representing the serialized value.
Returns
A Result containing the deserialized value.

◆ ToBytes() [1/2]

Result< std::vector< uint8_t > > iceberg::Conversions::ToBytes ( const Literal literal)
static

Serializes a complete Literal object into a byte vector.

Parameters
literalThe Literal object to serialize.
Returns
A Result containing the serialized value.

◆ ToBytes() [2/2]

Result< std::vector< uint8_t > > iceberg::Conversions::ToBytes ( const PrimitiveType type,
const Literal::Value &  value 
)
static

Serializes a raw literal value into a byte vector according to its type.

Parameters
typeThe primitive type of the value.
valueThe std::variant holding the raw literal value to serialize.
Returns
A Result containing the serialized value.

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