aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/triplet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/triplet.cpp')
-rw-r--r--toolsrc/src/triplet.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/toolsrc/src/triplet.cpp b/toolsrc/src/triplet.cpp
index 9ad3d8847..14f19d5cd 100644
--- a/toolsrc/src/triplet.cpp
+++ b/toolsrc/src/triplet.cpp
@@ -1,4 +1,5 @@
#include "triplet.h"
+#include "vcpkg.h"
#include "vcpkg_System.h"
#include "vcpkg_Checks.h"
@@ -56,4 +57,19 @@ namespace vcpkg
Checks::exit_with_message("Unknown system: %s", value);
}
+
+ bool triplet::validate(const vcpkg_paths & paths)
+ {
+ auto it = fs::directory_iterator(paths.triplets);
+ for(; it != fs::directory_iterator(); ++it)
+ {
+ std::string triplet_file_name = it->path().stem().generic_u8string();
+ if(value == triplet_file_name) // TODO: fuzzy compare
+ {
+ //value = triplet_file_name; // NOTE: uncomment when implementing fuzzy compare
+ return true;
+ }
+ }
+ return false;
+ }
}