Add BuildResul_Values and rename NULLVALUE const
MODIFY
include/vcpkg_Commands.h
include/vcpkg_Commands.h
#include "vcpkg_cmd_arguments.h"
#include "vcpkg_paths.h"
#include "StatusParagraphs.h"
+#include <array>
namespace vcpkg::Commands
{
@@ -14,13 +15,15 @@ namespace vcpkg::Commands
{
enum class BuildResult
{
- BUILD_NOT_STARTED = 0,
+ NULLVALUE = 0,
SUCCEEDED,
BUILD_FAILED,
POST_BUILD_CHECKS_FAILED,
CASCADED_DUE_TO_MISSING_DEPENDENCIES
};
+ static constexpr std::array<BuildResult, 4> BuildResult_values = { BuildResult::SUCCEEDED, BuildResult::BUILD_FAILED, BuildResult::POST_BUILD_CHECKS_FAILED, BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES };
+
const std::string& to_string(const BuildResult build_result);
std::string create_error_message(const BuildResult build_result, const package_spec& spec);
std::string create_user_troubleshooting_message(const package_spec& spec);

MODIFY
src/commands_build.cpp
src/commands_build.cpp
#include "vcpkg_Environment.h"
#include "metrics.h"
#include "vcpkg_info.h"
+#include "vcpkg_Enums.h"
namespace vcpkg::Commands::Build
{
@@ -78,7 +79,7 @@ namespace vcpkg::Commands::Build
const std::string& to_string(const BuildResult build_result)
{
- static const std::string BUILD_NOT_STARTED_STRING = "BUILD_NOT_STARTED";
+ static const std::string NULLVALUE_STRING = Enums::nullvalue_toString("vcpkg::Commands::Build::BuildResult");
static const std::string SUCCEEDED_STRING = "SUCCEEDED";
static const std::string BUILD_FAILED_STRING = "BUILD_FAILED";
static const std::string POST_BUILD_CHECKS_FAILED_STRING = "POST_BUILD_CHECKS_FAILED";
@@ -86,7 +87,7 @@ namespace vcpkg::Commands::Build
switch (build_result)
{
- case BuildResult::BUILD_NOT_STARTED: return BUILD_NOT_STARTED_STRING;
+ case BuildResult::NULLVALUE: return NULLVALUE_STRING;
case BuildResult::SUCCEEDED: return SUCCEEDED_STRING;
case BuildResult::BUILD_FAILED: return BUILD_FAILED_STRING;
case BuildResult::POST_BUILD_CHECKS_FAILED: return POST_BUILD_CHECKS_FAILED_STRING;

Add BuildResul_Values and rename NULLVALUE const