2016-09-18 20:50:08 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
2017-04-03 15:02:45 -07:00
|
|
|
struct Triplet
|
2016-09-18 20:50:08 -07:00
|
|
|
{
|
2017-04-03 15:02:45 -07:00
|
|
|
static Triplet from_canonical_name(const std::string& triplet_as_string);
|
2016-10-03 17:20:52 -07:00
|
|
|
|
2017-04-03 15:02:45 -07:00
|
|
|
static const Triplet X86_WINDOWS;
|
|
|
|
static const Triplet X64_WINDOWS;
|
|
|
|
static const Triplet X86_UWP;
|
|
|
|
static const Triplet X64_UWP;
|
|
|
|
static const Triplet ARM_UWP;
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2016-10-03 17:20:52 -07:00
|
|
|
const std::string& canonical_name() const;
|
2016-09-18 20:50:08 -07:00
|
|
|
std::string architecture() const;
|
|
|
|
std::string system() const;
|
2017-04-07 17:44:24 -07:00
|
|
|
const std::string& to_string() const;
|
2016-10-03 17:20:52 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string m_canonical_name;
|
2016-09-18 20:50:08 -07:00
|
|
|
};
|
|
|
|
|
2017-04-03 15:02:45 -07:00
|
|
|
bool operator==(const Triplet& left, const Triplet& right);
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2017-04-03 15:02:45 -07:00
|
|
|
bool operator!=(const Triplet& left, const Triplet& right);
|
2016-09-18 20:50:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
template <>
|
2017-04-03 15:02:45 -07:00
|
|
|
struct hash<vcpkg::Triplet>
|
2016-09-18 20:50:08 -07:00
|
|
|
{
|
2017-04-03 15:02:45 -07:00
|
|
|
size_t operator()(const vcpkg::Triplet& t) const
|
2016-09-18 20:50:08 -07:00
|
|
|
{
|
|
|
|
std::hash<std::string> hasher;
|
|
|
|
size_t hash = 17;
|
2016-10-03 17:20:52 -07:00
|
|
|
hash = hash * 31 + hasher(t.canonical_name());
|
2016-09-18 20:50:08 -07:00
|
|
|
return hash;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace std
|