vcpkg/toolsrc/include/triplet.h

44 lines
1.0 KiB
C
Raw Normal View History

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