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::ExceptionFormatValue Struct Reference
Collaboration diagram for duckdb::ExceptionFormatValue:

Public Member Functions

DUCKDB_API ExceptionFormatValue (double dbl_val)
 
DUCKDB_API ExceptionFormatValue (int64_t int_val)
 
DUCKDB_API ExceptionFormatValue (idx_t uint_val)
 
DUCKDB_API ExceptionFormatValue (string str_val)
 
DUCKDB_API ExceptionFormatValue (const String &str_val)
 
DUCKDB_API ExceptionFormatValue (hugeint_t hg_val)
 
DUCKDB_API ExceptionFormatValue (uhugeint_t uhg_val)
 
template<>
ExceptionFormatValue CreateFormatValue (const PhysicalType &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const LogicalType &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const float &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const double &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const string &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const String &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const SQLString &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const SQLIdentifier &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const char *const &value)
 
template<>
ExceptionFormatValue CreateFormatValue (char *const &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const idx_t &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const hugeint_t &value)
 
template<>
ExceptionFormatValue CreateFormatValue (const uhugeint_t &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const PhysicalType &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const SQLString &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const SQLIdentifier &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const LogicalType &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const float &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const double &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const string &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const String &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const char *const &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (char *const &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const idx_t &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const hugeint_t &value)
 
template<>
DUCKDB_API ExceptionFormatValue CreateFormatValue (const uhugeint_t &value)
 

Static Public Member Functions

template<class T >
static ExceptionFormatValue CreateFormatValue (const T &value)
 
static string Format (const string &msg, std::vector< ExceptionFormatValue > &values)
 

Public Attributes

ExceptionFormatValueType type
 
double dbl_val = 0
 
hugeint_t int_val = 0
 
string str_val
 

Constructor & Destructor Documentation

◆ ExceptionFormatValue() [1/7]

duckdb::ExceptionFormatValue::ExceptionFormatValue ( double  dbl_val)
71896 : type(ExceptionFormatValueType::FORMAT_VALUE_TYPE_DOUBLE), dbl_val(dbl_val) {
71897}

◆ ExceptionFormatValue() [2/7]

duckdb::ExceptionFormatValue::ExceptionFormatValue ( int64_t  int_val)
71899 : type(ExceptionFormatValueType::FORMAT_VALUE_TYPE_INTEGER), int_val(int_val) {
71900}

◆ ExceptionFormatValue() [3/7]

duckdb::ExceptionFormatValue::ExceptionFormatValue ( idx_t  uint_val)
71902 : type(ExceptionFormatValueType::FORMAT_VALUE_TYPE_INTEGER), int_val(Hugeint::Convert(uint_val)) {
71903}

◆ ExceptionFormatValue() [4/7]

duckdb::ExceptionFormatValue::ExceptionFormatValue ( string  str_val)
71911 : type(ExceptionFormatValueType::FORMAT_VALUE_TYPE_STRING), str_val(std::move(str_val)) {
71912}

◆ ExceptionFormatValue() [5/7]

duckdb::ExceptionFormatValue::ExceptionFormatValue ( const String str_val)
71913 : ExceptionFormatValue(str_val.ToStdString()) {
71914}

◆ ExceptionFormatValue() [6/7]

duckdb::ExceptionFormatValue::ExceptionFormatValue ( hugeint_t  hg_val)
71905 : type(ExceptionFormatValueType::FORMAT_VALUE_TYPE_STRING), str_val(Hugeint::ToString(huge_val)) {
71906}
static string ToString(hugeint_t input)
Convert a hugeint object to a string.

◆ ExceptionFormatValue() [7/7]

duckdb::ExceptionFormatValue::ExceptionFormatValue ( uhugeint_t  uhg_val)
71908 : type(ExceptionFormatValueType::FORMAT_VALUE_TYPE_STRING), str_val(Uhugeint::ToString(uhuge_val)) {
71909}
static string ToString(uhugeint_t input)
Convert a uhugeint object to a string.

Member Function Documentation

◆ CreateFormatValue() [1/14]

template<class T >
static ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const T &  value)
inlinestatic
447 {
448 return int64_t(value);
449 }
::int64_t int64_t

◆ Format()

