Crashpad
Public Member Functions | Public Attributes | List of all members
crashpad::UUID Struct Reference

A universally unique identifier (UUID). More...

#include "util/misc/uuid.h"

Public Member Functions

bool operator== (const UUID &that) const
 
bool operator!= (const UUID &that) const
 
void InitializeToZero ()
 Initializes the UUID to zero.
 
void InitializeFromBytes (const uint8_t *bytes)
 Initializes the UUID from a sequence of bytes. More...
 
bool InitializeFromString (const base::StringPiece &string)
 Initializes the UUID from a RFC 4122 §3 formatted string. More...
 
bool InitializeFromString (const base::StringPiece16 &string)
 
bool InitializeWithNew ()
 Initializes the UUID using a standard system facility to generate the value. More...
 
void InitializeFromSystemUUID (const ::UUID *system_uuid)
 Initializes the UUID from a system UUID or GUID structure. More...
 
std::string ToString () const
 Formats the UUID per RFC 4122 §3. More...
 
base::string16 ToString16 () const
 The same as ToString, but returned as a string16.
 

Public Attributes

uint32_t data_1
 
uint16_t data_2
 
uint16_t data_3
 
uint8_t data_4 [2]
 
uint8_t data_5 [6]
 

Detailed Description

A universally unique identifier (UUID).

An alternate term for UUID is “globally unique identifier” (GUID), used primarily by Microsoft.

A UUID is a unique 128-bit number specified by RFC 4122.

This is a POD structure.

Member Function Documentation

◆ InitializeFromBytes()

void crashpad::UUID::InitializeFromBytes ( const uint8_t *  bytes)

Initializes the UUID from a sequence of bytes.

bytes is taken as a UUID laid out in big-endian format in memory. On little-endian machines, appropriate byte-swapping will be performed to initialize an object’s data members.

Parameters
[in]bytesA buffer of exactly 16 bytes that will be assigned to the UUID.

◆ InitializeFromString()

bool crashpad::UUID::InitializeFromString ( const base::StringPiece &  string)

Initializes the UUID from a RFC 4122 §3 formatted string.

Parameters
[in]stringA string of the form "00112233-4455-6677-8899-aabbccddeeff".
Returns
true if the string was formatted correctly and the object has been initialized with the data. false if the string could not be parsed, with the object state untouched.

◆ InitializeFromSystemUUID()

void crashpad::UUID::InitializeFromSystemUUID ( const ::UUID system_uuid)

Initializes the UUID from a system UUID or GUID structure.

Parameters
[in]system_uuidA system UUID or GUID structure.

◆ InitializeWithNew()

bool crashpad::UUID::InitializeWithNew ( )

Initializes the UUID using a standard system facility to generate the value.

Returns
true if the UUID was initialized correctly, false otherwise with a message logged.

◆ ToString()

std::string crashpad::UUID::ToString ( ) const

Formats the UUID per RFC 4122 §3.

Returns
A string of the form "00112233-4455-6677-8899-aabbccddeeff".

The documentation for this struct was generated from the following files: