diff --git a/toolsrc/include/opt_bool.h b/toolsrc/include/OptBool.h similarity index 56% rename from toolsrc/include/opt_bool.h rename to toolsrc/include/OptBool.h index 06642a399f..4098e6f034 100644 --- a/toolsrc/include/opt_bool.h +++ b/toolsrc/include/OptBool.h @@ -3,24 +3,24 @@ #include #include -namespace vcpkg::opt_bool +namespace vcpkg::OptBool { - enum class type + enum class Type { UNSPECIFIED = 0, ENABLED, DISABLED }; - type parse(const std::string& s); + Type parse(const std::string& s); template - type from_map(const std::map& map, const T& key) + Type from_map(const std::map& map, const T& key) { auto it = map.find(key); if (it == map.cend()) { - return type::UNSPECIFIED; + return Type::UNSPECIFIED; } return parse(*it); @@ -29,5 +29,5 @@ namespace vcpkg::opt_bool namespace vcpkg { - using opt_bool_t = opt_bool::type; + using OptBoolT = OptBool::Type; } \ No newline at end of file diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index bac024e017..cbc9444884 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -2,7 +2,7 @@ #include "filesystem_fs.h" #include "PostBuildLint_BuildPolicies.h" -#include "opt_bool.h" +#include "OptBool.h" #include "PostBuildLint_LinkageType.h" namespace vcpkg::PostBuildLint @@ -14,7 +14,7 @@ namespace vcpkg::PostBuildLint LinkageType::type crt_linkage; LinkageType::type library_linkage; - std::map policies; + std::map policies; }; BuildInfo read_build_info(const fs::path& filepath); diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 91f7de8ac1..6f06ad98d6 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -3,7 +3,7 @@ #include #include #include -#include "opt_bool.h" +#include "OptBool.h" namespace vcpkg { @@ -14,9 +14,9 @@ namespace vcpkg std::unique_ptr vcpkg_root_dir; std::unique_ptr target_triplet; - opt_bool_t debug = opt_bool_t::UNSPECIFIED; - opt_bool_t sendmetrics = opt_bool_t::UNSPECIFIED; - opt_bool_t printmetrics = opt_bool_t::UNSPECIFIED; + OptBoolT debug = OptBoolT::UNSPECIFIED; + OptBoolT sendmetrics = OptBoolT::UNSPECIFIED; + OptBoolT printmetrics = OptBoolT::UNSPECIFIED; std::string command; std::vector command_arguments; diff --git a/toolsrc/src/opt_bool.cpp b/toolsrc/src/OptBool.cpp similarity index 65% rename from toolsrc/src/opt_bool.cpp rename to toolsrc/src/OptBool.cpp index b4642f273b..1c063c92e5 100644 --- a/toolsrc/src/opt_bool.cpp +++ b/toolsrc/src/OptBool.cpp @@ -1,29 +1,29 @@ #include "pch.h" -#include "opt_bool.h" +#include "OptBool.h" #include "vcpkg_Checks.h" -namespace vcpkg::opt_bool +namespace vcpkg::OptBool { static const std::string UNSPECIFIED_NAME = "unspecified"; static const std::string ENABLED_NAME = "enabled"; static const std::string DISABLED_NAME = "disabled"; - type parse(const std::string& s) + Type parse(const std::string& s) { if (s == UNSPECIFIED_NAME) { - return opt_bool_t::UNSPECIFIED; + return OptBoolT::UNSPECIFIED; } if (s == ENABLED_NAME) { - return opt_bool_t::ENABLED; + return OptBoolT::ENABLED; } if (s == DISABLED_NAME) { - return opt_bool_t::DISABLED; + return OptBoolT::DISABLED; } - Checks::exit_with_message(VCPKG_LINE_INFO, "Could not convert string [%s] to opt_bool", s); + Checks::exit_with_message(VCPKG_LINE_INFO, "Could not convert string [%s] to OptBool", s); } } diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index bce29b446c..dcfa630e6f 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -53,10 +53,10 @@ namespace vcpkg::PostBuildLint } template - static bool contains_and_enabled(const std::map map, const T& key) + static bool contains_and_enabled(const std::map map, const T& key) { auto it = map.find(key); - if (it != map.cend() && it->second == opt_bool_t::ENABLED) + if (it != map.cend() && it->second == OptBoolT::ENABLED) { return true; } @@ -64,7 +64,7 @@ namespace vcpkg::PostBuildLint return false; } - static lint_status check_for_files_in_include_directory(const std::map& policies, const fs::path& package_dir) + static lint_status check_for_files_in_include_directory(const std::map& policies, const fs::path& package_dir) { if (contains_and_enabled(policies, BuildPolicies::EMPTY_INCLUDE_FOLDER)) { @@ -423,10 +423,10 @@ namespace vcpkg::PostBuildLint return lint_status::ERROR_DETECTED; } - static lint_status check_lib_files_are_available_if_dlls_are_available(const std::map& policies, const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) + static lint_status check_lib_files_are_available_if_dlls_are_available(const std::map& policies, const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) { auto it = policies.find(BuildPolicies::DLLS_WITHOUT_LIBS); - if (it != policies.cend() && it->second == opt_bool_t::ENABLED) + if (it != policies.cend() && it->second == OptBoolT::ENABLED) { return lint_status::SUCCESS; } diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index 7b7751e661..35aee57cd4 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -1,7 +1,7 @@ #include "pch.h" #include "PostBuildLint_BuildInfo.h" #include "vcpkg_Checks.h" -#include "opt_bool.h" +#include "OptBool.h" #include "vcpkglib_helpers.h" #include "Paragraphs.h" @@ -30,7 +30,7 @@ namespace vcpkg::PostBuildLint { const BuildPolicies::type policy = BuildPolicies::parse(p.first); Checks::check_exit(VCPKG_LINE_INFO, policy != BuildPolicies::NULLVALUE, "Unknown policy found: %s", p.first); - const opt_bool_t status = opt_bool::parse(p.second); + const OptBoolT status = OptBool::parse(p.second); build_info.policies.emplace(policy, status); } diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 01196fa14f..6f70607542 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -196,14 +196,14 @@ int wmain(const int argc, const wchar_t* const* const argv) const vcpkg_cmd_arguments args = vcpkg_cmd_arguments::create_from_command_line(argc, argv); - if (args.printmetrics != opt_bool_t::UNSPECIFIED) - Metrics::set_print_metrics(args.printmetrics == opt_bool_t::ENABLED); - if (args.sendmetrics != opt_bool_t::UNSPECIFIED) - Metrics::set_send_metrics(args.sendmetrics == opt_bool_t::ENABLED); + if (args.printmetrics != OptBoolT::UNSPECIFIED) + Metrics::set_print_metrics(args.printmetrics == OptBoolT::ENABLED); + if (args.sendmetrics != OptBoolT::UNSPECIFIED) + Metrics::set_send_metrics(args.sendmetrics == OptBoolT::ENABLED); - if (args.debug != opt_bool_t::UNSPECIFIED) + if (args.debug != OptBoolT::UNSPECIFIED) { - g_debugging = (args.debug == opt_bool_t::ENABLED); + g_debugging = (args.debug == OptBoolT::ENABLED); } if (g_debugging) diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index 458e7493b9..c3e3406ff2 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -32,11 +32,11 @@ namespace vcpkg } static void parse_switch( - opt_bool_t new_setting, + OptBoolT new_setting, const std::string& option_name, - opt_bool_t& option_field) + OptBoolT& option_field) { - if (option_field != opt_bool_t::UNSPECIFIED && option_field != new_setting) + if (option_field != OptBoolT::UNSPECIFIED && option_field != new_setting) { System::println(System::color::error, "Error: conflicting values specified for --%s", option_name); Metrics::track_property("error", "error conflicting switches"); @@ -93,27 +93,27 @@ namespace vcpkg } if (arg == "--debug") { - parse_switch(opt_bool_t::ENABLED, "debug", args.debug); + parse_switch(OptBoolT::ENABLED, "debug", args.debug); continue; } if (arg == "--sendmetrics") { - parse_switch(opt_bool_t::ENABLED, "sendmetrics", args.sendmetrics); + parse_switch(OptBoolT::ENABLED, "sendmetrics", args.sendmetrics); continue; } if (arg == "--printmetrics") { - parse_switch(opt_bool_t::ENABLED, "printmetrics", args.printmetrics); + parse_switch(OptBoolT::ENABLED, "printmetrics", args.printmetrics); continue; } if (arg == "--no-sendmetrics") { - parse_switch(opt_bool_t::DISABLED, "sendmetrics", args.sendmetrics); + parse_switch(OptBoolT::DISABLED, "sendmetrics", args.sendmetrics); continue; } if (arg == "--no-printmetrics") { - parse_switch(opt_bool_t::DISABLED, "printmetrics", args.printmetrics); + parse_switch(OptBoolT::DISABLED, "printmetrics", args.printmetrics); continue; } diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index c26bbf8856..3074c5440c 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -149,7 +149,7 @@ - + @@ -212,7 +212,7 @@ - + Create Create diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 00a54dafd3..a4fd0e283f 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -138,9 +138,6 @@ Source Files - - Source Files - Source Files @@ -180,6 +177,9 @@ Source Files + + Source Files + @@ -239,9 +239,6 @@ Header Files - - Header Files - Header Files @@ -314,5 +311,8 @@ Header Files + + Header Files + \ No newline at end of file