ccls/utils.h
2017-03-03 17:45:20 -08:00

22 lines
713 B
C++

#pragma once
#include <string>
#include <vector>
#include <memory>
std::vector<std::string> GetFilesInFolder(std::string folder);
std::vector<std::string> ReadLines(std::string filename);
void ParseTestExpectation(std::string filename, std::string* expected_output);
void Fail(const std::string& message);
void WriteToFile(const std::string& filename, const std::string& content);
// note: this implementation does not disable this overload for array types
// See http://en.cppreference.com/w/cpp/memory/unique_ptr/make_unique#Possible_Implementatiog
template<typename T, typename... Args>
std::unique_ptr<T> MakeUnique(Args&&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}