|
supereight
|
Functions | |
| bool | begins_with (const std::string &s, const std::string &prefix) |
| Verify if a string starts with a given prefix. More... | |
| bool | ends_with (const std::string &s, const std::string &suffix) |
| Verify if a string starts with a given prefix. More... | |
| bool | is_int (const std::string &s, const bool accept_negative=true) |
| Verify if a string is a integer. More... | |
| bool | is_float (const std::string &s, const bool accept_negative=true) |
| Verify if a string is a float. More... | |
| void | remove_prefix (std::string &s, const std::string &prefix) |
| Remove a given prefix from a string. More... | |
| void | remove_suffix (std::string &s, const std::string &suffix) |
| Remove a given suffix from a string. More... | |
| std::vector< std::string > | split_str (const std::string &s, const char delim, const bool ignore_consec=false) |
| Split a string into a vector of substrings based on a delimiter. More... | |
| void | to_lower (std::string &s) |
| Convert a string to all lower case characters. More... | |
| void | to_upper (std::string &s) |
| Convert a string to all upper case characters. More... | |
| template<typename EigenMatrixT > | |
| std::string | eigen_matrix_to_pretty_str (const EigenMatrixT &M, const std::string &M_name="", const int width=default_width) |
| Convert a matrix name and Eigen::Matrix value to a standardised string output. More... | |
| template<typename EigenVectorT > | |
| std::string | eigen_vector_to_pretty_str (const EigenVectorT &v, const std::string &v_name="", const std::vector< std::string > &e_names={}, const int width=default_width) |
| Convert a matrix name and Eigen::Vector value to a standardised string output. More... | |
| template<typename T > | |
| std::string | vector_to_pretty_str (const std::vector< T > &v, const std::string &v_name="", const int width=default_width) |
| Convert a matrix name and Eigen::Vector value to a standardised string output. More... | |
| template<typename EigenVector3T > | |
| std::string | volume_to_pretty_str (const EigenVector3T &vol, const std::string &vol_name="", const int width=default_width) |
| Convert a volume name and value to a standardised string output (values seperated by 'x'). More... | |
| std::string | bool_to_pretty_str (const bool state, const std::string &state_name="", const int width=default_width) |
| Convert a bool name and value to a standardised string output. More... | |
| std::string | str_to_pretty_str (const std::string &string, const std::string &string_name="", const int width=default_width) |
| Convert a string name and value to a standardised string output. More... | |
| template<typename ValueT > | |
| std::string | value_to_pretty_str (const ValueT &val, const std::string &val_name="", const std::string &val_unit="", const int width=default_width) |
| Convert a matrix name, value and unit to a standardised string output. More... | |
| std::string | header_to_pretty_str (const std::string &header_name, const int width=default_width) |
| Convert header name to a standardised string output. More... | |
| std::string | expand_user (const std::string &path) |
| Return the result of expanding a leading ~ in path. More... | |
| std::string | resolve_relative_path (const std::string &relative_path, const std::string &base_dir) |
| Return the path resulting by resolving relative_path relative to the directory base_dir. More... | |
Variables | |
| static constexpr int | default_width = 33 |
| bool se::str_utils::begins_with | ( | const std::string & | s, |
| const std::string & | prefix | ||
| ) |
Verify if a string starts with a given prefix.
| [in] | s | The full string |
| [in] | prefix | The prefix to be evaluated |
| bool se::str_utils::ends_with | ( | const std::string & | s, |
| const std::string & | suffix | ||
| ) |
Verify if a string starts with a given prefix.
| [in] | s | The full string |
| [in] | suffix | The prefix to be evaluated |
| bool se::str_utils::is_int | ( | const std::string & | s, |
| const bool | accept_negative = true |
||
| ) |
Verify if a string is a integer.
| [in] | s | The string to be evaluated |
| [in] | accept_negative | Accept negative integers |
| bool se::str_utils::is_float | ( | const std::string & | s, |
| const bool | accept_negative = true |
||
| ) |
Verify if a string is a float.
| [in] | s | The string to be evaluated |
| [in] | accept_negative | Accept negative floats |
| void se::str_utils::remove_prefix | ( | std::string & | s, |
| const std::string & | prefix | ||
| ) |
Remove a given prefix from a string.
| [in,out] | s | The full string |
| [in] | prefix | The prefix to be removed from the string |
| void se::str_utils::remove_suffix | ( | std::string & | s, |
| const std::string & | suffix | ||
| ) |
Remove a given suffix from a string.
| [in,out] | s | The full string |
| [in] | suffix | The suffix to be removed from the string |
| std::vector<std::string> se::str_utils::split_str | ( | const std::string & | s, |
| const char | delim, | ||
| const bool | ignore_consec = false |
||
| ) |
Split a string into a vector of substrings based on a delimiter.
| [in] | s | The string to split. |
| [in] | delim | The delimiter to use. |
| [in] | ignore_consec | Treat consecutive delimiters as a single delimiter. |
| void se::str_utils::to_lower | ( | std::string & | s | ) |
Convert a string to all lower case characters.
| [in,out] | s | The string to be converted |
| void se::str_utils::to_upper | ( | std::string & | s | ) |
Convert a string to all upper case characters.
| [in,out] | s | The string to be converted |
| std::string se::str_utils::eigen_matrix_to_pretty_str | ( | const EigenMatrixT & | M, |
| const std::string & | M_name = "", |
||
| const int | width = default_width |
||
| ) |
Convert a matrix name and Eigen::Matrix value to a standardised string output.
| MatrixT |
| [in] | M | The Eigen::Matrix |
| [in] | M_name | The displayed name of the matrix |
| [in] | width | The starting position of the value in the string (default = default_width) |
| std::string se::str_utils::eigen_vector_to_pretty_str | ( | const EigenVectorT & | v, |
| const std::string & | v_name = "", |
||
| const std::vector< std::string > & | e_names = {}, |
||
| const int | width = default_width |
||
| ) |
Convert a matrix name and Eigen::Vector value to a standardised string output.
| VectorT |
| [in] | v | The Eigen::Vector |
| [in] | v_name | The displayed name of the vector |
| [in] | e_name | The displayed name of vector elements |
| [in] | width | The starting position of the value in the string (default = default_width) |
| std::string se::str_utils::vector_to_pretty_str | ( | const std::vector< T > & | v, |
| const std::string & | v_name = "", |
||
| const int | width = default_width |
||
| ) |
Convert a matrix name and Eigen::Vector value to a standardised string output.
| T | vector type |
| [in] | v | The standard vector |
| [in] | v_name | The displayed name of the vector |
| [in] | width | The starting position of the value in the string (default = default_width) |
| std::string se::str_utils::volume_to_pretty_str | ( | const EigenVector3T & | vol, |
| const std::string & | vol_name = "", |
||
| const int | width = default_width |
||
| ) |
Convert a volume name and value to a standardised string output (values seperated by 'x').
| MatrixT |
| [in] | vol | The volume |
| [in] | vol_name | The displayed name of the volume |
| [in] | vol_unit | The displayed unit of the volume |
| [in] | width | The starting position of the value in the string (default = default_width) |
| std::string se::str_utils::bool_to_pretty_str | ( | const bool | state, |
| const std::string & | state_name = "", |
||
| const int | width = default_width |
||
| ) |
Convert a bool name and value to a standardised string output.
| [in] | state | The bool |
| [in] | state_name | The displayed name of the bool |
| [in] | width | The starting position of the value in the string (default = default_width) |
| std::string se::str_utils::str_to_pretty_str | ( | const std::string & | string, |
| const std::string & | string_name = "", |
||
| const int | width = default_width |
||
| ) |
Convert a string name and value to a standardised string output.
| [in] | string | The string |
| [in] | string_name | The displayed name of the string |
| [in] | width | The starting position of the value in the string (default = default_width) |
| std::string se::str_utils::value_to_pretty_str | ( | const ValueT & | val, |
| const std::string & | val_name = "", |
||
| const std::string & | val_unit = "", |
||
| const int | width = default_width |
||
| ) |
Convert a matrix name, value and unit to a standardised string output.
| ValueT |
| [in] | val | The value |
| [in] | val_name | The displayed name of the value |
| [in] | val_unit | The displayed unit of the value |
| [in] | width | The starting position of the value in the string (default = default_width) |
| std::string se::str_utils::header_to_pretty_str | ( | const std::string & | header_name, |
| const int | width = default_width |
||
| ) |
Convert header name to a standardised string output.
| [in] | header_name | The header |
| [in] | width | The starting position of the value in the string (default = default_width) |
| std::string se::str_utils::expand_user | ( | const std::string & | path | ) |
Return the result of expanding a leading ~ in path.
| std::string se::str_utils::resolve_relative_path | ( | const std::string & | relative_path, |
| const std::string & | base_dir | ||
| ) |
Return the path resulting by resolving relative_path relative to the directory base_dir.
If relative_path is an absolute path it is returned as-is.
|
static |
1.8.13