summaryrefslogtreecommitdiffstats
path: root/include/jau
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-10-02 15:57:58 +0200
committerSven Gothel <[email protected]>2021-10-02 15:57:58 +0200
commit55e4e3cd9ffdf6ae4d73e72e79577b549e81b24b (patch)
tree7adb39a64c932b8ce8f8a4f5a698bb29cebf2ae8 /include/jau
parent0cfdff9453f5c98fbf5b28e530f4fae30273f745 (diff)
Add uuid_t::getTypeSizeString()
Diffstat (limited to 'include/jau')
-rw-r--r--include/jau/uuid.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/jau/uuid.hpp b/include/jau/uuid.hpp
index 6459617..5dd4d52 100644
--- a/include/jau/uuid.hpp
+++ b/include/jau/uuid.hpp
@@ -58,6 +58,7 @@ public:
static constexpr jau::nsize_t number(const TypeSize rhs) noexcept {
return static_cast<jau::nsize_t>(rhs);
}
+ static std::string getTypeSizeString(const TypeSize v) noexcept;
private:
TypeSize type;
@@ -90,6 +91,7 @@ public:
TypeSize getTypeSize() const noexcept { return type; }
jau::nsize_t getTypeSizeInt() const noexcept { return uuid_t::number(type); }
+ std::string getTypeSizeString() const noexcept { return getTypeSizeString(type); }
uuid128_t toUUID128(uuid128_t const & base_uuid=BT_BASE_UUID, jau::nsize_t const uuid32_le_octet_index=12) const noexcept;
@@ -100,6 +102,10 @@ public:
virtual jau::nsize_t put(uint8_t * const buffer, jau::nsize_t const byte_offset, bool const littleEndian) const noexcept = 0;
};
+inline std::string to_string(const uuid_t::TypeSize v) noexcept {
+ return uuid_t::getTypeSizeString(v);
+}
+
class uuid16_t : public uuid_t {
public:
uint16_t value;