mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
Add helper lib for strings and vectors
This commit is contained in:
parent
6ef9740db9
commit
2bb7fcfcc6
10 changed files with 168 additions and 123 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue