Moved C++ tools out
This commit is contained in:
@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "VNSceneChangeEventParser.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
std::vector<std::string> VNSceneChangeEventParser::getRequiredAttributes() {
|
||||
return { "scene" };
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> VNSceneChangeEventParser::getOptionalAttributes() {
|
||||
return {};
|
||||
}
|
||||
|
||||
int32_t VNSceneChangeEventParser::onParse(
|
||||
Xml *node,
|
||||
std::map<std::string, std::string> values,
|
||||
struct VNSceneChangeEvent *out,
|
||||
std::string *error
|
||||
) {
|
||||
out->include = values["scene"] + ".hpp";
|
||||
|
||||
// Find last slash and take all string after that
|
||||
size_t lastSlash = values["scene"].find_last_of('/');
|
||||
if(lastSlash != std::string::npos) {
|
||||
out->scene = values["scene"].substr(lastSlash+1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user