diff options
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -3,14 +3,17 @@ // See accompanying file LICENSE for details. #pragma once -#include "libctor.h" +#include "ctor.h" #include <string> #include <filesystem> +#include <cstdlib> + +std::string to_lower(const std::string& str); std::string readFile(const std::string& fileName); std::vector<std::string> readDeps(const std::string& depFile); -Language languageFromExtension(const std::filesystem::path& file); +ctor::language languageFromExtension(const std::filesystem::path& file); std::string cleanUp(const std::string& path); template<typename T> @@ -18,3 +21,11 @@ void append(T& a, const T& b) { a.insert(a.end(), b.begin(), b.end()); } + +std::string esc(const std::string& in); + +std::vector<std::string> get_paths(const std::string& path_env = std::getenv("PATH")); + +std::string locate(const std::string& app, + const std::vector<std::string>& paths, + const std::string& arch = {}); |