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

Public Member Functions

template<>
DUCKDB_API bool Operation (string_t input, float &result, CastParameters &parameters)
template<>
DUCKDB_API bool Operation (string_t input, double &result, CastParameters &parameters)
template<>
DUCKDB_API bool Operation (string_t input, date_t &result, CastParameters &parameters)
template<>
DUCKDB_API bool Operation (string_t input, dtime_t &result, CastParameters &parameters)
template<>
DUCKDB_API bool Operation (string_t input, dtime_ns_t &result, CastParameters &parameters)
template<>
DUCKDB_API bool Operation (string_t input, dtime_tz_t &result, CastParameters &parameters)
template<>
DUCKDB_API bool Operation (string_t input, timestamp_t &result, CastParameters &parameters)
template<>
DUCKDB_API bool Operation (string_t input, timestamp_tz_t &result, CastParameters &parameters)
template<>
DUCKDB_API bool Operation (string_t input, interval_t &result, CastParameters &parameters)
template<>
bool Operation (string_t input, date_t &result, CastParameters &parameters)
template<>
bool Operation (string_t input, dtime_t &result, CastParameters &parameters)
template<>
bool Operation (string_t input, dtime_ns_t &result, CastParameters &parameters)
template<>
bool Operation (string_t input, dtime_tz_t &result, CastParameters &parameters)
template<>
bool Operation (string_t input, timestamp_t &result, CastParameters &parameters)
template<>
bool Operation (string_t input, timestamp_tz_t &result, CastParameters &parameters)
template<>
bool Operation (string_t input, interval_t &result, CastParameters &parameters)

Static Public Member Functions

template<class SRC, class DST>
static bool Operation (SRC input, DST &result, CastParameters &parameters)

Member Function Documentation

◆ Operation() [1/8]

template<class SRC, class DST>
bool duckdb::TryCastErrorMessage::Operation ( SRC input,
DST & result,
CastParameters & parameters )
inlinestatic
31216 {
31217 throw TryCast::UnimplementedErrorMessage(GetTypeId<SRC>(), GetTypeId<DST>(), parameters);
31218 }
PhysicalType GetTypeId()
Returns the PhysicalType for the given type.
Definition duckdb.hpp:10381

◆ Operation() [2/8]

template<>
bool duckdb::TryCastErrorMessage::Operation ( string_t input,
date_t & result,
CastParameters & parameters )
90229 {
90230 idx_t pos;
90231 bool special = false;
90232 switch (Date::TryConvertDate(input.GetData(), input.GetSize(), pos, result, special, parameters.strict)) {
90233 case DateCastResult::SUCCESS:
90234 break;
90235 case DateCastResult::ERROR_INCORRECT_FORMAT:
90236 HandleCastError::AssignError(Date::FormatError(input), parameters);
90237 return false;
90238 case DateCastResult::ERROR_RANGE:
90239 HandleCastError::AssignError(Date::RangeError(input), parameters);
90240 return false;
90241 }
90242 return true;
90243}
static DUCKDB_API DateCastResult TryConvertDate(const char *buf, idx_t len, idx_t &pos, date_t &result, bool &special, bool strict=false)
Definition duckdb.cpp:117363
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Operation() [3/8]

template<>
bool duckdb::TryCastErrorMessage::Operation ( string_t input,
dtime_t & result,
CastParameters & parameters )
90262 {
90263 if (!TryCast::Operation<string_t, dtime_t>(input, result, parameters.strict)) {
90264 HandleCastError::AssignError(Time::ConversionError(input), parameters);
90265 return false;
90266 }
90267 return true;
90268}

◆ Operation() [4/8]

template<>
bool duckdb::TryCastErrorMessage::Operation ( string_t input,
dtime_ns_t & result,
CastParameters & parameters )
90285 {
90286 if (!TryCast::Operation<string_t, dtime_ns_t>(input, result, parameters.strict)) {
90287 HandleCastError::AssignError(Time::ConversionError(input), parameters);
90288 return false;
90289 }
90290 return true;
90291}

◆ Operation() [5/8]

template<>
bool duckdb::TryCastErrorMessage::Operation ( string_t input,
dtime_tz_t & result,
CastParameters & parameters )
90320 {
90321 if (!TryCast::Operation<string_t, dtime_tz_t>(input, result, parameters.strict)) {
90322 HandleCastError::AssignError(Time::ConversionError(input), parameters);
90323 return false;
90324 }
90325 return true;
90326}

◆ Operation() [6/8]

template<>
bool duckdb::TryCastErrorMessage::Operation ( string_t input,
timestamp_t & result,
CastParameters & parameters )
90348 {
90349 switch (Timestamp::TryConvertTimestamp(input.GetData(), input.GetSize(), result, false)) {
90350 case TimestampCastResult::SUCCESS:
90351 case TimestampCastResult::STRICT_UTC:
90352 return true;
90353 case TimestampCastResult::ERROR_INCORRECT_FORMAT:
90354 HandleCastError::AssignError(Timestamp::FormatError(input), parameters);
90355 break;
90356 case TimestampCastResult::ERROR_NON_UTC_TIMEZONE:
90357 HandleCastError::AssignError(Timestamp::UnsupportedTimezoneError(input), parameters);
90358 break;
90359 case TimestampCastResult::ERROR_RANGE:
90360 HandleCastError::AssignError(Timestamp::RangeError(input), parameters);
90361 break;
90362 }
90363 return false;
90364}
static DUCKDB_API TimestampCastResult TryConvertTimestamp(const char *str, idx_t len, timestamp_t &result, const bool use_offset, optional_ptr< int32_t > nanos=nullptr, bool strict=false)
Strict Timestamp does not accept offsets.
Definition duckdb.cpp:129558

◆ Operation() [7/8]

template<>
bool duckdb::TryCastErrorMessage::Operation ( string_t input,
timestamp_tz_t & result,
CastParameters & parameters )
90367 {
90368 switch (Timestamp::TryConvertTimestamp(input.GetData(), input.GetSize(), result, true)) {
90369 case TimestampCastResult::SUCCESS:
90370 case TimestampCastResult::STRICT_UTC:
90371 return true;
90372 case TimestampCastResult::ERROR_INCORRECT_FORMAT:
90373 HandleCastError::AssignError(Timestamp::FormatError(input), parameters);
90374 break;
90375 case TimestampCastResult::ERROR_NON_UTC_TIMEZONE:
90376 HandleCastError::AssignError(Timestamp::UnsupportedTimezoneError(input), parameters);
90377 break;
90378 case TimestampCastResult::ERROR_RANGE:
90379 HandleCastError::AssignError(Timestamp::RangeError(input), parameters);
90380 break;
90381 }
90382 return false;
90383}

◆ Operation() [8/8]

template<>
bool duckdb::TryCastErrorMessage::Operation ( string_t input,
interval_t & result,
CastParameters & parameters )
90427 {
90428 return Interval::FromCString(input.GetData(), input.GetSize(), result, parameters.error_message, parameters.strict);
90429}
static bool FromCString(const char *str, idx_t len, interval_t &result, string *error_message, bool strict)
Convert a string to an interval object.
Definition duckdb.cpp:123138

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