diff options
author | Sven Gothel <[email protected]> | 2021-10-02 15:57:58 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-10-02 15:57:58 +0200 |
commit | 55e4e3cd9ffdf6ae4d73e72e79577b549e81b24b (patch) | |
tree | 7adb39a64c932b8ce8f8a4f5a698bb29cebf2ae8 /src/uuid.cpp | |
parent | 0cfdff9453f5c98fbf5b28e530f4fae30273f745 (diff) |
Add uuid_t::getTypeSizeString()
Diffstat (limited to 'src/uuid.cpp')
-rw-r--r-- | src/uuid.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/uuid.cpp b/src/uuid.cpp index 35061ab..879ba57 100644 --- a/src/uuid.cpp +++ b/src/uuid.cpp @@ -35,6 +35,15 @@ static uint8_t bt_base_uuid_be[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }; uuid128_t jau::BT_BASE_UUID( bt_base_uuid_be, 0, false ); +std::string uuid_t::getTypeSizeString(const TypeSize v) noexcept { + switch( static_cast<TypeSize>(v) ) { + case TypeSize::UUID16_SZ: return "uuid16"; + case TypeSize::UUID32_SZ: return "uuid32"; + case TypeSize::UUID128_SZ: return "uuid128"; + default: return "uuid_t unsupported size "+std::to_string(number(v)); + } +} + uuid_t::TypeSize uuid_t::toTypeSize(const jau::nsize_t size) { switch( static_cast<TypeSize>(size) ) { case TypeSize::UUID16_SZ: return TypeSize::UUID16_SZ; |