DarkflameServer/dGame/dUtilities/GUID.cpp

28 lines
576 B
C++
Raw Normal View History

#include "GUID.h"
2022-07-28 13:39:57 +00:00
GUID::GUID(const std::string& guid) {
sscanf(guid.c_str(),
"{%8x-%4hx-%4hx-%2hhx%2hhx-%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx}",
&this->data1, &this->data2, &this->data3,
&this->data4[0], &this->data4[1], &this->data4[2], &this->data4[3],
&this->data4[4], &this->data4[5], &this->data4[6], &this->data4[7]);
}
uint32_t GUID::GetData1() const {
2022-07-28 13:39:57 +00:00
return data1;
}
uint16_t GUID::GetData2() const {
2022-07-28 13:39:57 +00:00
return data2;
}
uint16_t GUID::GetData3() const {
2022-07-28 13:39:57 +00:00
return data3;
}
std::array<uint8_t, 8> GUID::GetData4() const {
2022-07-28 13:39:57 +00:00
return data4;
}
GUID::GUID() = default;