-
Notifications
You must be signed in to change notification settings - Fork 0
/
TagComment.h
59 lines (35 loc) · 1.45 KB
/
TagComment.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// Created by Maxime on 16/05/2018.
//
#ifndef XMLCOMMENT_H
#define XMLCOMMENT_H
#include "Xml.h"
#include "XmlException.h"
class TagComment : public Xml{
private:
static XmlType TYPE;
std::string _comment;
public:
TagComment() = default;
~TagComment() = default;
const XmlType &getType() const override;
void setName(const std::string &value) override;
void removeAttribute(const std::string &attr) override;
void setAttribute(const std::string &attr, const std::string &value) override;
void setText(const std::string &value) override;
void addXml(std::unique_ptr<Xml> xml) override;
void removeXml(size_t index) override;
void replaceXml(size_t index, std::unique_ptr<Xml> xml) override;
const std::string &getName() const override;
bool isAttribute(const std::string& name) const override {
throw XmlWrongGetException(TYPE, "XmlText can't use 'isAttribute");
}
const std::string &getAttributeValueOrElse(const std::string &attr, const std::string &other) const override;
const std::string &getText() const override;
size_t getXmlCount() const override;
const Xml *getXml(size_t index) const override;
Xml *getXml(size_t index) override;
virtual std::string toString(const std::string& indent) const;
bool save(std::ofstream &stream, const std::string& indent) const override;
};
#endif //XMLCOMMENT_H