OneLevelXmlOpr/public_def.cpp

25 lines
684 B
C++

#include "public_def.h"
#include <QMessageBox>
std::vector<std::string> splitString(const std::string& input, const std::string& delimiter) {
std::vector<std::string> tokens;
size_t pos = 0;
std::string backup = input;
std::string token;
while ((pos = backup.find(delimiter)) != std::string::npos) {
token = backup.substr(0, pos);
tokens.push_back(token);
backup.erase(0, pos + delimiter.length());
}
// Push the remaining part after the last delimiter
tokens.push_back(backup);
return tokens;
}
void CUtil::msg(QWidget* parent, const QString& content)
{
QMessageBox::information(parent, u8"提示", content);
}