aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg_paths.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/vcpkg_paths.cpp')
-rw-r--r--toolsrc/src/vcpkg_paths.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp
index 10b6d992a..1f9eb0bc5 100644
--- a/toolsrc/src/vcpkg_paths.cpp
+++ b/toolsrc/src/vcpkg_paths.cpp
@@ -3,8 +3,7 @@
#include "vcpkg_paths.h"
#include "metrics.h"
#include "vcpkg_System.h"
-
-namespace fs = std::tr2::sys;
+#include "package_spec.h"
namespace vcpkg
{
@@ -45,4 +44,29 @@ namespace vcpkg
paths.ports_cmake = paths.root / "scripts" / "ports.cmake";
return paths;
}
+
+ fs::path vcpkg_paths::package_dir(const package_spec& spec) const
+ {
+ return this->packages / spec.dir();
+ }
+
+ fs::path vcpkg_paths::port_dir(const package_spec& spec) const
+ {
+ return this->ports / spec.name();
+ }
+
+ bool vcpkg_paths::is_valid_triplet(const triplet& t) const
+ {
+ auto it = fs::directory_iterator(this->triplets);
+ for (; it != fs::directory_iterator(); ++it)
+ {
+ std::string triplet_file_name = it->path().stem().generic_u8string();
+ if (t.canonical_name() == triplet_file_name) // TODO: fuzzy compare
+ {
+ //t.value = triplet_file_name; // NOTE: uncomment when implementing fuzzy compare
+ return true;
+ }
+ }
+ return false;
+ }
}