Small html cleanup
This commit is contained in:
parent
c102ebb6da
commit
31b479e9f6
27 changed files with 330 additions and 252 deletions
|
@ -1,40 +1,43 @@
|
|||
#pragma once
|
||||
|
||||
#include "XmlAttribute.h"
|
||||
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
class XmlAttribute;
|
||||
using XmlAttributePtr = std::unique_ptr<XmlAttribute>;
|
||||
|
||||
class XmlElement
|
||||
{
|
||||
public:
|
||||
XmlElement(const std::string& tagName);
|
||||
virtual ~XmlElement() = default;
|
||||
virtual ~XmlElement();
|
||||
|
||||
static std::unique_ptr<XmlElement> Create(const std::string& tagName);
|
||||
|
||||
void AddAttribute(XmlAttributeUPtr attribute);
|
||||
void AddChild(std::unique_ptr<XmlElement> child);
|
||||
void addAttribute(XmlAttributePtr attribute);
|
||||
void addChild(std::unique_ptr<XmlElement> child);
|
||||
|
||||
std::string GetTagName() const;
|
||||
std::string GetText() const;
|
||||
XmlAttribute* GetAttribute(const std::string& attribute) const;
|
||||
XmlAttribute* GetAttribute(std::size_t index) const;
|
||||
std::size_t GetNumAttributes() const;
|
||||
const std::string& getTagName() const;
|
||||
const std::string& getText() const;
|
||||
XmlAttribute* getAttribute(const std::string& attribute) const;
|
||||
XmlAttribute* getAttribute(std::size_t index) const;
|
||||
std::size_t getNumAttributes() const;
|
||||
|
||||
std::size_t GetNumChildren() const;
|
||||
XmlElement* GetChild(std::size_t index) const;
|
||||
std::size_t getNumChildren() const;
|
||||
XmlElement* getChild(std::size_t index) const;
|
||||
|
||||
void SetText(const std::string& text);
|
||||
void SetTagName(const std::string& tagName);
|
||||
void setText(const std::string& text);
|
||||
void setTagName(const std::string& tagName);
|
||||
|
||||
protected:
|
||||
std::string mTagName;
|
||||
std::vector<XmlAttributeUPtr> mAttributes;
|
||||
std::vector<std::unique_ptr<XmlElement> > mChildren;
|
||||
std::string mText;
|
||||
|
||||
std::vector<XmlAttributePtr> mAttributes;
|
||||
std::vector<std::unique_ptr<XmlElement> > mChildren;
|
||||
};
|
||||
|
||||
using XmlElementPtr = std::shared_ptr<XmlElement>;
|
||||
using XmlElementUPtr = std::unique_ptr<XmlElement>;
|
||||
using XmlElementPtr = std::unique_ptr<XmlElement>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue