BuildType to UpperCamelCase

This commit is contained in:
Alexander Karatarakis 2017-04-03 14:51:32 -07:00
parent b36df55c11
commit 6ccb3b95d8
3 changed files with 21 additions and 21 deletions

View File

@ -6,7 +6,7 @@
namespace vcpkg::PostBuildLint::BuildType
{
enum class backing_enum_t
enum class BackingEnum
{
DEBUG_STATIC = 1,
DEBUG_DYNAMIC,
@ -14,14 +14,14 @@ namespace vcpkg::PostBuildLint::BuildType
RELEASE_DYNAMIC
};
struct type
struct Type
{
type() = delete;
Type() = delete;
constexpr explicit type(const backing_enum_t backing_enum, const ConfigurationType::type config, const LinkageType::type linkage) :
constexpr explicit Type(const BackingEnum backing_enum, const ConfigurationType::type config, const LinkageType::type linkage) :
backing_enum(backing_enum), m_config(config), m_linkage(linkage) { }
constexpr operator backing_enum_t() const { return backing_enum; }
constexpr operator BackingEnum() const { return backing_enum; }
const ConfigurationType::type& config() const;
const LinkageType::type& linkage() const;
@ -29,19 +29,19 @@ namespace vcpkg::PostBuildLint::BuildType
const std::string& toString() const;
private:
backing_enum_t backing_enum;
BackingEnum backing_enum;
ConfigurationType::type m_config;
LinkageType::type m_linkage;
};
static const std::string ENUM_NAME = "vcpkg::PostBuildLint::BuildType";
static constexpr type DEBUG_STATIC = type(backing_enum_t::DEBUG_STATIC, ConfigurationType::DEBUG, LinkageType::STATIC);
static constexpr type DEBUG_DYNAMIC = type(backing_enum_t::DEBUG_DYNAMIC, ConfigurationType::DEBUG, LinkageType::DYNAMIC);
static constexpr type RELEASE_STATIC = type(backing_enum_t::RELEASE_STATIC, ConfigurationType::RELEASE, LinkageType::STATIC);
static constexpr type RELEASE_DYNAMIC = type(backing_enum_t::RELEASE_DYNAMIC, ConfigurationType::RELEASE, LinkageType::DYNAMIC);
static constexpr Type DEBUG_STATIC = Type(BackingEnum::DEBUG_STATIC, ConfigurationType::DEBUG, LinkageType::STATIC);
static constexpr Type DEBUG_DYNAMIC = Type(BackingEnum::DEBUG_DYNAMIC, ConfigurationType::DEBUG, LinkageType::DYNAMIC);
static constexpr Type RELEASE_STATIC = Type(BackingEnum::RELEASE_STATIC, ConfigurationType::RELEASE, LinkageType::STATIC);
static constexpr Type RELEASE_DYNAMIC = Type(BackingEnum::RELEASE_DYNAMIC, ConfigurationType::RELEASE, LinkageType::DYNAMIC);
static constexpr std::array<type, 4> values = { DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC };
static constexpr std::array<Type, 4> values = { DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC };
type value_of(const ConfigurationType::type& config, const LinkageType::type& linkage);
Type value_of(const ConfigurationType::type& config, const LinkageType::type& linkage);
}

View File

@ -500,12 +500,12 @@ namespace vcpkg::PostBuildLint
struct BuildType_and_file
{
fs::path file;
BuildType::type build_type;
BuildType::Type build_type;
};
static lint_status check_crt_linkage_of_libs(const BuildType::type& expected_build_type, const std::vector<fs::path>& libs, const fs::path dumpbin_exe)
static lint_status check_crt_linkage_of_libs(const BuildType::Type& expected_build_type, const std::vector<fs::path>& libs, const fs::path dumpbin_exe)
{
std::vector<BuildType::type> bad_build_types(BuildType::values.cbegin(), BuildType::values.cend());
std::vector<BuildType::Type> bad_build_types(BuildType::values.cbegin(), BuildType::values.cend());
bad_build_types.erase(std::remove(bad_build_types.begin(), bad_build_types.end(), expected_build_type), bad_build_types.end());
std::vector<BuildType_and_file> libs_with_invalid_crt;
@ -516,7 +516,7 @@ namespace vcpkg::PostBuildLint
System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line);
Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line));
for (const BuildType::type& bad_build_type : bad_build_types)
for (const BuildType::Type& bad_build_type : bad_build_types)
{
if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), bad_build_type.crt_regex()))
{

View File

@ -4,7 +4,7 @@
namespace vcpkg::PostBuildLint::BuildType
{
type value_of(const ConfigurationType::type& config, const LinkageType::type& linkage)
Type value_of(const ConfigurationType::type& config, const LinkageType::type& linkage)
{
if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC)
{
@ -29,17 +29,17 @@ namespace vcpkg::PostBuildLint::BuildType
Checks::unreachable(VCPKG_LINE_INFO);
}
const ConfigurationType::type& type::config() const
const ConfigurationType::type& Type::config() const
{
return this->m_config;
}
const LinkageType::type& type::linkage() const
const LinkageType::type& Type::linkage() const
{
return this->m_linkage;
}
const std::regex& type::crt_regex() const
const std::regex& Type::crt_regex() const
{
static const std::regex REGEX_DEBUG_STATIC(R"(/DEFAULTLIB:LIBCMTD)", std::regex_constants::icase);
static const std::regex REGEX_DEBUG_DYNAMIC(R"(/DEFAULTLIB:MSVCRTD)", std::regex_constants::icase);
@ -61,7 +61,7 @@ namespace vcpkg::PostBuildLint::BuildType
}
}
const std::string& type::toString() const
const std::string& Type::toString() const
{
static const std::string NAME_DEBUG_STATIC("Debug,Static");
static const std::string NAME_DEBUG_DYNAMIC("Debug,Dynamic");