From 4aef2485b9d5cf2dfbb30543963e5714dcc411c4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:43:29 -0800 Subject: Split ConfigurationType into separate h/cpp --- toolsrc/src/PostBuildLint_ConfigurationType.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 toolsrc/src/PostBuildLint_ConfigurationType.cpp (limited to 'toolsrc/src/PostBuildLint_ConfigurationType.cpp') diff --git a/toolsrc/src/PostBuildLint_ConfigurationType.cpp b/toolsrc/src/PostBuildLint_ConfigurationType.cpp new file mode 100644 index 000000000..9c3499cac --- /dev/null +++ b/toolsrc/src/PostBuildLint_ConfigurationType.cpp @@ -0,0 +1,19 @@ +#include "pch.h" +#include "PostBuildLint_ConfigurationType.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint +{ + std::string to_string(const ConfigurationType& conf) + { + switch (conf) + { + case ConfigurationType::DEBUG: + return "Debug"; + case ConfigurationType::RELEASE: + return "Release"; + default: + Checks::unreachable(); + } + } +} -- cgit v1.2.3 From 95650bdd424b9499f4676dae8f110b15b3fd024f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Feb 2017 19:00:09 -0800 Subject: PostBuildLint enum revamp --- toolsrc/src/PostBuildLint_ConfigurationType.cpp | 27 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'toolsrc/src/PostBuildLint_ConfigurationType.cpp') diff --git a/toolsrc/src/PostBuildLint_ConfigurationType.cpp b/toolsrc/src/PostBuildLint_ConfigurationType.cpp index 9c3499cac..990b10a37 100644 --- a/toolsrc/src/PostBuildLint_ConfigurationType.cpp +++ b/toolsrc/src/PostBuildLint_ConfigurationType.cpp @@ -1,19 +1,26 @@ #include "pch.h" #include "PostBuildLint_ConfigurationType.h" -#include "vcpkg_Checks.h" +#include "vcpkg_Enums.h" -namespace vcpkg::PostBuildLint +namespace vcpkg::PostBuildLint::ConfigurationType { - std::string to_string(const ConfigurationType& conf) + static const std::string NULLVALUE_STRING = Enums::nullvalue_toString(ENUM_NAME); + + static const std::string NAME_DEBUG = "Debug"; + static const std::string NAME_RELEASE = "Release"; + + const std::string& type::toString() const { - switch (conf) + switch (this->backing_enum) { - case ConfigurationType::DEBUG: - return "Debug"; - case ConfigurationType::RELEASE: - return "Release"; - default: - Checks::unreachable(); + case ConfigurationType::DEBUG: + return NAME_DEBUG; + case ConfigurationType::RELEASE: + return NAME_RELEASE; + case ConfigurationType::NULLVALUE: + return NULLVALUE_STRING; + default: + Enums::unreachable(ENUM_NAME); } } } -- cgit v1.2.3