aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-04-25 17:39:59 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-04-25 17:56:19 -0700
commitef0bdb00e4f671ea3c5d1bf096d230b57b526d96 (patch)
tree9431d190cd14747058b2b24897301e6124dc0ca2 /toolsrc/include
parentd3d00b33dd524815b47f1bc6e6f8080dc7054d29 (diff)
downloadvcpkg-ef0bdb00e4f671ea3c5d1bf096d230b57b526d96.tar.gz
vcpkg-ef0bdb00e4f671ea3c5d1bf096d230b57b526d96.zip
Rework ConfigurationType enum
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/PostBuildLint_BuildType.h16
-rw-r--r--toolsrc/include/PostBuildLint_ConfigurationType.h33
2 files changed, 26 insertions, 23 deletions
diff --git a/toolsrc/include/PostBuildLint_BuildType.h b/toolsrc/include/PostBuildLint_BuildType.h
index a086c8f03..55a5878a9 100644
--- a/toolsrc/include/PostBuildLint_BuildType.h
+++ b/toolsrc/include/PostBuildLint_BuildType.h
@@ -16,11 +16,11 @@ namespace vcpkg::PostBuildLint
RELEASE_DYNAMIC
};
- static BuildType value_of(const ConfigurationType::Type& config, const LinkageType& linkage);
+ static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage);
BuildType() = delete;
- constexpr explicit BuildType(const BackingEnum backing_enum, const ConfigurationType::Type config, const LinkageType linkage)
+ constexpr explicit BuildType(const BackingEnum backing_enum, const ConfigurationType config, const LinkageType linkage)
:
backing_enum(backing_enum)
, m_config(config)
@@ -28,14 +28,14 @@ namespace vcpkg::PostBuildLint
constexpr operator BackingEnum() const { return backing_enum; }
- const ConfigurationType::Type& config() const;
+ const ConfigurationType& config() const;
const LinkageType& linkage() const;
const std::regex& crt_regex() const;
const std::string& to_string() const;
private:
BackingEnum backing_enum;
- ConfigurationType::Type m_config;
+ ConfigurationType m_config;
LinkageType m_linkage;
};
@@ -43,10 +43,10 @@ namespace vcpkg::PostBuildLint
{
static constexpr const char* ENUM_NAME = "vcpkg::PostBuildLint::BuildType";
- static constexpr BuildType DEBUG_STATIC = BuildType(BuildType::BackingEnum::DEBUG_STATIC, ConfigurationType::DEBUG, LinkageTypeC::STATIC);
- static constexpr BuildType DEBUG_DYNAMIC = BuildType(BuildType::BackingEnum::DEBUG_DYNAMIC, ConfigurationType::DEBUG, LinkageTypeC::DYNAMIC);
- static constexpr BuildType RELEASE_STATIC = BuildType(BuildType::BackingEnum::RELEASE_STATIC, ConfigurationType::RELEASE, LinkageTypeC::STATIC);
- static constexpr BuildType RELEASE_DYNAMIC = BuildType(BuildType::BackingEnum::RELEASE_DYNAMIC, ConfigurationType::RELEASE, LinkageTypeC::DYNAMIC);
+ static constexpr BuildType DEBUG_STATIC = BuildType(BuildType::BackingEnum::DEBUG_STATIC, ConfigurationTypeC::DEBUG, LinkageTypeC::STATIC);
+ static constexpr BuildType DEBUG_DYNAMIC = BuildType(BuildType::BackingEnum::DEBUG_DYNAMIC, ConfigurationTypeC::DEBUG, LinkageTypeC::DYNAMIC);
+ static constexpr BuildType RELEASE_STATIC = BuildType(BuildType::BackingEnum::RELEASE_STATIC, ConfigurationTypeC::RELEASE, LinkageTypeC::STATIC);
+ static constexpr BuildType RELEASE_DYNAMIC = BuildType(BuildType::BackingEnum::RELEASE_DYNAMIC, ConfigurationTypeC::RELEASE, LinkageTypeC::DYNAMIC);
static constexpr std::array<BuildType, 4> VALUES = { DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC };
}}
diff --git a/toolsrc/include/PostBuildLint_ConfigurationType.h b/toolsrc/include/PostBuildLint_ConfigurationType.h
index 1ce63690f..710547b85 100644
--- a/toolsrc/include/PostBuildLint_ConfigurationType.h
+++ b/toolsrc/include/PostBuildLint_ConfigurationType.h
@@ -2,19 +2,19 @@
#pragma once
#include <string>
-namespace vcpkg::PostBuildLint::ConfigurationType
+namespace vcpkg::PostBuildLint
{
- enum class BackingEnum
+ struct ConfigurationType
{
- NULLVALUE = 0,
- DEBUG = 1,
- RELEASE = 2
- };
+ enum class BackingEnum
+ {
+ NULLVALUE = 0,
+ DEBUG = 1,
+ RELEASE = 2
+ };
- struct Type
- {
- constexpr Type() : backing_enum(BackingEnum::NULLVALUE) {}
- constexpr explicit Type(BackingEnum backing_enum) : backing_enum(backing_enum) { }
+ constexpr ConfigurationType() : backing_enum(BackingEnum::NULLVALUE) {}
+ constexpr explicit ConfigurationType(BackingEnum backing_enum) : backing_enum(backing_enum) { }
constexpr operator BackingEnum() const { return backing_enum; }
const std::string& to_string() const;
@@ -23,11 +23,14 @@ namespace vcpkg::PostBuildLint::ConfigurationType
BackingEnum backing_enum;
};
- static const std::string ENUM_NAME = "vcpkg::PostBuildLint::ConfigurationType";
+ namespace ConfigurationTypeC
+ {
+ static constexpr const char* ENUM_NAME = "vcpkg::PostBuildLint::ConfigurationType";
- static constexpr Type NULLVALUE(BackingEnum::NULLVALUE);
- static constexpr Type DEBUG(BackingEnum::DEBUG);
- static constexpr Type RELEASE(BackingEnum::RELEASE);
+ static constexpr ConfigurationType NULLVALUE(ConfigurationType::BackingEnum::NULLVALUE);
+ static constexpr ConfigurationType DEBUG(ConfigurationType::BackingEnum::DEBUG);
+ static constexpr ConfigurationType RELEASE(ConfigurationType::BackingEnum::RELEASE);
- static constexpr std::array<Type, 2> values = { DEBUG, RELEASE };
+ static constexpr std::array<ConfigurationType, 2> VALUES = { DEBUG, RELEASE };
+ }
}