1 /* 2 Copyright (C) 2002-2013 UFO: Alien Invasion. 3 4 This program is free software; you can redistribute it and/or 5 modify it under the terms of the GNU General Public License 6 as published by the Free Software Foundation; either version 2 7 of the License, or (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 13 See the GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 19 */ 20 21 #pragma once 22 23 #include <mxml.h> 24 #define xmlNode_t mxml_node_t 25 #include "../shared/mathlib.h" 26 #include "../shared/ufotypes.h" 27 28 void XML_AddString(xmlNode_t* parent, const char* name, const char* value); 29 void XML_AddBool(xmlNode_t* parent, const char* name, bool value); 30 void XML_AddFloat(xmlNode_t* parent, const char* name, float value); 31 void XML_AddDouble(xmlNode_t* parent, const char* name, double value); 32 void XML_AddByte(xmlNode_t* parent, const char* name, byte value); 33 void XML_AddShort(xmlNode_t* parent, const char* name, short value); 34 void XML_AddInt(xmlNode_t* parent, const char* name, int value); 35 void XML_AddLong(xmlNode_t* parent, const char* name, long value); 36 void XML_AddPos3(xmlNode_t* parent, const char* name, const vec3_t pos); 37 void XML_AddPos2(xmlNode_t* parent, const char* name, const vec2_t pos); 38 void XML_AddDate(xmlNode_t* parent, const char* name, const int day, const int sec); 39 40 void XML_AddStringValue(xmlNode_t* parent, const char* name, const char* value); 41 void XML_AddBoolValue(xmlNode_t* parent, const char* name, bool value); 42 void XML_AddFloatValue(xmlNode_t* parent, const char* name, float value); 43 void XML_AddDoubleValue(xmlNode_t* parent, const char* name, double value); 44 void XML_AddByteValue(xmlNode_t* parent, const char* name, byte value); 45 void XML_AddShortValue(xmlNode_t* parent, const char* name, short value); 46 void XML_AddIntValue(xmlNode_t* parent, const char* name, int value); 47 void XML_AddLongValue(xmlNode_t* parent, const char* name, long value); 48 49 xmlNode_t* XML_AddNode(xmlNode_t* parent, const char* name); 50 51 bool XML_GetBool(xmlNode_t* parent, const char* name, const bool defaultval); 52 int XML_GetInt(xmlNode_t* parent, const char* name, const int defaultval); 53 short XML_GetShort(xmlNode_t* parent, const char* name, const short defaultval); 54 long XML_GetLong(xmlNode_t* parent, const char* name, const long defaultval); 55 const char* XML_GetString(xmlNode_t* parent, const char* name); 56 float XML_GetFloat(xmlNode_t* parent, const char* name, const float defaultval); 57 double XML_GetDouble(xmlNode_t* parent, const char* name, const double defaultval); 58 xmlNode_t* XML_GetPos2(xmlNode_t* parent, const char* name, vec2_t pos); 59 xmlNode_t* XML_GetNextPos2(xmlNode_t* actual, xmlNode_t* parent, const char* name, vec2_t pos); 60 xmlNode_t* XML_GetPos3(xmlNode_t* parent, const char* name, vec3_t pos); 61 xmlNode_t* XML_GetNextPos3(xmlNode_t* actual, xmlNode_t* parent, const char* name, vec3_t pos); 62 xmlNode_t* XML_GetDate(xmlNode_t* parent, const char* name, int* day, int* sec); 63 64 xmlNode_t* XML_GetNode(xmlNode_t* parent, const char* name); 65 xmlNode_t* XML_GetNextNode(xmlNode_t* current, xmlNode_t* parent, const char* name); 66 67 xmlNode_t* XML_Parse(const char* buffer); 68