![]() |
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.
|
#include <duckdb.hpp>
Classes | |
| struct | EnumStringLiteral |
Static Public Member Functions | |
| static string | GenerateRandomName (idx_t length=16) |
| static uint8_t | GetHexValue (char c) |
| static uint8_t | GetBinaryValue (char c) |
| static bool | CharacterIsSpace (char c) |
| static bool | CharacterIsNewline (char c) |
| static bool | CharacterIsDigit (char c) |
| static bool | CharacterIsHex (char c) |
| static char | CharacterToUpper (char c) |
| static char | CharacterToLower (char c) |
| static bool | CharacterIsAlpha (char c) |
| static bool | CharacterIsAlphaNumeric (char c) |
| static bool | CharacterIsOperator (char c) |
| template<class TO> | |
| static vector< TO > | ConvertStrings (const vector< string > &strings) |
| static vector< SQLIdentifier > | ConvertToSQLIdentifiers (const vector< string > &strings) |
| static vector< SQLString > | ConvertToSQLStrings (const vector< string > &strings) |
| static DUCKDB_API bool | Contains (const string &haystack, const string &needle) |
| Returns true if the needle string exists in the haystack. | |
| static DUCKDB_API bool | Contains (const string &haystack, const char &needle_char) |
| static DUCKDB_API optional_idx | Find (const string &haystack, const string &needle) |
| Returns the position of needle string within the haystack. | |
| static DUCKDB_API bool | StartsWith (string str, string prefix) |
| Returns true if the target string starts with the given prefix. | |
| static DUCKDB_API bool | EndsWith (const string &str, const string &suffix) |
| Returns true if the target string ends with the given suffix. | |
| static DUCKDB_API string | Repeat (const string &str, const idx_t n) |
| Repeat a string multiple times. | |
| static DUCKDB_API vector< string > | Split (const string &str, char delimiter) |
| Split the input string based on newline char. | |
| static DUCKDB_API vector< string > | SplitWithParentheses (const string &str, char delimiter=',', char par_open='(', char par_close=')') |
| Split the input string, ignore delimiters within parentheses. Note: leading/trailing spaces are NOT stripped. | |
| static DUCKDB_API vector< string > | SplitWithQuote (const string &str, char delimiter=',', char quote='"') |
| Split the input string allong a quote. Note that any escaping is NOT supported. | |
| static DUCKDB_API string | Join (const vector< string > &input, const string &separator) |
| Join multiple strings into one string. Components are concatenated by the given separator. | |
| static DUCKDB_API string | Join (const set< string > &input, const string &separator) |
| static DUCKDB_API string | URLEncode (const string &str, bool encode_slash=true) |
| Encode special URL characters in a string. | |
| static DUCKDB_API idx_t | URLEncodeSize (const char *input, idx_t input_size, bool encode_slash=true) |
| static DUCKDB_API void | URLEncodeBuffer (const char *input, idx_t input_size, char *output, bool encode_slash=true) |
| static DUCKDB_API string | URLDecode (const string &str, bool plus_to_space=false) |
| Decode URL escape sequences (e.g. %20) in a string. | |
| static DUCKDB_API idx_t | URLDecodeSize (const char *input, idx_t input_size, bool plus_to_space=false) |
| static DUCKDB_API void | URLDecodeBuffer (const char *input, idx_t input_size, char *output, bool plus_to_space=false) |
| static DUCKDB_API void | SkipBOM (const char *buffer_ptr, const idx_t &buffer_size, idx_t &buffer_pos) |
| BOM skipping (https://en.wikipedia.org/wiki/Byte_order_mark). | |
| static DUCKDB_API idx_t | ToUnsigned (const string &str) |
| static DUCKDB_API int64_t | ToSigned (const string &str) |
| static DUCKDB_API double | ToDouble (const string &str) |
| template<class T> | |
| static string | ToString (const vector< T > &input, const string &separator) |
| template<typename C, typename S, typename FUNC> | |
| static string | Join (const C &input, S count, const string &separator, FUNC f) |
| static DUCKDB_API string | BytesToHumanReadableString (idx_t bytes, idx_t multiplier=1024) |
| Return a string that formats the give number of bytes. | |
| static DUCKDB_API string | TryParseFormattedBytes (const string &arg, idx_t &result) |
| static DUCKDB_API idx_t | ParseFormattedBytes (const string &arg) |
| static DUCKDB_API string | Upper (const string &str) |
| Convert a string to UPPERCASE. | |
| static DUCKDB_API string | Lower (const string &str) |
| Convert a string to lowercase. | |
| static DUCKDB_API string | Title (const string &str) |
| Convert a string to Title Case. | |
| static DUCKDB_API bool | IsLower (const string &str) |
| static DUCKDB_API bool | IsUpper (const string &str) |
| static DUCKDB_API uint64_t | CIHash (const string &str) |
| Case insensitive hash. | |
| static DUCKDB_API uint64_t | CIHash (const char *str, idx_t size) |
| static DUCKDB_API bool | CIEquals (const string &l1, const string &l2) |
| Case insensitive equals. | |
| static DUCKDB_API bool | CIEquals (const char *l1, idx_t l1_size, const char *l2, idx_t l2_size) |
| Case insensitive equals (null-terminated strings). | |
| static DUCKDB_API bool | CIStartsWith (const string &str, const string &prefix) |
| Case insensitive starts-with. | |
| static DUCKDB_API bool | CILessThan (const string &l1, const string &l2) |
| Case insensitive compare. | |
| static DUCKDB_API idx_t | CIFind (vector< string > &vec, const string &str) |
| Case insensitive find, returns DConstants::INVALID_INDEX if not found. | |
| template<typename... ARGS> | |
| static string | Format (const string fmt_str, ARGS... params) |
| Format a string using printf semantics. | |
| static DUCKDB_API vector< string > | Split (const string &input, const string &split) |
| Split the input string into a vector of strings based on the split string. | |
| static DUCKDB_API void | LTrim (string &str) |
| Remove the whitespace char in the left end of the string. | |
| static DUCKDB_API void | RTrim (string &str) |
| Remove the whitespace char in the right end of the string. | |
| static DUCKDB_API void | RTrim (string &str, const string &chars_to_trim) |
| Remove the all chars from chars_to_trim char in the right end of the string. | |
| static DUCKDB_API void | Trim (string &str) |
| Remove the whitespace char in the left and right end of the string. | |
| static DUCKDB_API string | Replace (string source, const string &from, const string &to) |
| static DUCKDB_API idx_t | LevenshteinDistance (const string &s1, const string &s2, idx_t not_equal_penalty=1) |
| static DUCKDB_API idx_t | SimilarityScore (const string &s1, const string &s2) |
| Returns the similarity score between two strings (edit distance metric - lower is more similar). | |
| static DUCKDB_API double | SimilarityRating (const string &s1, const string &s2) |
| Returns a normalized similarity rating between 0.0 - 1.0 (higher is more similar). | |
| static DUCKDB_API vector< string > | TopNStrings (vector< pair< string, double > > scores, idx_t n=5, double threshold=0.5) |
| static DUCKDB_API vector< string > | TopNStrings (const vector< pair< string, idx_t > > &scores, idx_t n=5, idx_t threshold=5) |
| static DUCKDB_API vector< string > | TopNLevenshtein (const vector< string > &strings, const string &target, idx_t n=5, idx_t threshold=5) |
| static DUCKDB_API vector< string > | TopNJaroWinkler (const vector< string > &strings, const string &target, idx_t n=5, double threshold=0.5) |
| static DUCKDB_API string | CandidatesMessage (const vector< string > &candidates, const string &candidate="Candidate bindings") |
| static DUCKDB_API string | CandidatesErrorMessage (const vector< string > &strings, const string &target, const string &message_prefix, idx_t n=5) |
| static bool | Equals (const char *s1, const char *s2) |
| static bool | Equals (const string &s1, const char *s2) |
| static bool | Equals (const char *s1, const string &s2) |
| static bool | Equals (const string &s1, const string &s2) |
| static bool | Equals (const string_t &s1, const char *s2) |
| static bool | Equals (const char *s1, const string_t &s2) |
| static DUCKDB_API unique_ptr< ComplexJSON > | ParseJSONMap (const string &json, bool ignore_errors=false) |
| static DUCKDB_API string | ExceptionToJSONMap (ExceptionType type, const string &message, const unordered_map< string, string > &map) |
| static DUCKDB_API string | ToJSONMap (const unordered_map< string, string > &map) |
| Transforms an unordered map to a JSON string. | |
| static DUCKDB_API string | ToComplexJSONMap (const ComplexJSON &complex_json) |
| Transforms an complex JSON to a JSON string. | |
| static DUCKDB_API string | ValidateJSON (const char *data, const idx_t &len) |
| static DUCKDB_API string | GetFileName (const string &file_path) |
| static DUCKDB_API string | GetFileExtension (const string &file_name) |
| static DUCKDB_API string | GetFileStem (const string &file_name) |
| static DUCKDB_API string | GetFilePath (const string &file_path) |
| static DUCKDB_API uint32_t | StringToEnum (const EnumStringLiteral enum_list[], idx_t enum_count, const char *enum_name, const char *str_value) |
| static DUCKDB_API const char * | EnumToString (const EnumStringLiteral enum_list[], idx_t enum_count, const char *enum_name, uint32_t enum_value) |
Static Public Attributes | |
| static DUCKDB_API const uint8_t | ASCII_TO_LOWER_MAP [] |
| static DUCKDB_API const uint8_t | ASCII_TO_UPPER_MAP [] |
String Utility Functions Note that these are not the most efficient implementations (i.e., they copy memory) and therefore they should only be used for debug messages and other such things.
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
Returns true if the needle string exists in the haystack.


|
static |
|
static |
|
static |
Returns true if the target string starts with the given prefix.

|
static |
Returns true if the target string ends with the given suffix.

|
static |
Repeat a string multiple times.
|
static |
Split the input string based on newline char.

|
static |
Split the input string, ignore delimiters within parentheses. Note: leading/trailing spaces are NOT stripped.
|
static |
Split the input string allong a quote. Note that any escaping is NOT supported.
|
static |
Join multiple strings into one string. Components are concatenated by the given separator.


|
static |
|
static |
Encode special URL characters in a string.

|
static |
|
static |
|
static |
Decode URL escape sequences (e.g. %20) in a string.

|
static |
|
static |
|
static |
BOM skipping (https://en.wikipedia.org/wiki/Byte_order_mark).

|
static |
|
static |
|
static |
|
inlinestatic |
|
inlinestatic |
Join multiple items of container with given size, transformed to string using function, into one string using the given separator
|
static |
Return a string that formats the give number of bytes.


|
static |
|
static |
|
static |
Convert a string to UPPERCASE.

|
static |
Convert a string to lowercase.

|
static |
Convert a string to Title Case.
|
static |
|
static |
|
static |
Case insensitive hash.


|
static |
Case insensitive equals.


|
static |
Case insensitive equals (null-terminated strings).
|
static |
Case insensitive starts-with.

|
static |
Case insensitive compare.

Case insensitive find, returns DConstants::INVALID_INDEX if not found.

|
inlinestatic |
|
static |
Split the input string into a vector of strings based on the split string.
|
static |
Remove the whitespace char in the left end of the string.

|
static |
Remove the whitespace char in the right end of the string.

|
static |
Remove the all chars from chars_to_trim char in the right end of the string.
|
static |
Remove the whitespace char in the left and right end of the string.

|
static |
|
static |
Get the levenshtein distance from two strings The not_equal_penalty is the penalty given when two characters in a string are not equal The regular levenshtein distance has a not equal penalty of 1, which means changing a character is as expensive as adding or removing one For similarity searches we often want to give extra weight to changing a character For example: with an equal penalty of 1, "pg_am" is closer to "depdelay" than "depdelay_minutes" with an equal penalty of 3, "depdelay_minutes" is closer to "depdelay" than to "pg_am"


|
static |
Returns the similarity score between two strings (edit distance metric - lower is more similar).


|
static |
Returns a normalized similarity rating between 0.0 - 1.0 (higher is more similar).


|
static |
Get the top-n strings (sorted by the given score distance) from a set of scores. The scores should be normalized between 0.0 and 1.0, where 1.0 is the highest score At least one entry is returned (if there is one). Strings are only returned if they have a score higher than the threshold.


|
static |
DEPRECATED: old TopNStrings method that uses the levenshtein distance metric instead of the normalized 0.0 - 1.0 rating

|
static |
Computes the levenshtein distance of each string in strings, and compares it to target, then returns TopNStrings with the given params.


|
static |
Computes the jaro winkler distance of each string in strings, and compares it to target, then returns TopNStrings with the given params.


|
static |
|
static |
Generate an error message in the form of "{message_prefix}: nearest_string, nearest_string2, ... Equivalent to calling TopNLevenshtein followed by CandidatesMessage


|
inlinestatic |
Returns true if two null-terminated strings are equal or point to the same address. Returns false if only one of the strings is nullptr
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
static |
|
static |
JSON method that parses a { string: value } JSON blob NOTE: this method is not efficient NOTE: this method is used in Exception construction - as such it does NOT throw on invalid JSON, instead an empty map is returned Parses complex (i.e., nested) Json maps, it also parses invalid JSONs, as a pure string.

|
static |
JSON method that constructs a { string: value } JSON map This is the inverse of ParseJSONMap NOTE: this method is not efficient
|
static |
Transforms an unordered map to a JSON string.
|
static |
Transforms an complex JSON to a JSON string.


|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |