vcpkg/toolsrc/include/triplet.h

53 lines
1.2 KiB
C
Raw Normal View History

2016-09-19 11:50:08 +08:00
#pragma once
#include <string>
namespace vcpkg
{
struct triplet
{
static triplet from_canonical_name(const std::string& triplet_as_string);
2016-09-19 11:50:08 +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;
const std::string& canonical_name() const;
2016-09-19 11:50:08 +08:00
std::string architecture() const;
std::string system() const;
private:
std::string m_canonical_name;
2016-09-19 11:50:08 +08:00
};
bool operator==(const triplet& left, const triplet& right);
bool operator!=(const triplet& left, const triplet& right);
std::string to_string(const triplet& spec);
std::string to_printf_arg(const triplet& spec);
std::ostream& operator<<(std::ostream& os, const triplet& spec);
}
namespace std
{
template <>
struct hash<vcpkg::triplet>
{
size_t operator()(const vcpkg::triplet& t) const
{
std::hash<std::string> hasher;
size_t hash = 17;
hash = hash * 31 + hasher(t.canonical_name());
2016-09-19 11:50:08 +08:00
return hash;
}
};
} // namespace std