Files
NXST/include/nxst/domain/account.hpp
T
DragonSpirit 898e127c1d
CI / Build NRO (push) Successful in 30s
CI / Format check (push) Failing after 33s
CI / Layering check (push) Successful in 1s
another stage of refactoring
2026-05-13 09:47:19 +03:00

37 lines
957 B
C++

// Copyright (C) 2024-2026 NXST contributors
#pragma once
#include <string>
#include <vector>
#include <switch.h>
// Hash and comparison support for AccountUid as map/unordered_map key.
namespace std {
template <> struct hash<AccountUid> {
size_t operator()(const AccountUid& a) const noexcept {
return (hash<u64>()(a.uid[0]) ^ (hash<u64>()(a.uid[1]) << 1)) >> 1;
}
};
} // namespace std
inline bool operator==(const AccountUid& x, const AccountUid& y) {
return x.uid[0] == y.uid[0] && x.uid[1] == y.uid[1];
}
inline bool operator<(const AccountUid& x, const AccountUid& y) {
return x.uid[0] != y.uid[0] ? x.uid[0] < y.uid[0] : x.uid[1] < y.uid[1];
}
struct User {
AccountUid id;
std::string name;
};
namespace account {
Result init();
void exit();
std::vector<AccountUid> ids();
std::string username(AccountUid id);
std::string iconPath(AccountUid id);
} // namespace account