2016-09-19 11:50:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
2017-06-22 06:27:34 +08:00
|
|
|
struct TripletInstance;
|
|
|
|
|
2017-04-04 06:02:45 +08:00
|
|
|
struct Triplet
|
2016-09-19 11:50:08 +08:00
|
|
|
{
|
2017-06-22 06:27:34 +08:00
|
|
|
public:
|
2017-09-02 08:08:21 +08:00
|
|
|
constexpr Triplet() : m_instance(&DEFAULT_INSTANCE) {}
|
2017-06-22 06:27:34 +08:00
|
|
|
|
2017-04-04 06:02:45 +08:00
|
|
|
static Triplet from_canonical_name(const std::string& triplet_as_string);
|
2016-10-04 08:20:52 +08:00
|
|
|
|
2017-04-04 06:02:45 +08: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-19 11:50:08 +08:00
|
|
|
|
2016-10-04 08:20:52 +08:00
|
|
|
const std::string& canonical_name() const;
|
2017-04-08 08:44:24 +08:00
|
|
|
const std::string& to_string() const;
|
2017-06-22 06:27:34 +08:00
|
|
|
size_t hash_code() const;
|
|
|
|
|
|
|
|
bool operator==(const Triplet& other) const;
|
2016-10-04 08:20:52 +08:00
|
|
|
|
|
|
|
private:
|
2017-09-02 08:08:21 +08:00
|
|
|
static const TripletInstance DEFAULT_INSTANCE;
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2017-06-22 06:27:34 +08:00
|
|
|
constexpr Triplet(const TripletInstance* ptr) : m_instance(ptr) {}
|
|
|
|
|
|
|
|
const TripletInstance* m_instance;
|
|
|
|
};
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2017-04-04 06:02:45 +08:00
|
|
|
bool operator!=(const Triplet& left, const Triplet& right);
|
2016-09-19 11:50:08 +08:00
|
|
|
}
|
|
|
|
|
2017-06-22 06:27:34 +08:00
|
|
|
template<>
|
|
|
|
struct std::hash<vcpkg::Triplet>
|
2016-09-19 11:50:08 +08:00
|
|
|
{
|
2017-06-22 06:27:34 +08:00
|
|
|
size_t operator()(const vcpkg::Triplet& t) const { return t.hash_code(); }
|
|
|
|
};
|