vcpkg/toolsrc/include/PostBuildLint_BuildPolicies.h

41 lines
1.3 KiB
C
Raw Normal View History

#pragma once
#include <string>
2017-02-10 11:00:09 +08:00
#include <array>
namespace vcpkg::PostBuildLint::BuildPolicies
{
2017-04-04 05:50:50 +08:00
enum class BackingEnum
{
2017-02-10 11:00:09 +08:00
NULLVALUE = 0,
2017-02-08 09:02:57 +08:00
EMPTY_PACKAGE,
2017-03-04 11:00:48 +08:00
DLLS_WITHOUT_LIBS,
ONLY_RELEASE_CRT,
EMPTY_INCLUDE_FOLDER
};
2017-04-04 05:50:50 +08:00
struct Type
{
2017-04-04 05:50:50 +08:00
constexpr Type() : backing_enum(BackingEnum::NULLVALUE) {}
constexpr explicit Type(BackingEnum backing_enum) : backing_enum(backing_enum) { }
constexpr operator BackingEnum() const { return backing_enum; }
const std::string& to_string() const;
const std::string& cmake_variable() const;
private:
2017-04-04 05:50:50 +08:00
BackingEnum backing_enum;
};
2017-02-10 11:00:09 +08:00
static const std::string ENUM_NAME = "vcpkg::PostBuildLint::BuildPolicies";
2017-02-01 10:55:14 +08:00
2017-04-04 05:50:50 +08:00
static constexpr Type NULLVALUE(BackingEnum::NULLVALUE);
static constexpr Type EMPTY_PACKAGE(BackingEnum::EMPTY_PACKAGE);
static constexpr Type DLLS_WITHOUT_LIBS(BackingEnum::DLLS_WITHOUT_LIBS);
static constexpr Type ONLY_RELEASE_CRT(BackingEnum::ONLY_RELEASE_CRT);
static constexpr Type EMPTY_INCLUDE_FOLDER(BackingEnum::EMPTY_INCLUDE_FOLDER);
2017-04-04 05:50:50 +08:00
static constexpr std::array<Type, 4> values = { EMPTY_PACKAGE, DLLS_WITHOUT_LIBS, ONLY_RELEASE_CRT, EMPTY_INCLUDE_FOLDER };
2017-02-10 11:00:09 +08:00
2017-04-04 05:50:50 +08:00
Type parse(const std::string& s);
}