#include "google_apis/gaia/core_account_id.h"
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/containers/to_vector.h"
#include "google_apis/gaia/gaia_auth_util.h"
namespace {
bool IsEmailString(const std::string& string) { … }
}
CoreAccountId::CoreAccountId() = default;
CoreAccountId::CoreAccountId(const CoreAccountId&) = default;
CoreAccountId::CoreAccountId(CoreAccountId&&) noexcept = default;
CoreAccountId::~CoreAccountId() = default;
CoreAccountId& CoreAccountId::operator=(const CoreAccountId&) = default;
CoreAccountId& CoreAccountId::operator=(CoreAccountId&&) noexcept = default;
CoreAccountId CoreAccountId::FromGaiaId(const std::string& gaia_id) { … }
CoreAccountId CoreAccountId::FromRobotEmail(const std::string& robot_email) { … }
#if BUILDFLAG(IS_CHROMEOS_ASH)
CoreAccountId CoreAccountId::FromEmail(const std::string& email) {
if (email.empty())
return CoreAccountId();
DCHECK(IsEmailString(email))
<< "Expected an email [actual = " << email << "]";
return CoreAccountId::FromString(email);
}
#endif
CoreAccountId CoreAccountId::FromString(const std::string& value) { … }
bool CoreAccountId::empty() const { … }
bool CoreAccountId::IsEmail() const { … }
const std::string& CoreAccountId::ToString() const { … }
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) { … }
std::vector<std::string> ToStringList(
const std::vector<CoreAccountId>& account_ids) { … }