This commit is contained in:
Aria 2025-03-21 22:23:30 +11:00
commit 9c94d113d3
Signed by untrusted user who does not match committer: aria
GPG key ID: 19AB7AA462B8AB3B
10260 changed files with 1237388 additions and 0 deletions

44
source/core/StarUuid.hpp Normal file
View file

@ -0,0 +1,44 @@
#ifndef STAR_UUID_HPP
#define STAR_UUID_HPP
#include "StarArray.hpp"
#include "StarDataStream.hpp"
namespace Star {
STAR_EXCEPTION(UuidException, StarException);
size_t const UuidSize = 16;
class Uuid {
public:
Uuid();
explicit Uuid(ByteArray const& bytes);
explicit Uuid(String const& hex);
char const* ptr() const;
ByteArray bytes() const;
String hex() const;
bool operator==(Uuid const& u) const;
bool operator!=(Uuid const& u) const;
bool operator<(Uuid const& u) const;
bool operator<=(Uuid const& u) const;
bool operator>(Uuid const& u) const;
bool operator>=(Uuid const& u) const;
private:
Array<char, UuidSize> m_data;
};
template <>
struct hash<Uuid> {
size_t operator()(Uuid const& u) const;
};
DataStream& operator>>(DataStream& ds, Uuid& uuid);
DataStream& operator<<(DataStream& ds, Uuid const& uuid);
}
#endif