aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/PostBuildLint_BuildPolicies.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-02-09 19:00:09 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2017-02-10 14:00:11 -0800
commit95650bdd424b9499f4676dae8f110b15b3fd024f (patch)
treee37452ea2f1e342e40bbd31480b210742f38088b /toolsrc/src/PostBuildLint_BuildPolicies.cpp
parent7a0404cb839ae49bf7e52ca54f905d182a12de5d (diff)
downloadvcpkg-95650bdd424b9499f4676dae8f110b15b3fd024f.tar.gz
vcpkg-95650bdd424b9499f4676dae8f110b15b3fd024f.zip
PostBuildLint enum revamp
Diffstat (limited to 'toolsrc/src/PostBuildLint_BuildPolicies.cpp')
-rw-r--r--toolsrc/src/PostBuildLint_BuildPolicies.cpp27
1 files changed, 10 insertions, 17 deletions
diff --git a/toolsrc/src/PostBuildLint_BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp
index 4e5ac3cea..53dfcf95a 100644
--- a/toolsrc/src/PostBuildLint_BuildPolicies.cpp
+++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp
@@ -1,10 +1,11 @@
#include "pch.h"
#include "PostBuildLint_BuildPolicies.h"
-#include "vcpkg_Checks.h"
+#include "vcpkg_Enums.h"
namespace vcpkg::PostBuildLint::BuildPolicies
{
- static const std::string NAME_UNKNOWN = "PolicyUnknown";
+ static const std::string NULLVALUE_STRING = Enums::nullvalue_toString(ENUM_NAME);
+
static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage";
static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs";
@@ -16,10 +17,10 @@ namespace vcpkg::PostBuildLint::BuildPolicies
return NAME_EMPTY_PACKAGE;
case DLLS_WITHOUT_LIBS:
return NAME_DLLS_WITHOUT_LIBS;
- case UNKNOWN:
- return NAME_UNKNOWN;
+ case NULLVALUE:
+ return NULLVALUE_STRING;
default:
- Checks::unreachable();
+ Enums::unreachable(ENUM_NAME);
}
}
@@ -34,21 +35,13 @@ namespace vcpkg::PostBuildLint::BuildPolicies
return CMAKE_VARIABLE_EMPTY_PACKAGE;
case DLLS_WITHOUT_LIBS:
return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS;
- case UNKNOWN:
- Checks::exit_with_message("No CMake command corresponds to UNKNOWN");
+ case NULLVALUE:
+ Enums::nullvalue_used(ENUM_NAME);
default:
- Checks::unreachable();
+ Enums::unreachable(ENUM_NAME);
}
}
- type::type(): backing_enum(backing_enum_t::UNKNOWN) {}
-
- const std::vector<type>& values()
- {
- static const std::vector<type>& v = {UNKNOWN, EMPTY_PACKAGE, DLLS_WITHOUT_LIBS};
- return v;
- }
-
type parse(const std::string& s)
{
if (s == NAME_EMPTY_PACKAGE)
@@ -61,6 +54,6 @@ namespace vcpkg::PostBuildLint::BuildPolicies
return BuildPolicies::DLLS_WITHOUT_LIBS;
}
- return BuildPolicies::UNKNOWN;
+ return BuildPolicies::NULLVALUE;
}
}