Added bulk edit command #npceditmass <column-to-search> <column-search-value> <change-column> <change-value>

This commit is contained in:
Akkadius
2019-08-11 02:40:23 -05:00
parent e9cb8781bf
commit 1c6a76246f
4 changed files with 76 additions and 10 deletions
+16 -6
View File
@@ -27,6 +27,8 @@
#else
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#endif
#ifndef va_copy
@@ -119,19 +121,27 @@ std::vector<std::string> SplitString(const std::string &str, char delim) {
while(std::getline(ss, item, delim)) {
ret.push_back(item);
}
return ret;
}
static std::string implode(char *sep, std::vector<std::string> src)
std::string implode(std::string glue, std::vector<std::string> src)
{
std::ostringstream output;
if (src.empty()) {
return {};
}
std::ostringstream output;
std::vector<std::string>::iterator src_iter;
for (src_iter = src.begin(); src_iter != src.end(); src_iter++)
output << *src_iter << sep;
for (src_iter = src.begin(); src_iter != src.end(); src_iter++) {
output << *src_iter << glue;
}
return output.str();
std::string final_output = output.str();
final_output.resize (output.str().size () - glue.size());
return final_output;
}
std::string EscapeString(const std::string &s) {