Dawn/archive/dawntools/util/parser/SceneCodeParser.hpp
2023-10-31 21:15:03 -05:00

33 lines
780 B
C++

// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "util/XmlParser.hpp"
namespace Dawn {
enum SceneCodeType {
SCENE_CODE_TYPE_PROPERTIES,
SCENE_CODE_TYPE_INIT,
SCENE_CODE_TYPE_INCLUDE
};
struct SceneCode {
enum SceneCodeType codeType;
std::string code;
};
class SceneCodeParser : public XmlParser<struct SceneCode> {
public:
virtual std::vector<std::string> getRequiredAttributes();
virtual std::map<std::string, std::string> getOptionalAttributes();
virtual int32_t onParse(
Xml *node,
std::map<std::string, std::string> values,
struct SceneCode *out,
std::string *error
);
};
}