#if !defined(__STDC_FORMAT_MACROS)
#define __STDC_FORMAT_MACROS
#endif
#include "util/misc/uuid.h"
#include <inttypes.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <string_view>
#include <type_traits>
#include "base/containers/span.h"
#include "base/numerics/byte_conversions.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_APPLE)
#include <uuid/uuid.h>
#endif
namespace crashpad {
static_assert …;
static_assert …;
static_assert …;
bool UUID::operator==(const UUID& that) const { … }
bool UUID::operator<(const UUID& that) const { … }
void UUID::InitializeToZero() { … }
void UUID::InitializeFromBytes(const uint8_t* bytes_ptr) { … }
bool UUID::InitializeFromString(std::string_view string) { … }
#if BUILDFLAG(IS_WIN)
bool UUID::InitializeFromString(std::wstring_view string) {
return InitializeFromString(base::WideToUTF8(string));
}
#endif
bool UUID::InitializeWithNew() { … }
#if BUILDFLAG(IS_WIN)
void UUID::InitializeFromSystemUUID(const ::UUID* system_uuid) {
static_assert(sizeof(::UUID) == sizeof(UUID),
"unexpected system uuid size");
static_assert(offsetof(::UUID, Data1) == offsetof(UUID, data_1),
"unexpected system uuid layout");
memcpy(this, system_uuid, sizeof(*this));
}
#endif
std::string UUID::ToString() const { … }
#if BUILDFLAG(IS_WIN)
std::wstring UUID::ToWString() const {
return base::UTF8ToWide(ToString());
}
#endif
}