18 #ifndef _COMMONIFACE_HH_
19 #define _COMMONIFACE_HH_
23 #include <boost/uuid/sha1.hpp>
49 std::string
find_file(
const std::string &_file);
57 std::string
find_file(
const std::string &_file,
58 bool _searchLocalPath);
72 std::string
get_sha1(
const T &_buffer);
83 boost::uuids::detail::sha1 sha1;
85 std::stringstream stream;
87 if (_buffer.size() == 0)
89 sha1.process_bytes(
NULL, 0);
93 sha1.process_bytes(&(_buffer[0]), _buffer.size() *
sizeof(_buffer[0]));
96 sha1.get_digest(hash);
98 for (std::size_t i = 0; i <
sizeof(hash) /
sizeof(hash[0]); ++i)
100 stream << std::setfill(
'0')
101 << std::setw(
sizeof(hash[0]) * 2)
GAZEBO_VISIBLE void add_search_path_suffix(const std::string &_suffix)
add path sufix to common::SystemPaths
GAZEBO_VISIBLE std::string find_file(const std::string &_file)
search for file in common::SystemPaths
GAZEBO_VISIBLE std::string find_file_path(const std::string &_file)
search for a file in common::SystemPaths
GAZEBO_VISIBLE void load()
Load the common library.
#define NULL
Definition: CommonTypes.hh:30
GAZEBO_VISIBLE std::string get_sha1(const T &_buffer)
Compute the SHA1 hash of an array of bytes.
Definition: CommonIface.hh:81
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48