include/gz/common/Util.hh
Go to the documentation of this file.
Functions to handle getting system paths, keeps track of:
Definition: gz/common/SystemPaths.hh:53
A complete URI which has the following components:
Definition: gz/common/URI.hh:408
common::SystemPaths * systemPaths()
Get a pointer to the global system paths that is used by all the findFile functions....
std::string lowercase(const std::string &_in)
Transforms a string to its lowercase equivalent.
bool env(const std::string &_name, std::string &_value)
Find the environment variable '_name' and return its value.
void addFindFileURICallback(std::function< std::string(const URI &)> _cb)
Add a callback to use when findFile() can't find a file that is a valid URI. The callback should retu...
std::vector< std::string > split(const std::string &_str, const std::string &_delim)
Splits a string into tokens.
std::runtime_error exception
A runtime error.
Definition: include/gz/common/Util.hh:109
std::string timeToIso(const std::chrono::time_point< std::chrono::system_clock > &_time)
Converts a time point to an ISO string: YYYY-MM-DDTHH:MM:SS.NS.
std::string findFilePath(const std::string &_file)
search for a file in common::SystemPaths
NodeTransformType
Enumeration of the transform types.
Definition: include/gz/common/Util.hh:106
void addSearchPathSuffix(const std::string &_suffix)
add path suffix to common::SystemPaths
bool unsetenv(const std::string &_name)
Unset the environment variable '_name'.
constexpr uint64_t hash64(std::string_view _key)
fnv1a algorithm for 64-bit platforms.
Definition: include/gz/common/Util.hh:195
void replaceAll(std::string &_result, const std::string &_orig, const std::string &_key, const std::string &_replacement)
Replace all occurances of _key with _replacement.
bool setenv(const std::string &_name, const std::string &_value)
Set the environment variable '_name'.
std::string sha1(const T &_buffer)
Compute the SHA1 hash of an array of bytes.
Definition: include/gz/common/Util.hh:326
std::string findFile(const std::string &_file)
search for file in common::SystemPaths
std::string systemTimeIso()
Get the wall time as an ISO string: YYYY-MM-DDTHH:MM:SS.NS.
std::string systemTimeISO()
Please use systemTimeIso() as this function will be deprecated in Ignition Common 4....
Forward declarations for the common classes.