6#include "vsistruct.hpp"
16 TagInfo(TagInfo&& other) noexcept
18 fieldType(other.fieldType),
19 valueType(other.valueType),
20 extendedType(other.extendedType),
21 secondTag(other.secondTag),
22 extended(other.extended),
23 dataSize(other.dataSize),
24 name(std::move(other.name)),
25 children(std::move(other.children)),
26 value(std::move(other.value)) {
29 TagInfo& operator=(TagInfo&& other)
noexcept {
33 fieldType = other.fieldType;
34 valueType = other.valueType;
35 extendedType = other.extendedType;
36 secondTag = other.secondTag;
37 extended = other.extended;
38 dataSize = other.dataSize;
39 name = std::move(other.name);
40 children = std::move(other.children);
41 value = std::move(other.value);
46 typedef std::list<TagInfo> TagInfos;
47 typedef TagInfos::const_iterator const_iterator;
48 typedef TagInfos::iterator iterator;
50 TagInfo(
const TagInfo& other) {
53 TagInfo& operator=(
const TagInfo& other) {
57 iterator end() {
return children.end(); }
58 iterator begin() {
return children.begin(); }
59 const_iterator end()
const {
return children.end(); }
60 const_iterator begin()
const {
return children.begin(); }
61 const_iterator find(
int tag) {
62 return std::find_if(children.begin(), children.end(), [tag](
const TagInfo& info) {
63 return info.tag == tag;
66 void addChild(
const TagInfo& info) {
67 children.push_back(info);
69 void setValue(
const std::string& srcValue) {
70 this->value = srcValue;
72 void copy(
const TagInfo& other) {
74 fieldType = other.fieldType;
75 valueType = other.valueType;
76 extendedType = other.extendedType;
77 secondTag = other.secondTag;
78 extended = other.extended;
79 dataSize = other.dataSize;
82 children.assign(other.children.begin(), other.children.end());
85 return children.empty();
87 const TagInfo* findChild(
int srcTag)
const {
88 auto it = std::find_if(children.begin(), children.end(), [srcTag](
const TagInfo& info) {
89 return info.tag == srcTag;
91 if (it == children.end()) {
96 const_iterator findNextChild(
int srcTag, const_iterator begin)
const {
97 return std::find_if(begin, children.end(), [srcTag](
const TagInfo& info) {
98 return info.tag == srcTag;
101 const vsi::TagInfo* findChild(
const std::vector<int>& path)
const {
102 const TagInfo* current =
this;
103 for (
const int srcTag : path) {
104 current = current->findChild(srcTag);
112 int tag = Tag::UNKNOWN;
114 ValueType valueType = ValueType::UNSET;
115 ExtendedType extendedType = ExtendedType::UNSET;
117 bool extended =
false;
118 int32_t dataSize = 0;
Definition: exceptions.hpp:12