diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-06-19 17:51:20 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-06-19 23:07:31 -0700 |
| commit | c256ccf4526decec0422d8fc9d91ceb8fcf6160b (patch) | |
| tree | e1b90d4fbaebfb8ae794659ee4cd223046e8056e /toolsrc/include | |
| parent | dbae3bfe566c4c2d949ca6b2f84c6867f15e46ac (diff) | |
| download | vcpkg-c256ccf4526decec0422d8fc9d91ceb8fcf6160b.tar.gz vcpkg-c256ccf4526decec0422d8fc9d91ceb8fcf6160b.zip | |
Introduce stringrange.h/cpp and visualstudio.h/cpp
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/base/stringrange.h | 33 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/commands.h | 1 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/visualstudio.h | 12 |
3 files changed, 45 insertions, 1 deletions
diff --git a/toolsrc/include/vcpkg/base/stringrange.h b/toolsrc/include/vcpkg/base/stringrange.h new file mode 100644 index 000000000..94bd584af --- /dev/null +++ b/toolsrc/include/vcpkg/base/stringrange.h @@ -0,0 +1,33 @@ +#pragma once + +#include <vcpkg/base/optional.h> + +#include <string> +#include <vector> + +namespace vcpkg +{ + struct VcpkgStringRange + { + static std::vector<VcpkgStringRange> find_all_enclosed(const VcpkgStringRange& input, + const std::string& left_delim, + const std::string& right_delim); + + static VcpkgStringRange find_exactly_one_enclosed(const VcpkgStringRange& input, + const std::string& left_tag, + const std::string& right_tag); + + static Optional<VcpkgStringRange> find_at_most_one_enclosed(const VcpkgStringRange& input, + const std::string& left_tag, + const std::string& right_tag); + + VcpkgStringRange() = default; + VcpkgStringRange(const std::string& s); // Implicit by design + VcpkgStringRange(const std::string::const_iterator begin, const std::string::const_iterator end); + + std::string::const_iterator begin; + std::string::const_iterator end; + + std::string to_string() const; + }; +} diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 21e77aa52..e4ea44334 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -139,7 +139,6 @@ namespace vcpkg::Commands namespace Fetch { - std::vector<Toolset> find_toolset_instances_preferred_first(const VcpkgPaths& paths); fs::path get_tool_path(const VcpkgPaths& paths, const std::string& tool); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } diff --git a/toolsrc/include/vcpkg/visualstudio.h b/toolsrc/include/vcpkg/visualstudio.h new file mode 100644 index 000000000..b93b145d9 --- /dev/null +++ b/toolsrc/include/vcpkg/visualstudio.h @@ -0,0 +1,12 @@ +#pragma once
+
+#if defined(_WIN32)
+
+#include <vcpkg/vcpkgpaths.h>
+
+namespace vcpkg::VisualStudio
+{
+ std::vector<Toolset> find_toolset_instances_preferred_first(const VcpkgPaths& paths);
+}
+
+#endif
|
