|
std::string | clanguml::util::ltrim (const std::string &s) |
| Left trim a string.
|
|
std::string | clanguml::util::rtrim (const std::string &s) |
| Right trim a string.
|
|
std::string | clanguml::util::trim (const std::string &s) |
| Trim a string.
|
|
std::string | clanguml::util::trim_typename (const std::string &s) |
| Remove typename prefix from a string if exists.
|
|
std::string | clanguml::util::get_process_output (const std::string &command) |
| Execute a shell command and return console output as string.
|
|
void | clanguml::util::check_process_output (const std::string &command) |
| Execute command shell and throw exception if command fails.
|
|
std::string | clanguml::util::get_env (const std::string &name) |
| Get value of an environment variable.
|
|
bool | clanguml::util::is_git_repository () |
| Check if $PWD is in a Git repository.
|
|
std::string | clanguml::util::get_git_branch () |
| Get current Git branch.
|
|
std::string | clanguml::util::get_git_revision () |
| Get current Git revision.
|
|
std::string | clanguml::util::get_git_commit () |
| Get current Git commit.
|
|
std::string | clanguml::util::get_git_toplevel_dir () |
| Get path to the top level Git directory.
|
|
std::string | clanguml::util::get_os_name () |
| Get descriptive name of the current operating system.
|
|
template<typename T , typename S > |
std::unique_ptr< T > | clanguml::util::unique_pointer_cast (std::unique_ptr< S > &&p) noexcept |
|
std::optional< std::pair< std::string, std::string > > | clanguml::util::split_at_first (const std::string &separator, const std::string &input) |
| Split string at first occurence of separator.
|
|
std::vector< std::string > | clanguml::util::split (std::string str, std::string_view delimiter, bool skip_empty=true) |
| Split a string using delimiter.
|
|
std::vector< std::string > | clanguml::util::split_isspace (std::string str) |
|
template<typename T , typename F > |
void | clanguml::util::erase_if (std::vector< T > &v, F &&f) |
| Remove and erase elements from a vector.
|
|
std::string | clanguml::util::join (const std::vector< std::string > &toks, std::string_view delimiter) |
| Join toks into string using delimiter as separator.
|
|
template<typename... Args> |
std::string | clanguml::util::join (std::string_view delimiter, Args... args) |
| Join args into string using delimiter as separator.
|
|
std::string | clanguml::util::abbreviate (const std::string &s, unsigned int max_length) |
| Abbreviate string to max_length, and replace last 3 characters with ellipsis.
|
|
bool | clanguml::util::find_element_alias (const std::string &input, std::tuple< std::string, size_t, size_t > &result) |
| Find element alias in Puml note.
|
|
bool | clanguml::util::replace_all (std::string &input, const std::string &pattern, const std::string &replace_with) |
| Find and replace in string.
|
|
template<typename T > |
void | clanguml::util::append (std::vector< T > &l, const std::vector< T > &r) |
| Appends a vector to a vector.
|
|
template<typename T > |
bool | clanguml::util::starts_with (const T &col, const T &prefix) |
| Checks if collection starts with a prefix.
|
|
template<> |
bool | clanguml::util::starts_with (const std::string &s, const std::string &prefix) |
|
template<typename T > |
bool | clanguml::util::ends_with (const T &value, const T &suffix) |
|
template<> |
bool | clanguml::util::ends_with (const std::string &value, const std::string &suffix) |
|
template<typename T > |
bool | clanguml::util::ends_with (const std::vector< T > &col, const std::vector< T > &suffix) |
|
template<typename T > |
void | clanguml::util::remove_prefix (std::vector< T > &col, const std::vector< T > &prefix) |
| Removes prefix sequence of elements from the beginning of col.
|
|
template<typename T , typename E > |
bool | clanguml::util::contains (const T &container, const E &element) |
|
template<typename T , typename F > |
void | clanguml::util::for_each (const T &collection, F &&func) |
|
template<typename R , typename T , typename F > |
std::vector< R > | clanguml::util::map (const std::vector< T > &in, F &&f) |
|
template<typename T , typename F , typename FElse > |
void | clanguml::util::if_not_null (const T *pointer, F &&func, FElse &&func_else) |
|
template<typename T , typename F > |
void | clanguml::util::if_not_null (const T *pointer, F &&func) |
|
template<typename F , typename FElse > |
void | clanguml::util::_if (const bool condition, F &&func, FElse &&func_else) |
|
template<typename F > |
void | clanguml::util::_if (const bool condition, F &&func) |
|
template<typename T > |
void | clanguml::util::remove_duplicates (T &coll) |
|
std::size_t | clanguml::util::hash_seed (std::size_t seed) |
| Generate a hash seed.
|
|
std::string | clanguml::util::path_to_url (const std::filesystem::path &p) |
| Convert filesystem path to url path.
|
|
std::filesystem::path | clanguml::util::ensure_path_is_absolute (const std::filesystem::path &p, const std::filesystem::path &root=std::filesystem::current_path()) |
| Ensure path is absolute.
|
|
bool | clanguml::util::is_relative_to (const std::filesystem::path &parent, const std::filesystem::path &child) |
| Check if a given path is relative to another path.
|
|
std::string | clanguml::util::format_message_comment (const std::string &comment, unsigned width) |
|
std::optional< std::pair< std::string, std::string > > | clanguml::util::find_entry_by_path_prefix (const std::map< std::string, std::string > &m, const std::string &path) |
|