blob: 5ea602aba2cf8da2c871d4aba63a0ea7f93d9718 [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <ostream>
#include <string>
// Represent the id of an account for interaction with GAIA. It is
// currently implicitly convertible to and from std::string to allow
// progressive migration of the code (see
// for design and tracking).
struct CoreAccountId {
// Those implicit constructor and conversion operator allow to
// progressively migrate the code to use this struct. Removing
// them is tracked by
CoreAccountId(const char* id);
CoreAccountId(std::string&& id);
CoreAccountId(const std::string& id);
operator std::string() const;
// Checks if the account is valid or not.
// TODO(triploblastic): Possibly rename of remove this after
// refactoring.
bool empty() const;
std::string id;
bool operator<(const CoreAccountId& lhs, const CoreAccountId& rhs);
bool operator==(const CoreAccountId& lhs, const CoreAccountId& rhs);
bool operator!=(const CoreAccountId& lhs, const CoreAccountId& rhs);
std::ostream& operator<<(std::ostream& out, const CoreAccountId& a);