string duckdb::ExceptionFormatValue::Format ( const string &  msg,
std::vector< ExceptionFormatValue > &  values 
)
static
71971 {
71972 try {
71973 std::vector<duckdb_fmt::basic_format_arg<duckdb_fmt::printf_context>> format_args;
71974 for (auto &val : values) {
71975 switch (val.type) {
71976 case ExceptionFormatValueType::FORMAT_VALUE_TYPE_DOUBLE:
71977 format_args.push_back(duckdb_fmt::internal::make_arg<duckdb_fmt::printf_context>(val.dbl_val));
71978 break;
71979 case ExceptionFormatValueType::FORMAT_VALUE_TYPE_INTEGER:
71980 format_args.push_back(duckdb_fmt::internal::make_arg<duckdb_fmt::printf_context>(val.int_val));
71981 break;
71982 case ExceptionFormatValueType::FORMAT_VALUE_TYPE_STRING:
71983 format_args.push_back(duckdb_fmt::internal::make_arg<duckdb_fmt::printf_context>(val.str_val));
71984 break;
71985 }
71986 }
71987 return duckdb_fmt::vsprintf(msg, duckdb_fmt::basic_format_args<duckdb_fmt::printf_context>(
71988 format_args.data(), static_cast<int>(format_args.size())));
71989 } catch (std::exception &ex) { // LCOV_EXCL_START
71990 // work-around for oss-fuzz limiting memory which causes issues here
71991 if (StringUtil::Contains(ex.what(), "fuzz mode")) {
71992 throw InvalidInputException(msg);
71993 }
71994 throw InternalException(std::string("Primary exception: ") + msg +
71995 "\nSecondary exception in ExceptionFormatValue: " + ex.what());
71996 } // LCOV_EXCL_STOP
71997}
static DUCKDB_API bool Contains(const string &haystack, const string &needle)
Returns true if the needle string exists in the haystack.
Definition duckdb.cpp:16139

◆ CreateFormatValue() [2/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const PhysicalType value)
71917 {
71918 return ExceptionFormatValue(TypeIdToString(value));
71919}

◆ CreateFormatValue() [3/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const LogicalType value)
71921 {
71922 return ExceptionFormatValue(value.ToString());
71923}

◆ CreateFormatValue() [4/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const float value)
71925 {
71926 return ExceptionFormatValue(static_cast<double>(value));
71927}

◆ CreateFormatValue() [5/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const double value)
71929 {
71930 return ExceptionFormatValue(value);
71931}

◆ CreateFormatValue() [6/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const string &  value)
71933 {
71934 return ExceptionFormatValue(value);
71935}

◆ CreateFormatValue() [7/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const String value)
71937 {
71938 return ExceptionFormatValue(value);
71939}

◆ CreateFormatValue() [8/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const SQLString value)
71941 {
71942 return KeywordHelper::WriteQuoted(value.raw_string, '\'');
71943}
static string WriteQuoted(const string &text, char quote='\'')
Writes a string that is quoted.

◆ CreateFormatValue() [9/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const SQLIdentifier value)
71946 {
71947 return KeywordHelper::WriteOptionallyQuoted(value.raw_string, '"');
71948}
static string WriteOptionallyQuoted(const string &text, char quote='"', bool allow_caps = true, KeywordCategory category = KeywordCategory::KEYWORD_NONE)
Writes a string that is optionally quoted + escaped so it can be used as an identifier.

◆ CreateFormatValue() [10/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const char *const value)
71951 {
71952 return ExceptionFormatValue(string(value));
71953}

◆ CreateFormatValue() [11/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( char *const value)
71955 {
71956 return ExceptionFormatValue(string(value));
71957}

◆ CreateFormatValue() [12/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const idx_t value)
71959 {
71960 return ExceptionFormatValue(value);
71961}

◆ CreateFormatValue() [13/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const hugeint_t value)
71963 {
71964 return ExceptionFormatValue(value);
71965}

◆ CreateFormatValue() [14/14]

template<>
ExceptionFormatValue duckdb::ExceptionFormatValue::CreateFormatValue ( const uhugeint_t value)
71967 {
71968 return ExceptionFormatValue(value);
71969}

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