Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::FSSTPrimitives Class Reference

Classes

struct  StringWithExtraSpace
 

Static Public Member Functions

static string_t DecompressValue (void *duckdb_fsst_decoder, VectorStringBuffer &str_buffer, const char *compressed_string, const idx_t compressed_string_len)
 
static string_t DecompressInlinedValue (void *duckdb_fsst_decoder, const char *compressed_string, const idx_t compressed_string_len)
 
static string DecompressValue (void *duckdb_fsst_decoder, const char *compressed_string, const idx_t compressed_string_len, vector< unsigned char > &decompress_buffer)
 

Member Function Documentation

◆ DecompressValue() [1/2]

static string_t duckdb::FSSTPrimitives::DecompressValue ( void duckdb_fsst_decoder,
VectorStringBuffer str_buffer,
const char compressed_string,
const idx_t  compressed_string_len 
)
inlinestatic
75710 {
75711 const auto max_uncompressed_length = compressed_string_len * 8;
75712 const auto fsst_decoder = static_cast<duckdb_fsst_decoder_t *>(duckdb_fsst_decoder);
75713 const auto compressed_string_ptr = (const unsigned char *)compressed_string; // NOLINT
75714 const auto target_ptr = str_buffer.AllocateShrinkableBuffer(max_uncompressed_length);
75715 const auto decompressed_string_size = duckdb_fsst_decompress(
75716 fsst_decoder, compressed_string_len, compressed_string_ptr, max_uncompressed_length, target_ptr);
75717 return str_buffer.FinalizeShrinkableBuffer(target_ptr, max_uncompressed_length, decompressed_string_size);
75718 }
Definition duckdb.cpp:75538

◆ DecompressInlinedValue()

static string_t duckdb::FSSTPrimitives::DecompressInlinedValue ( void duckdb_fsst_decoder,
const char compressed_string,
const idx_t  compressed_string_len 
)
inlinestatic
75720 {
75721 const auto fsst_decoder = static_cast<duckdb_fsst_decoder_t *>(duckdb_fsst_decoder);
75722 const auto compressed_string_ptr = (const unsigned char *)compressed_string; // NOLINT
75723 StringWithExtraSpace result;
75724 const auto target_ptr = (unsigned char *)result.str.GetPrefixWriteable(); // NOLINT
75725 const auto decompressed_string_size =
75726 duckdb_fsst_decompress(fsst_decoder, compressed_string_len, compressed_string_ptr,
75727 string_t::INLINE_LENGTH + sizeof(StringWithExtraSpace::extra_space), target_ptr);
75728 if (decompressed_string_size > string_t::INLINE_LENGTH) {
75729 throw IOException("Corrupt database file: decoded FSST string of >=%llu bytes (should be <=%llu bytes)",
75730 decompressed_string_size, string_t::INLINE_LENGTH);
75731 }
75732 D_ASSERT(decompressed_string_size <= string_t::INLINE_LENGTH);
75733 result.str.SetSizeAndFinalize(UnsafeNumericCast<uint32_t>(decompressed_string_size), string_t::INLINE_LENGTH);
75734 return result.str;
75735 }

◆ DecompressValue() [2/2]

string duckdb::FSSTPrimitives::DecompressValue ( void duckdb_fsst_decoder,
const char compressed_string,
const idx_t  compressed_string_len,
vector< unsigned char > &  decompress_buffer 
)
static
75745 {
75746 auto compressed_string_ptr = reinterpret_cast<const unsigned char *>(compressed_string);
75747 auto fsst_decoder = static_cast<duckdb_fsst_decoder_t *>(duckdb_fsst_decoder);
75748 auto decompressed_string_size = duckdb_fsst_decompress(fsst_decoder, compressed_string_len, compressed_string_ptr,
75749 decompress_buffer.size(), decompress_buffer.data());
75750
75751 D_ASSERT(!decompress_buffer.empty());
75752 D_ASSERT(decompressed_string_size <= decompress_buffer.size() - 1);
75753 return string(char_ptr_cast(decompress_buffer.data()), decompressed_string_size);
75754}

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