/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2020-09-30 * Changed: 2020-11-25 * * */ #include ls_std::XMLDocument::XMLDocument() : Class("XMLDocument") {} std::shared_ptr ls_std::XMLDocument::getDeclaration() { return this->declaration; } std::shared_ptr ls_std::XMLDocument::getRootElement() { return this->rootElement; } void ls_std::XMLDocument::setDeclaration(const std::shared_ptr &_declaration) { this->declaration = _declaration; } void ls_std::XMLDocument::setRootElement(const std::shared_ptr &_root) { this->rootElement = _root; } std::string ls_std::XMLDocument::toXML() { std::string xmlString {}; if(this->declaration != nullptr) { xmlString = this->declaration->toXML(); if(!xmlString.empty()) { xmlString += "\n"; } } return xmlString + this->rootElement->toXML(); }