core: port tag-list to C++

Also adds a new test, which tests merging of two tag-lists.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-29 17:57:48 +02:00 committed by bstoeger
parent 640ecb345b
commit f18acf6fb9
25 changed files with 195 additions and 227 deletions

View file

@ -691,7 +691,7 @@ static void smtk_parse_relations(MdbHandle *mdb, struct dive *dive, char *dive_i
if (str.empty())
continue;
if (tag)
taglist_add_tag(&dive->tag_list, str.c_str());
taglist_add_tag(dive->tags, str);
else
concat(tmp, ", ", str);
if (str.find("SCR") != std::string::npos)
@ -717,7 +717,7 @@ static void smtk_parse_other(struct dive *dive, const std::vector<std::string> &
const std::string &str = list[i];
if (!str.empty()) {
if (tag)
taglist_add_tag(&dive->tag_list, str.c_str());
taglist_add_tag(dive->tags, str);
else
concat(&dive->notes, "\n", format_string_std("Smartrak %s: %s", data_name, str.c_str()));
}