mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-03-26 05:50:22 +00:00
Revamp uuid code
This commit is contained in:
@@ -46,13 +46,11 @@ class BitConverter {
|
||||
static uint32_t ToUint32LE(uint8_t& b);
|
||||
static uint16_t ToUint16LE(uint8_t& b);
|
||||
|
||||
static Uuid ToUuidBE(uint8_t& b);
|
||||
static Uuid ToUuid(uint8_t& b);
|
||||
|
||||
static Uuid ToUuidMS(uint8_t& b);
|
||||
|
||||
static void ToUuidBE(uint8_t& b, Uuid& uuid);
|
||||
static void ToUuid(uint8_t& b, Uuid& uuid);
|
||||
|
||||
static void ToUuidMS(uint8_t& b, Uuid& uuid);
|
||||
|
||||
static void FromDoubleBE(uint8_t& b, double v);
|
||||
static void FromUint64BE(uint8_t& b, uint64_t v);
|
||||
@@ -63,9 +61,8 @@ class BitConverter {
|
||||
static void FromUint32LE(uint8_t& b, uint32_t v);
|
||||
static void FromUint16LE(uint8_t& b, uint16_t v);
|
||||
|
||||
static void FromUuidBE(uint8_t& b, const Uuid& uuid);
|
||||
static void FromUuid(uint8_t& b, const Uuid& uuid);
|
||||
|
||||
static void FromUuidMS(uint8_t& b, const Uuid& uuid);
|
||||
|
||||
|
||||
static inline bool IsLittleEndian()
|
||||
|
||||
@@ -27,9 +27,7 @@ namespace Tesses::Framework::Streams
|
||||
float ReadF32LE();
|
||||
double ReadF64BE();
|
||||
double ReadF64LE();
|
||||
Uuid ReadUuidBE();
|
||||
Uuid ReadUuidMS();
|
||||
void ReadUuidBE(Uuid& uuid);
|
||||
void ReadUuidMS(Uuid& uuid);
|
||||
Uuid ReadUuid();
|
||||
void ReadUuid(Uuid& uuid);
|
||||
};
|
||||
}
|
||||
@@ -27,7 +27,6 @@ namespace Tesses::Framework::Streams
|
||||
void WriteF32LE(float v);
|
||||
void WriteF64BE(double v);
|
||||
void WriteF64LE(double v);
|
||||
void WriteUuidBE(const Uuid& uuid);
|
||||
void WriteUuidMS(const Uuid& uuid);
|
||||
void WriteUuid(const Uuid& uuid);
|
||||
};
|
||||
}
|
||||
@@ -27,6 +27,11 @@ namespace Tesses::Framework {
|
||||
|
||||
static bool TryParse(std::string text, Uuid& uuid);
|
||||
|
||||
std::string ToString(UuidStringifyConfig cfg = UuidStringifyConfig::UppercaseCurly);
|
||||
std::string ToString(UuidStringifyConfig cfg = UuidStringifyConfig::UppercaseCurly) const;
|
||||
|
||||
bool IsEmpty() const;
|
||||
};
|
||||
|
||||
bool operator==(const Uuid& left, const Uuid& right);
|
||||
bool operator!=(const Uuid& left, const Uuid& right);
|
||||
}
|
||||
Reference in New Issue
Block a user