chromium/third_party/crashpad/crashpad/util/misc/uuid.cc

// Copyright 2014 The Crashpad Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#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  // BUILDFLAG(IS_APPLE)

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  // BUILDFLAG(IS_WIN)

std::string UUID::ToString() const {}

#if BUILDFLAG(IS_WIN)
std::wstring UUID::ToWString() const {
  return base::UTF8ToWide(ToString());
}
#endif  // BUILDFLAG(IS_WIN)

}  // namespace crashpad