Let's make (git) history!

This commit is contained in:
2018-11-03 17:12:20 +01:00
commit 3bfebfe8a8
212 changed files with 11970 additions and 0 deletions

26
varreplacer.h Normal file
View File

@@ -0,0 +1,26 @@
#ifndef VARPARSER_H
#define VARPARSER_H
#include <string>
#include <string_view>
#include <functional>
#include <map>
#include <tuple>
class Varreplacer
{
private:
std::string_view content;
std::string_view prefix;
std::map<std::string_view, std::function<std::string(std::string_view)>> resolverFunctionsMap;
std::map<std::string_view, std::string> keyValues;
std::tuple<std::string_view, std::string_view> extractKeyAndValue(std::string_view var);
std::string makeReplacement(std::string_view varkeyvalue);
public:
Varreplacer(std::string_view prefix);
void addKeyValue(std::string_view key, std::string value);
void addResolver(std::string_view key, std::function<std::string(std::string_view)> resolver);
std::string parse(std::string_view content);
};
#endif // VARPARSER_H