include/ignition/common/Util.hh
Go to the documentation of this file.
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/ignition/common/Util.hh:325
std::string findFilePath(const std::string &_file)
search for a file in common::SystemPaths
void addSearchPathSuffix(const std::string &_suffix)
add path suffix to common::SystemPaths
std::string systemTimeISO()
Please use systemTimeIso() as this function will be deprecated in Ignition Common 4...
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 unsetenv(const std::string &_name)
Unset the environment variable '_name'.
common::SystemPaths * systemPaths()
Get a pointer to the global system paths that is used by all the findFile functions. The returned instance has global shared state for a given process. Care should be taken when manipulating global system paths Caller should not assume ownership of the pointer.
std::runtime_error exception
A runtime error.
Definition: include/ignition/common/Util.hh:108
std::string systemTimeIso()
Get the wall time as an ISO string: YYYY-MM-DDTHH:MM:SS.NS.
STL class.
bool env(const std::string &_name, std::string &_value)
Find the environment variable '_name' and return its value.
Definition: include/ignition/common/Util.hh:105
STL class.
Functions to handle getting system paths, keeps track of:
Definition: SystemPaths.hh:51
Definition: include/ignition/common/Util.hh:105
constexpr uint64_t hash64(std::string_view _key)
fnv1a algorithm for 64-bit platforms.
Definition: include/ignition/common/Util.hh:194
std::string lowercase(const std::string &_in)
Transforms a string to its lowercase equivalent.
NodeTransformType
Enumeration of the transform types.
Definition: include/ignition/common/Util.hh:105
std::string findFile(const std::string &_file)
search for file in common::SystemPaths
std::vector< std::string > split(const std::string &_str, const std::string &_delim)
Splits a string into tokens.
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.
STL class.
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...
Forward declarations for the common classes.
Definition: include/ignition/common/Util.hh:105
Definition: include/ignition/common/Util.hh:105