mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 11:28:25 +00:00
Added bulk edit command #npceditmass <column-to-search> <column-search-value> <change-column> <change-value>
This commit is contained in:
+16
-6
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user