#ifndef BABELTRACE_CPP_COMMON_UUID_VIEW_HPP
#define BABELTRACE_CPP_COMMON_UUID_VIEW_HPP
+#include <array>
#include <cstdint>
+#include <string>
#include "common/assert.h"
#include "common/uuid.h"
return !(*this == other);
}
- std::string string() const
+ bool operator<(const UuidView& other) const noexcept
+ {
+ return bt_uuid_compare(_mUuid, other._mUuid) < 0;
+ }
+
+ std::string str() const
{
std::string s;
s.resize(BT_UUID_STR_LEN);
- bt_uuid_to_str(_mUuid, s.data());
+ bt_uuid_to_str(_mUuid, &s[0]);
return s;
}
- static std::size_t size() noexcept
+ static constexpr std::size_t size() noexcept
{
return BT_UUID_LEN;
}