Blender  V2.93
ExtraTags.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include <map>
24 #include <string>
25 #include <vector>
26 
29 class ExtraTags {
30  public:
32  ExtraTags(const std::string profile);
33 
35  virtual ~ExtraTags();
36 
38  bool addTag(std::string tag, std::string data);
39 
41  bool setData(std::string tag, short *data);
42 
44  bool setData(std::string tag, int *data);
45 
47  bool setData(std::string tag, float *data);
48 
50  bool setData(std::string tag, char *data);
51  std::string setData(std::string tag, std::string &data);
52 
54  bool isProfile(std::string profile);
55 
56  private:
58  ExtraTags(const ExtraTags &pre);
60  const ExtraTags &operator=(const ExtraTags &pre);
61 
63  std::string profile;
64 
66  std::map<std::string, std::string> tags;
67 
69  int asInt(std::string tag, bool *ok);
71  float asFloat(std::string tag, bool *ok);
73  std::string asString(std::string tag, bool *ok);
74 };
Class for saving <extra> tags for a specific UniqueId.
Definition: ExtraTags.h:29
ExtraTags(const std::string profile)
Definition: ExtraTags.cpp:29
virtual ~ExtraTags()
bool isProfile(std::string profile)
Definition: ExtraTags.cpp:37
bool setData(std::string tag, short *data)
Definition: ExtraTags.cpp:79
bool addTag(std::string tag, std::string data)
Definition: ExtraTags.cpp:42