24#ifndef UUID_H_INCLUDED
25#define UUID_H_INCLUDED 1
87 static bool is_valid(
const char *
string,
size_t len);
102 int parse(
const char *
string,
size_t len);
117 const unsigned char *out_binary_string);
134 static bool read_section(
int section_len,
const char **section_str,
135 const unsigned char **out_binary_str);
148 static size_t to_string(
const unsigned char *bytes_arg,
char *
buf);
170 return std::hash<std::string>()(
Definition: item_cmpfunc.h:1644
The namespace contains classes representing events that can occur in a replication stream.
bool operator==(const Uuid &a, const Uuid &b)
Definition: uuid.h:175
Definition: buf0block_hint.cc:30
size_t operator()(const Uuid &uuid) const
Definition: uuid.h:169
This is a POD.
Definition: uuid.h:61
static bool read_section(int section_len, const char **section_str, const unsigned char **out_binary_str)
Helper method used to validate and parse one section of a uuid.
Definition: uuid.cpp:90
unsigned char bytes[BYTE_LENGTH]
The data for this Uuid.
Definition: uuid.h:139
void copy_from(const unsigned char *data)
Copies the given 16-byte data to this UUID.
Definition: uuid.h:65
static const int NUMBER_OF_SECTIONS
Definition: uuid.h:163
static const size_t BIT_LENGTH
The number of bits in the data of a Uuid.
Definition: uuid.h:162
void copy_from(const Uuid &data)
Copies the given UUID object to this UUID.
Definition: uuid.h:69
static const size_t BYTE_LENGTH
The number of bytes in the data of a Uuid.
Definition: uuid.h:137
int parse(const char *string, size_t len)
Stores the UUID represented by a string of the form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX or XXXXXXXXX...
Definition: uuid.cpp:53
bool equals(const Uuid &other) const
Returns true if this UUID is equal the given UUID.
Definition: uuid.h:75
void print() const
Definition: uuid.h:154
static const size_t TEXT_LENGTH
The number of bytes in the textual representation of a Uuid.
Definition: uuid.h:160
static const int bytes_per_section[NUMBER_OF_SECTIONS]
Definition: uuid.h:164
static const int hex_to_byte[256]
Definition: uuid.h:165
static bool is_valid(const char *string, size_t len)
Returns true if parse() would succeed, but doesn't store the result.
Definition: uuid.cpp:110
void copy_to(unsigned char *data) const
Copies the given UUID object to this UUID.
Definition: uuid.h:73
void clear()
Set to all zeros.
Definition: uuid.h:63
std::string to_string() const
Definition: uuid.h:149