Use std::vector<string> instead of QStringList in main()

In an effort to convert core to C++ structures.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-03-25 10:58:27 +01:00 committed by bstoeger
parent c6cd10a43f
commit 4af2ec88bd
8 changed files with 80 additions and 58 deletions

View file

@ -0,0 +1,17 @@
// SPDX-License-Identifier: GPL-2.0
#include "subsurface-string.h"
std::string join(const std::vector<std::string> &l, const std::string &separator, bool skip_empty)
{
std::string res;
bool first = true;
for (const std::string &s: l) {
if (skip_empty && l.empty())
continue;
if (!first)
res += separator;
res += s;
first = false;
}
return res;
}