diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-03 15:14:17 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-04 16:44:42 -0700 |
| commit | ab34b88f2d315b9076faaae9bde5b444c4155b1b (patch) | |
| tree | c0cb841dee218b82393de99a2f69aa4c8f76fec5 | |
| parent | d33e191ce40d0ff6d4498c7ef68f943776b7008c (diff) | |
| download | vcpkg-ab34b88f2d315b9076faaae9bde5b444c4155b1b.tar.gz vcpkg-ab34b88f2d315b9076faaae9bde5b444c4155b1b.zip | |
install_state_t -> InstallState
| -rw-r--r-- | toolsrc/include/StatusParagraph.h | 6 | ||||
| -rw-r--r-- | toolsrc/src/StatusParagraph.cpp | 18 | ||||
| -rw-r--r-- | toolsrc/src/commands_install.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/commands_remove.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Dependencies.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/vcpkglib.cpp | 4 |
6 files changed, 19 insertions, 19 deletions
diff --git a/toolsrc/include/StatusParagraph.h b/toolsrc/include/StatusParagraph.h index 1386bbdf4..f7acc467c 100644 --- a/toolsrc/include/StatusParagraph.h +++ b/toolsrc/include/StatusParagraph.h @@ -5,7 +5,7 @@ namespace vcpkg { - enum class install_state_t + enum class InstallState { error, not_installed, @@ -30,12 +30,12 @@ namespace vcpkg BinaryParagraph package; want_t want; - install_state_t state; + InstallState state; }; std::ostream& operator<<(std::ostream& os, const StatusParagraph& pgh); - std::string to_string(install_state_t f); + std::string to_string(InstallState f); std::string to_string(want_t f); } diff --git a/toolsrc/src/StatusParagraph.cpp b/toolsrc/src/StatusParagraph.cpp index 3f07689ca..4f4f6beee 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(install_state_t::error) + StatusParagraph::StatusParagraph() : want(want_t::error), state(InstallState::error) { } @@ -58,22 +58,22 @@ namespace vcpkg state = [](const std::string& text) { if (text == "not-installed") - return install_state_t::not_installed; + return InstallState::not_installed; if (text == "installed") - return install_state_t::installed; + return InstallState::installed; if (text == "half-installed") - return install_state_t::half_installed; - return install_state_t::error; + return InstallState::half_installed; + return InstallState::error; }(std::string(b, e)); } - std::string to_string(install_state_t f) + std::string to_string(InstallState f) { switch (f) { - case install_state_t::half_installed: return "half-installed"; - case install_state_t::installed: return "installed"; - case install_state_t::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 fd586329f..0a7b27825 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 = install_state_t::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 = install_state_t::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 a06a719af..a3b00faba 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 = install_state_t::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 = install_state_t::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 9f6181a46..5771954b4 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 == install_state_t::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 ed2e026f6..3c98c745d 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 == install_state_t::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 != install_state_t::installed) + if (pgh->state != InstallState::installed) { continue; } |
