Add helper lib for strings and vectors

This commit is contained in:
Vyn 2024-04-12 20:58:13 +02:00
parent 6ef9740db9
commit 2bb7fcfcc6
10 changed files with 168 additions and 123 deletions

View file

@ -6,6 +6,7 @@
#include "TodoMd.h"
#include "TaskItem.h"
#include "cpp-utils/vector.h"
namespace mirai {
@ -50,7 +51,7 @@ namespace mirai {
while (std::regex_search(metadata, matches, regex))
{
if (std::find(tags.begin(), tags.end(), matches[0]) == tags.end()) {
if (!vectorUtils::contains(tags, matches[0].str())) {
tags.push_back(matches[0]);
}
metadata = matches.suffix();
@ -97,8 +98,7 @@ namespace mirai {
/*std::cout << "M 6 " << matches[6] << std::endl;*/
/*std::cout << "M 7 " << matches[7] << std::endl;*/
std::string text = matches[5];
trim(text);
std::string text = stringUtils::trim(matches[5]);
TaskItem taskItem = {
.text = text,