mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-03-26 09:13:10 +00:00
Revamp uuid code
This commit is contained in:
@@ -151,32 +151,19 @@ namespace Tesses::Framework::Streams
|
||||
return *(double*)&v;
|
||||
}
|
||||
|
||||
Uuid ByteReader::ReadUuidBE()
|
||||
Uuid ByteReader::ReadUuid()
|
||||
{
|
||||
uint8_t data[16];
|
||||
if(this->strm->ReadBlock(data, 16) != 16)
|
||||
throw std::runtime_error("End of file");
|
||||
return Serialization::BitConverter::ToUuidBE(data[0]);
|
||||
return Serialization::BitConverter::ToUuid(data[0]);
|
||||
}
|
||||
Uuid ByteReader::ReadUuidMS()
|
||||
void ByteReader::ReadUuid(Uuid& uuid)
|
||||
{
|
||||
uint8_t data[16];
|
||||
if(this->strm->ReadBlock(data, 16) != 16)
|
||||
throw std::runtime_error("End of file");
|
||||
return Serialization::BitConverter::ToUuidMS(data[0]);
|
||||
}
|
||||
void ByteReader::ReadUuidBE(Uuid& uuid)
|
||||
{
|
||||
uint8_t data[16];
|
||||
if(this->strm->ReadBlock(data, 16) != 16)
|
||||
throw std::runtime_error("End of file");
|
||||
Serialization::BitConverter::ToUuidBE(data[0],uuid);
|
||||
}
|
||||
void ByteReader::ReadUuidMS(Uuid& uuid)
|
||||
{
|
||||
uint8_t data[16];
|
||||
if(this->strm->ReadBlock(data, 16) != 16)
|
||||
throw std::runtime_error("End of file");
|
||||
Serialization::BitConverter::ToUuidMS(data[0],uuid);
|
||||
Serialization::BitConverter::ToUuid(data[0],uuid);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user