Some checks failed
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Has been cancelled
Reviewed-on: #1 Co-authored-by: Romain BOULLARD <romain.boullard@protonmail.com> Co-committed-by: Romain BOULLARD <romain.boullard@protonmail.com>
28 lines
1.1 KiB
C++
28 lines
1.1 KiB
C++
/*********************************************************************
|
|
* \file FlatUUID.cpp
|
|
*
|
|
* \author Romain BOULLARD
|
|
* \date December 2025
|
|
*********************************************************************/
|
|
#include <System/UUID/FlatUUID.hpp>
|
|
|
|
namespace flatbuffers
|
|
{
|
|
Bigfoot::Flat::UUID Pack(const Bigfoot::UUID& p_uuid)
|
|
{
|
|
const std::span<const std::byte, Bigfoot::UUID::UUID_BYTE_SIZE> bytes = p_uuid;
|
|
return Bigfoot::Flat::UUID {
|
|
std::span<const std::uint8_t, Bigfoot::UUID::UUID_BYTE_SIZE> {reinterpret_cast<const std::uint8_t*>(bytes.data()),
|
|
bytes.size()}};
|
|
}
|
|
|
|
/****************************************************************************************/
|
|
|
|
Bigfoot::UUID UnPack(const Bigfoot::Flat::UUID& p_flatUUID)
|
|
{
|
|
const std::span<const std::uint8_t, Bigfoot::UUID::UUID_BYTE_SIZE> bytesView {p_flatUUID.bytes()->data(),
|
|
p_flatUUID.bytes()->size()};
|
|
return Bigfoot::UUID {std::as_bytes(bytesView)};
|
|
}
|
|
} // namespace flatbuffers
|