aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-04-03 15:25:34 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-04-04 16:44:42 -0700
commita742b60b4f4da8fc0d9b755b05600b75724233a9 (patch)
treef836ad235fe66034e945be2d7efa2f1219ce0680
parentab34b88f2d315b9076faaae9bde5b444c4155b1b (diff)
downloadvcpkg-a742b60b4f4da8fc0d9b755b05600b75724233a9.tar.gz
vcpkg-a742b60b4f4da8fc0d9b755b05600b75724233a9.zip
InstallState: change enum constants to ALL_UPPER
-rw-r--r--toolsrc/include/StatusParagraph.h8
-rw-r--r--toolsrc/src/StatusParagraph.cpp16
-rw-r--r--toolsrc/src/commands_install.cpp4
-rw-r--r--toolsrc/src/commands_remove.cpp4
-rw-r--r--toolsrc/src/vcpkg_Dependencies.cpp2
-rw-r--r--toolsrc/src/vcpkglib.cpp4
6 files changed, 19 insertions, 19 deletions
diff --git a/toolsrc/include/StatusParagraph.h b/toolsrc/include/StatusParagraph.h
index f7acc467c..0b6e26b76 100644
--- a/toolsrc/include/StatusParagraph.h
+++ b/toolsrc/include/StatusParagraph.h
@@ -7,10 +7,10 @@ namespace vcpkg
{
enum class InstallState
{
- error,
- not_installed,
- half_installed,
- installed,
+ ERROR_STATE,
+ NOT_INSTALLED,
+ HALF_INSTALLED,
+ INSTALLED,
};
enum class want_t
diff --git a/toolsrc/src/StatusParagraph.cpp b/toolsrc/src/StatusParagraph.cpp
index 4f4f6beee..a46262fe8 100644
--- a/toolsrc/src/StatusParagraph.cpp
+++ b/toolsrc/src/StatusParagraph.cpp
@@ -12,7 +12,7 @@ namespace vcpkg
static const std::string STATUS = "Status";
}
- StatusParagraph::StatusParagraph() : want(want_t::error), state(InstallState::error)
+ StatusParagraph::StatusParagraph() : want(want_t::error), state(InstallState::ERROR_STATE)
{
}
@@ -58,12 +58,12 @@ namespace vcpkg
state = [](const std::string& text)
{
if (text == "not-installed")
- return InstallState::not_installed;
+ return InstallState::NOT_INSTALLED;
if (text == "installed")
- return InstallState::installed;
+ return InstallState::INSTALLED;
if (text == "half-installed")
- return InstallState::half_installed;
- return InstallState::error;
+ return InstallState::HALF_INSTALLED;
+ return InstallState::ERROR_STATE;
}(std::string(b, e));
}
@@ -71,9 +71,9 @@ namespace vcpkg
{
switch (f)
{
- case InstallState::half_installed: return "half-installed";
- case InstallState::installed: return "installed";
- case InstallState::not_installed: return "not-installed";
+ case InstallState::HALF_INSTALLED: return "half-installed";
+ case InstallState::INSTALLED: return "installed";
+ case InstallState::NOT_INSTALLED: return "not-installed";
default: return "error";
}
}
diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp
index 0a7b27825..60cf5da0e 100644
--- a/toolsrc/src/commands_install.cpp
+++ b/toolsrc/src/commands_install.cpp
@@ -165,7 +165,7 @@ namespace vcpkg::Commands::Install
StatusParagraph spgh;
spgh.package = binary_paragraph;
spgh.want = want_t::install;
- spgh.state = InstallState::half_installed;
+ spgh.state = InstallState::HALF_INSTALLED;
for (auto&& dep : spgh.package.depends)
{
if (status_db->find_installed(dep, spgh.package.spec.target_triplet()) == status_db->end())
@@ -178,7 +178,7 @@ namespace vcpkg::Commands::Install
install_and_write_listfile(paths, spgh.package);
- spgh.state = InstallState::installed;
+ spgh.state = InstallState::INSTALLED;
write_update(paths, spgh);
status_db->insert(std::make_unique<StatusParagraph>(spgh));
}
diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp
index a3b00faba..26af4f32b 100644
--- a/toolsrc/src/commands_remove.cpp
+++ b/toolsrc/src/commands_remove.cpp
@@ -32,7 +32,7 @@ namespace vcpkg::Commands::Remove
StatusParagraph& pkg = **status_db->find(spec.name(), spec.target_triplet());
pkg.want = want_t::purge;
- pkg.state = InstallState::half_installed;
+ pkg.state = InstallState::HALF_INSTALLED;
write_update(paths, pkg);
std::fstream listfile(paths.listfile_path(pkg.package), std::ios_base::in | std::ios_base::binary);
@@ -97,7 +97,7 @@ namespace vcpkg::Commands::Remove
fs::remove(paths.listfile_path(pkg.package));
}
- pkg.state = InstallState::not_installed;
+ pkg.state = InstallState::NOT_INSTALLED;
write_update(paths, pkg);
}
diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp
index 5771954b4..224a1222d 100644
--- a/toolsrc/src/vcpkg_Dependencies.cpp
+++ b/toolsrc/src/vcpkg_Dependencies.cpp
@@ -122,7 +122,7 @@ namespace vcpkg::Dependencies
}
const StatusParagraphs::const_iterator it = status_db.find(spec);
- if (it == status_db.end() || (*it)->state == InstallState::not_installed)
+ if (it == status_db.end() || (*it)->state == InstallState::NOT_INSTALLED)
{
was_examined.emplace(spec, remove_plan_action(remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED));
continue;
diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp
index 3c98c745d..92950b2e7 100644
--- a/toolsrc/src/vcpkglib.cpp
+++ b/toolsrc/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_t::purge)
+ if (pgh->state == InstallState::NOT_INSTALLED && pgh->want == want_t::purge)
continue;
installed_packages.push_back(pgh.get());
}
@@ -190,7 +190,7 @@ namespace vcpkg
for (const std::unique_ptr<StatusParagraph>& pgh : status_db)
{
- if (pgh->state != InstallState::installed)
+ if (pgh->state != InstallState::INSTALLED)
{
continue;
}