UNIVERSAL-UPDATER IS BACK! Lmao.

This commit is contained in:
VoltZ 2019-10-31 03:23:05 +01:00 committed by GitHub
commit c548cca57a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 25521 additions and 0 deletions

View file

@ -0,0 +1,18 @@
#include "utils/stringutils.hpp"
bool matchPattern(std::string pattern, std::string tested)
{
std::regex patternRegex(pattern);
return regex_match(tested, patternRegex);
}
std::string StringUtils::format(const std::string& fmt_str, ...)
{
va_list ap;
char* fp = NULL;
va_start(ap, fmt_str);
vasprintf(&fp, fmt_str.c_str(), ap);
va_end(ap);
std::unique_ptr<char, decltype(free)*> formatted(fp, free);
return std::string(formatted.get());
}