// Copyright (c) 2023 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #pragma once #include "common.hpp" namespace Dawn { struct LabelInfo { std::string text = ""; std::string fontSize = ""; }; class LabelParser : public XmlParser { protected: std::vector getRequiredAttributes() { return std::vector(); } std::map getOptionalAttributes() { return { { "fontSize", "" } }; } int32_t onParse( Xml *node, std::map values, struct LabelInfo *out, std::string *error ) { int32_t ret = 0; if(values["fontSize"].size() > 0) { out->fontSize = values["fontSize"]; } if(node->value.size() > 0) { out->text = node->value; } return ret; } }; }