Dawn/archive/dawntools/vnscenetool/events/VNTextEventParser.hpp
2023-10-31 21:15:03 -05:00

42 lines
1.1 KiB
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 {
struct VNText {
std::string language;
std::string text;
};
struct VNTextEvent {
std::vector<VNText> texts;
};
class VNTextParser : public XmlParser<struct VNText> {
protected:
std::vector<std::string> getRequiredAttributes() override;
std::map<std::string, std::string> getOptionalAttributes() override;
int32_t onParse(
Xml *node,
std::map<std::string, std::string> values,
struct VNText *out,
std::string *error
) override;
};
class VNTextEventParser : public XmlParser<struct VNTextEvent> {
protected:
std::vector<std::string> getRequiredAttributes() override;
std::map<std::string, std::string> getOptionalAttributes() override;
int32_t onParse(
Xml *node,
std::map<std::string, std::string> values,
struct VNTextEvent *out,
std::string *error
) override;
};
}