|
Blender
V2.59
|
00001 /* 00002 * $Id: ExtraTags.h 35897 2011-03-30 10:51:01Z jesterking $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * Contributor(s): Nathan Letwory. 00021 * 00022 * ***** END GPL LICENSE BLOCK ***** 00023 */ 00024 00029 #include <string> 00030 #include <map> 00031 #include <vector> 00032 00035 class ExtraTags 00036 { 00037 public: 00039 ExtraTags(const std::string profile); 00040 00042 virtual ~ExtraTags(); 00043 00045 bool addTag(std::string tag, std::string data); 00046 00048 void setData(std::string tag, short *data); 00049 00051 void setData(std::string tag, int *data); 00052 00054 void setData(std::string tag, float *data); 00055 00057 void setData(std::string tag, char *data); 00058 00060 bool isProfile(std::string profile); 00061 00062 private: 00064 ExtraTags( const ExtraTags& pre ); 00066 const ExtraTags& operator= ( const ExtraTags& pre ); 00067 00069 std::string profile; 00070 00072 std::map<std::string, std::string> tags; 00073 00075 int asInt(std::string tag, bool *ok); 00077 float asFloat(std::string tag, bool *ok); 00079 std::string asString(std::string tag, bool *ok); 00080 };