Add BuildResul_Values and rename NULLVALUE const

This commit is contained in:
Alexander Karatarakis 2017-02-15 14:34:03 -08:00
parent 430739c468
commit ab2cca3dad
2 changed files with 7 additions and 3 deletions

View File

@ -3,6 +3,7 @@
#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);

View File

@ -9,6 +9,7 @@
#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;