Want: change enum constants to ALL_UPPER
MODIFY
include/StatusParagraph.h
include/StatusParagraph.h
@@ -15,12 +15,12 @@ namespace vcpkg
enum class Want
{
- error,
- unknown,
- install,
- hold,
- deinstall,
- purge
+ ERROR_STATE,
+ UNKNOWN,
+ INSTALL,
+ HOLD,
+ DEINSTALL,
+ PURGE
};
struct StatusParagraph

MODIFY
src/StatusParagraph.cpp
src/StatusParagraph.cpp
@@ -12,7 +12,7 @@ namespace vcpkg
static const std::string STATUS = "Status";
}
- StatusParagraph::StatusParagraph() : want(Want::error), state(InstallState::ERROR_STATE)
+ StatusParagraph::StatusParagraph() : want(Want::ERROR_STATE), state(InstallState::ERROR_STATE)
{
}
@@ -39,16 +39,16 @@ namespace vcpkg
want = [](const std::string& text)
{
if (text == "unknown")
- return Want::unknown;
+ return Want::UNKNOWN;
if (text == "install")
- return Want::install;
+ return Want::INSTALL;
if (text == "hold")
- return Want::hold;
+ return Want::HOLD;
if (text == "deinstall")
- return Want::deinstall;
+ return Want::DEINSTALL;
if (text == "purge")
- return Want::purge;
- return Want::error;
+ return Want::PURGE;
+ return Want::ERROR_STATE;
}(std::string(mark, b));
if (std::distance(b, e) < 4)
@@ -82,11 +82,11 @@ namespace vcpkg
{
switch (f)
{
- case Want::deinstall: return "deinstall";
- case Want::hold: return "hold";
- case Want::install: return "install";
- case Want::purge: return "purge";
- case Want::unknown: return "unknown";
+ case Want::DEINSTALL: return "deinstall";
+ case Want::HOLD: return "hold";
+ case Want::INSTALL: return "install";
+ case Want::PURGE: return "purge";
+ case Want::UNKNOWN: return "unknown";
default: return "error";
}
}

MODIFY
src/StatusParagraphs.cpp
src/StatusParagraphs.cpp
@@ -32,7 +32,7 @@ namespace vcpkg
StatusParagraphs::const_iterator StatusParagraphs::find_installed(const std::string& name, const Triplet& target_triplet) const
{
const const_iterator it = find(name, target_triplet);
- if (it != end() && (*it)->want == Want::install)
+ if (it != end() && (*it)->want == Want::INSTALL)
{
return it;
}

MODIFY
src/commands_install.cpp
src/commands_install.cpp
@@ -164,7 +164,7 @@ namespace vcpkg::Commands::Install
StatusParagraph spgh;
spgh.package = binary_paragraph;
- spgh.want = Want::install;
+ spgh.want = Want::INSTALL;
spgh.state = InstallState::HALF_INSTALLED;
for (auto&& dep : spgh.package.depends)
{

MODIFY
src/commands_remove.cpp
src/commands_remove.cpp
@@ -31,7 +31,7 @@ namespace vcpkg::Commands::Remove
{
StatusParagraph& pkg = **status_db->find(spec.name(), spec.target_triplet());
- pkg.want = Want::purge;
+ pkg.want = Want::PURGE;
pkg.state = InstallState::HALF_INSTALLED;
write_update(paths, pkg);

MODIFY
src/vcpkg_Dependencies.cpp
src/vcpkg_Dependencies.cpp
@@ -66,7 +66,7 @@ namespace vcpkg::Dependencies
};
auto it = status_db.find(spec);
- if (it != status_db.end() && (*it)->want == Want::install)
+ if (it != status_db.end() && (*it)->want == Want::INSTALL)
{
was_examined.emplace(spec, install_plan_action{install_plan_type::ALREADY_INSTALLED, nullopt, nullopt });
continue;
@@ -130,7 +130,7 @@ namespace vcpkg::Dependencies
for (const std::unique_ptr<StatusParagraph>& an_installed_package : status_db)
{
- if (an_installed_package->want != Want::install)
+ if (an_installed_package->want != Want::INSTALL)
continue;
if (an_installed_package->package.spec.target_triplet() != spec.target_triplet())
continue;

MODIFY
src/vcpkglib.cpp
src/vcpkglib.cpp
@@ -176,7 +176,7 @@ namespace vcpkg
std::vector<StatusParagraph*> installed_packages;
for (auto&& pgh : status_db)
{
- if (pgh->state == InstallState::NOT_INSTALLED && pgh->want == Want::purge)
+ if (pgh->state != InstallState::INSTALLED || pgh->want != Want::INSTALL)
continue;
installed_packages.push_back(pgh.get());
}

Want: change enum constants to ALL_UPPER