feat(scripting): add script add-component api
This commit is contained in:
@@ -15,14 +15,20 @@ std::string ToStdString(const Containers::String& value) {
|
||||
|
||||
std::vector<std::string> SplitMaterialPaths(const std::string& value) {
|
||||
std::vector<std::string> paths;
|
||||
std::stringstream stream(value);
|
||||
std::string item;
|
||||
while (std::getline(stream, item, '|')) {
|
||||
paths.push_back(item);
|
||||
if (value.empty()) {
|
||||
return paths;
|
||||
}
|
||||
|
||||
if (value.empty()) {
|
||||
paths.clear();
|
||||
size_t start = 0;
|
||||
while (true) {
|
||||
const size_t separator = value.find('|', start);
|
||||
if (separator == std::string::npos) {
|
||||
paths.push_back(value.substr(start));
|
||||
break;
|
||||
}
|
||||
|
||||
paths.push_back(value.substr(start, separator - start));
|
||||
start = separator + 1;
|
||||
}
|
||||
|
||||
return paths;
|
||||
|
||||
Reference in New Issue
Block a user