6#include "vsistruct.hpp"
17 TagInfo(TagInfo&& other) noexcept
19 fieldType(other.fieldType),
20 valueType(other.valueType),
21 extendedType(other.extendedType),
22 secondTag(other.secondTag),
23 extended(other.extended),
24 dataSize(other.dataSize),
25 name(std::move(other.name)),
26 children(std::move(other.children)),
27 value(std::move(other.value)) {
30 TagInfo& operator=(TagInfo&& other)
noexcept {
34 fieldType = other.fieldType;
35 valueType = other.valueType;
36 extendedType = other.extendedType;
37 secondTag = other.secondTag;
38 extended = other.extended;
39 dataSize = other.dataSize;
40 name = std::move(other.name);
41 children = std::move(other.children);
42 value = std::move(other.value);
47 typedef std::list<TagInfo> TagInfos;
48 typedef TagInfos::const_iterator const_iterator;
49 typedef TagInfos::iterator iterator;
51 TagInfo(
const TagInfo& other) {
54 TagInfo& operator=(
const TagInfo& other) {
58 iterator end() {
return children.end(); }
59 iterator begin() {
return children.begin(); }
60 const_iterator end()
const {
return children.end(); }
61 const_iterator begin()
const {
return children.begin(); }
62 const_iterator find(
int tag) {
63 return std::find_if(children.begin(), children.end(), [tag](
const TagInfo& info) {
64 return info.tag == tag;
67 void addChild(
const TagInfo& info) {
68 children.push_back(info);
70 void setValue(
const std::string& srcValue) {
71 this->value = srcValue;
73 void copy(
const TagInfo& other) {
75 fieldType = other.fieldType;
76 valueType = other.valueType;
77 extendedType = other.extendedType;
78 secondTag = other.secondTag;
79 extended = other.extended;
80 dataSize = other.dataSize;
83 children.assign(other.children.begin(), other.children.end());
86 return children.empty();
88 const TagInfo* findChild(
int srcTag)
const {
89 auto it = std::find_if(children.begin(), children.end(), [srcTag](
const TagInfo& info) {
90 return info.tag == srcTag;
92 if (it == children.end()) {
97 const_iterator findNextChild(
int srcTag, const_iterator begin)
const {
98 return std::find_if(begin, children.end(), [srcTag](
const TagInfo& info) {
99 return info.tag == srcTag;
102 const vsi::TagInfo* findChild(
const std::vector<int>& path)
const {
103 const TagInfo* current =
this;
104 for (
const int srcTag : path) {
105 current = current->findChild(srcTag);
113 const vsi::TagInfo* findChildRecursively(
const int tag)
const {
114 for (
auto& child : children) {
115 if (child.tag == tag) {
118 if (
const TagInfo* found = child.findChildRecursively(tag)) {
125 int tag = Tag::UNKNOWN;
127 ValueType valueType = ValueType::UNSET;
128 ExtendedType extendedType = ExtendedType::UNSET;
130 bool extended =
false;
131 int32_t dataSize = 0;
Definition: exceptions.hpp:15