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::ParsedExtensionMetaData Struct Reference

The parsed extension metadata footer. More...

#include <duckdb.hpp>

Public Member Functions

bool AppearsValid ()
string GetInvalidMetadataError ()

Public Attributes

string magic_value
ExtensionABIType abi_type
string platform
string duckdb_version
string duckdb_capi_version
string extension_version
string signature
string extension_abi_metadata

Static Public Attributes

static constexpr const idx_t FOOTER_SIZE = 512
static constexpr const idx_t SIGNATURE_SIZE = 256
static constexpr const char * EXPECTED_MAGIC_VALUE

Detailed Description

The parsed extension metadata footer.

Member Function Documentation

◆ AppearsValid()

bool duckdb::ParsedExtensionMetaData::AppearsValid ( )
inline
43834 {
43835 return magic_value == EXPECTED_MAGIC_VALUE;
43836 }

◆ GetInvalidMetadataError()

string duckdb::ParsedExtensionMetaData::GetInvalidMetadataError ( )
280824 {
280825 const string engine_platform = string(DuckDB::Platform());
280826
280827 if (!AppearsValid()) {
280828 return "The file is not a DuckDB extension. The metadata at the end of the file is invalid";
280829 }
280830
280831 string result;
280832
280833 // CPP or C_STRUCT_UNSTABLE ABI versioning needs to match the DuckDB version exactly
280834 if (abi_type == ExtensionABIType::CPP || abi_type == ExtensionABIType::C_STRUCT_UNSTABLE) {
280835 const string engine_version = string(ExtensionHelper::GetVersionDirectoryName());
280836
280837 if (engine_version != duckdb_version) {
280838 result += StringUtil::Format("The file was built specifically for DuckDB version '%s' and can only be "
280839 "loaded with that version of DuckDB. (this version of DuckDB is '%s')",
280840 PrettyPrintString(duckdb_version), engine_version);
280841 }
280842 // C_STRUCT ABI versioning
280843 } else if (abi_type == ExtensionABIType::C_STRUCT) {
280844 idx_t major, minor, patch;
280845 if (!VersioningUtils::ParseSemver(duckdb_capi_version, major, minor, patch)) {
280846 result += StringUtil::Format("The file was built for DuckDB C API version '%s', which failed to parse as a "
280847 "recognized version string",
280848 duckdb_capi_version, DUCKDB_EXTENSION_API_VERSION_MAJOR);
280849 } else if (major != DUCKDB_EXTENSION_API_VERSION_MAJOR) {
280850 // Special case where the extension is built for a completely unsupported API
280851 result +=
280852 StringUtil::Format("The file was built for DuckDB C API version '%s', but we can only load extensions "
280853 "built for DuckDB C API 'v%lld.x.y'.",
280854 duckdb_capi_version, DUCKDB_EXTENSION_API_VERSION_MAJOR);
280855 } else if (!VersioningUtils::IsSupportedCAPIVersion(major, minor, patch)) {
280856 result +=
280857 StringUtil::Format("The file was built for DuckDB C API version '%s', but we can only load extensions "
280858 "built for DuckDB C API 'v%lld.%lld.%lld' and lower.",
280859 duckdb_capi_version, DUCKDB_EXTENSION_API_VERSION_MAJOR,
280860 DUCKDB_EXTENSION_API_VERSION_MINOR, DUCKDB_EXTENSION_API_VERSION_PATCH);
280861 }
280862 } else {
280863 throw InternalException("Unknown ABI type for extension: '%s'", extension_abi_metadata);
280864 }
280865
280866 if (engine_platform != platform) {
280867 if (!result.empty()) {
280868 result += " Also, t";
280869 } else {
280870 result += "T";
280871 }
280872 result += StringUtil::Format(
280873 "he file was built for the platform '%s', but we can only load extensions built for platform '%s'.",
280874 PrettyPrintString(platform), engine_platform);
280875 }
280876
280877 return result;
280878}
static const string GetVersionDirectoryName()
For tagged releases we use the tag, else we use the git commit hash.
Definition duckdb.cpp:279168
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
@ CPP
Uses C++ ABI, version needs to match precisely.
Definition duckdb.hpp:43805
@ C_STRUCT
Uses C ABI using the duckdb_ext_api_v1 struct, version needs to be equal or higher.
Definition duckdb.hpp:43807
@ C_STRUCT_UNSTABLE
Uses C ABI using the duckdb_ext_api_v1 struct including "unstable" functions, version needs to match ...
Definition duckdb.hpp:43809
static bool ParseSemver(string &semver, idx_t &major_out, idx_t &minor_out, idx_t &patch_out)
Note: only supports format v{major}.{minor}.{patch}.
Definition duckdb.cpp:280905
static bool IsSupportedCAPIVersion(string &capi_version_string)
Note: only supports format v{major}.{minor}.{patch}.
Definition duckdb.cpp:280880

Member Data Documentation

◆ EXPECTED_MAGIC_VALUE

const char* duckdb::ParsedExtensionMetaData::EXPECTED_MAGIC_VALUE
staticconstexpr
Initial value:
= {
"4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}
43816 {
43817 "4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};

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