LibUDB 1.0
Loading...
Searching...
No Matches
UDBElement.h
1/*
2 * Copyright (C) 2025 Yury Bobylev <bobilev_yury@mail.ru>
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation, version 3.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program. If not, see <https://www.gnu.org/licenses/>.
15 */
16#ifndef UDBELEMENT_H
17#define UDBELEMENT_H
18
19#include <string>
20#include <vector>
21
27class UDBElement
28{
29public:
30 UDBElement();
31
37 UDBElement(const UDBElement &other);
38
44 UDBElement(UDBElement &&other);
45
51 UDBElement &
52 operator=(const UDBElement &other);
53
59 UDBElement &
60 operator=(UDBElement &&other);
61
68 bool
69 operator==(const UDBElement &other) const;
70
77 bool
78 operator!=(const UDBElement &other) const;
79
84 void
85 writeToBuffer(std::vector<char> &buf);
86
96 size_t
97 readFromBuffer(const std::vector<char> &buf, const size_t &start_pos);
98
103 size_t
105
109 void
111
115 std::string id;
116
120 std::string content;
121
125 std::vector<UDBElement> subelements;
126};
127
128#endif // UDBELEMENT_H
UDBElement & operator=(const UDBElement &other)
operator =
std::string id
Elements identification value (if any).
Definition UDBElement.h:115
UDBElement(UDBElement &&other)
std::vector< UDBElement > subelements
Elements subelement (if any).
Definition UDBElement.h:125
size_t calculateWriteSize()
bool operator!=(const UDBElement &other) const
operator !=
void writeToBuffer(std::vector< char > &buf)
UDBElement(const UDBElement &other)
bool operator==(const UDBElement &other) const
operator ==
void shrinkToFit()
std::string content
Elements content (if any).
Definition UDBElement.h:120
UDBElement & operator=(UDBElement &&other)
operator =
size_t readFromBuffer(const std::vector< char > &buf, const size_t &start_pos)