summaryrefslogtreecommitdiff
path: root/src/util.h
blob: eeb3206a6e033477609e0ea31a2b2e50b664b0f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// -*- c++ -*-
// Distributed under the BSD 2-Clause License.
// See accompanying file LICENSE for details.
#pragma once

#include "ctor.h"

#include <string>
#include <filesystem>

std::string to_lower(const std::string& str);

std::string readFile(const std::string& fileName);
std::vector<std::string> readDeps(const std::string& depFile);
ctor::language languageFromExtension(const std::filesystem::path& file);
std::string cleanUp(const std::string& path);

template<typename T>
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();

std::string locate(const std::string& app,
                   const std::vector<std::string>& paths,
                   const std::string& arch = {});