vcpkg/toolsrc/include/triplet.h

44 lines
1.0 KiB
C
Raw Normal View History

2016-09-18 20:50:08 -07:00
#pragma once
#include <string>
namespace vcpkg
{
struct TripletInstance;
2017-04-03 15:02:45 -07:00
struct Triplet
2016-09-18 20:50:08 -07:00
{
public:
constexpr Triplet() : m_instance(&default_instance) {}
2017-04-03 15:02:45 -07:00
static Triplet from_canonical_name(const std::string& triplet_as_string);
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
const std::string& canonical_name() const;
2017-04-07 17:44:24 -07: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-18 20:50:08 -07:00
constexpr Triplet(const TripletInstance* ptr) : m_instance(ptr) {}
const TripletInstance* m_instance;
};
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
}
template<>
struct std::hash<vcpkg::Triplet>
2016-09-18 20:50:08 -07:00
{
size_t operator()(const vcpkg::Triplet& t) const { return t.hash_code(); }
};