mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-16 21:07:49 +08:00
33 lines
522 B
C++
33 lines
522 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <map>
|
|
|
|
namespace vcpkg::opt_bool
|
|
{
|
|
enum class type
|
|
{
|
|
UNSPECIFIED = 0,
|
|
ENABLED,
|
|
DISABLED
|
|
};
|
|
|
|
type parse(const std::string& s);
|
|
|
|
template <class T>
|
|
type from_map(const std::map<T, std::string>& map, const T& key)
|
|
{
|
|
auto it = map.find(key);
|
|
if (it == map.cend())
|
|
{
|
|
return type::UNSPECIFIED;
|
|
}
|
|
|
|
return parse(*it);
|
|
}
|
|
}
|
|
|
|
namespace vcpkg
|
|
{
|
|
using opt_bool_t = opt_bool::type;
|
|
} |