UNIVERSAL-UPDATER IS BACK! Lmao.
This commit is contained in:
parent
f64ab53907
commit
c548cca57a
35 changed files with 25521 additions and 0 deletions
18
source/utils/stringutils.cpp
Normal file
18
source/utils/stringutils.cpp
Normal 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());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue