mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:07:36 +00:00
AK+Kernel: Implement UUID mixed endianness support
This is being used by GUID partitions so the first three dash-delimited fields of the GUID are stored in little endian order but the last two fields are stored in big endian order, hence it's a representation which is mixed.
This commit is contained in:
parent
2d67d141e6
commit
308e54bc19
3 changed files with 47 additions and 6 deletions
10
AK/UUID.h
10
AK/UUID.h
|
@ -15,9 +15,14 @@ namespace AK {
|
|||
|
||||
class UUID {
|
||||
public:
|
||||
enum class Endianness {
|
||||
Mixed,
|
||||
Little
|
||||
};
|
||||
|
||||
UUID() = default;
|
||||
UUID(Array<u8, 16> uuid_buffer);
|
||||
UUID(StringView);
|
||||
UUID(StringView, Endianness endianness = Endianness::Little);
|
||||
~UUID() = default;
|
||||
|
||||
bool operator==(const UUID&) const;
|
||||
|
@ -31,7 +36,8 @@ public:
|
|||
bool is_zero() const;
|
||||
|
||||
private:
|
||||
void convert_string_view_to_uuid(StringView);
|
||||
void convert_string_view_to_little_endian_uuid(StringView);
|
||||
void convert_string_view_to_mixed_endian_uuid(StringView);
|
||||
|
||||
Array<u8, 16> m_uuid_buffer {};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue