Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List

TinyXmlPlus.h

00001 /*
00002 Copyright 2003 - 2005 Elliott Kleinrock, Dan Neely, Kurt W. Over, Damon Domjan
00003 
00004 This file is part of FreeStars, a free clone of the Stars! game.
00005 
00006 FreeStars is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 2 of the License, or
00009 (at your option) any later version.
00010 
00011 FreeStars 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 FreeStars; if not, write to the Free Software
00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 The full GPL Copyright notice should be in the file COPYING.txt
00021 
00022 Contact:
00023 Email Elliott at 9jm0tjj02@sneakemail.com
00024 */
00025 
00026 #if !defined(TinyXmlPlus_h)
00027 #define TinyXmlPlus_h
00028 
00029 #if !defined(TIXML_USE_STL)
00030 #define TIXML_USE_STL
00031 #endif
00032 
00033 class TiXmlNode;
00034 
00035 #include <string>
00036 using namespace std;
00037 
00038 inline string Long2String(long x)
00039 {
00040         char buf[16];
00041         sprintf(buf, "%d", x);
00042         string s = buf;
00043         return s;
00044 }
00045 
00046 inline string Float2String(double x)
00047 {
00048         string s(16, '\0');
00049         sprintf(&s[0], "%g", x);
00050         return s;
00051 }
00052 
00053 extern const char * GetString(const TiXmlNode * node);
00054 extern long GetLong(const TiXmlNode * node, long def = 0);
00055 extern double GetDouble(const TiXmlNode * node, double def = 0.0);
00056 extern bool GetBool(const TiXmlNode * node);
00057 
00058 extern TiXmlElement * AddString(TiXmlNode * node, const char * name, const char * str);
00059 extern TiXmlElement * AddLong(TiXmlNode * node, const char * name, long num);
00060 extern TiXmlElement * AddDouble(TiXmlNode * node, const char * name, double num);
00061 extern TiXmlElement * AddBool(TiXmlNode * node, const char * name, bool val);
00062 
00063 #endif // !defined(TinyXmlPlus_h)

Generated on Mon Aug 8 21:33:45 2005 for Freestars by  doxygen 1.4.2-20050421