27 #include "../shared/cxx.h"
28 #include "../shared/shared.h"
39 mxmlElementSetAttr(parent, name, value);
64 mxmlElementSetAttr(parent, name, value ?
"true" :
"false");
113 snprintf(txt,
sizeof(txt),
"%f", value);
114 mxmlElementSetAttr(parent, name, txt);
209 snprintf(txt,
sizeof(txt),
"%ld", value);
210 mxmlElementSetAttr(parent, name, txt);
236 xmlNode_t* t = mxmlNewElement(parent, name);
251 xmlNode_t* t = mxmlNewElement(parent, name);
266 xmlNode_t* t = mxmlNewElement(parent, name);
279 return mxmlNewElement(parent,name);
290 const char* txt = mxmlElementGetAttr(parent, name);
310 const char* txt = mxmlElementGetAttr(parent, name);
324 const char* txt = mxmlElementGetAttr(parent, name);
338 const char* txt = mxmlElementGetAttr(parent, name);
352 const char* str = mxmlElementGetAttr(parent, name);
366 const char* txt = mxmlElementGetAttr(parent, name);
380 const char* txt = mxmlElementGetAttr(parent, name);
489 return mxmlFindElement(parent, parent, name,
nullptr,
nullptr, MXML_DESCEND_FIRST);
501 return mxmlFindElement(current, parent, name,
nullptr,
nullptr, MXML_NO_DESCEND);
511 const char*
type = mxmlElementGetAttr(node,
"type");
512 if (type ==
nullptr) {
513 #ifdef MXML_MAJOR_VERSION
514 type = mxmlGetElement(node);
516 type = node->value.element.name;
522 else if (
Q_streq(type,
"opaque"))
524 else if (
Q_streq(type,
"string"))
526 else if (
Q_streq(type,
"double"))
bool Q_strnull(const char *string)
xmlNode_t * XML_GetPos2(xmlNode_t *parent, const char *name, vec2_t pos)
retrieve the first Pos2 data from an XML Node
short XML_GetShort(xmlNode_t *parent, const char *name, const short defaultval)
retrieve a Short attribute from an XML Node
QGL_EXTERN GLint GLenum type
void XML_AddStringValue(xmlNode_t *parent, const char *name, const char *value)
add a non-empty String attribute to the XML Node
float XML_GetFloat(xmlNode_t *parent, const char *name, const float defaultval)
retrieve a Float attribute from an XML Node
void XML_AddDoubleValue(xmlNode_t *parent, const char *name, double value)
add a non-zero Double attribute to the XML Node
int XML_GetInt(xmlNode_t *parent, const char *name, const int defaultval)
retrieve an Int attribute from an XML Node
double XML_GetDouble(xmlNode_t *parent, const char *name, const double defaultval)
retrieve a Double attribute from an XML Node
void XML_AddDate(xmlNode_t *parent, const char *name, const int day, const int sec)
add a date data to the XML Tree
void XML_AddPos3(xmlNode_t *parent, const char *name, const vec3_t pos)
add a Pos3 data to the XML Tree
void XML_AddFloatValue(xmlNode_t *parent, const char *name, float value)
add a non-zero Float attribute to the XML Node
xmlNode_t * XML_GetPos3(xmlNode_t *parent, const char *name, vec3_t pos)
retrieve the first Pos3 data from an XML Node
xmlNode_t * XML_GetNextPos3(xmlNode_t *actual, xmlNode_t *parent, const char *name, vec3_t pos)
retrieve the next Pos3 data from an XML Node
void XML_AddPos2(xmlNode_t *parent, const char *name, const vec2_t pos)
add a Pos2 data to the XML Tree
const char * XML_GetString(xmlNode_t *parent, const char *name)
retrieve a String attribute from an XML Node
xmlNode_t * XML_AddNode(xmlNode_t *parent, const char *name)
add a new node to the XML tree
void XML_AddInt(xmlNode_t *parent, const char *name, int value)
add an Int attribute to the XML Node
void XML_AddString(xmlNode_t *parent, const char *name, const char *value)
add a String attribute to the XML Node
void XML_AddFloat(xmlNode_t *parent, const char *name, float value)
add a Float attribute to the XML Node
void XML_AddBool(xmlNode_t *parent, const char *name, bool value)
add a Boolean attribute to the XML Node
void XML_AddLong(xmlNode_t *parent, const char *name, long value)
add a Long attribute to the XML Node
void XML_AddShortValue(xmlNode_t *parent, const char *name, short value)
add a non-zero Short attribute to the XML Node
void XML_AddShort(xmlNode_t *parent, const char *name, short value)
add a Short attribute to the XML Node
long XML_GetLong(xmlNode_t *parent, const char *name, const long defaultval)
retrieve a Long attribute from an XML Node
bool XML_GetBool(xmlNode_t *parent, const char *name, const bool defaultval)
retrieve a Boolean attribute from an XML Node
void XML_AddBoolValue(xmlNode_t *parent, const char *name, bool value)
add a non-false Boolean attribute to the XML Node
void XML_AddByte(xmlNode_t *parent, const char *name, byte value)
add a Byte attribute to the XML Node
static mxml_type_t mxml_ufo_type_cb(xmlNode_t *node)
callback function for parsing the node tree
xmlNode_t * XML_GetDate(xmlNode_t *parent, const char *name, int *day, int *sec)
retrieve the date data from an XML Node
xmlNode_t * XML_GetNextPos2(xmlNode_t *actual, xmlNode_t *parent, const char *name, vec2_t pos)
retrieve the next Pos2 data from an XML Node
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
void XML_AddDouble(xmlNode_t *parent, const char *name, double value)
add a Double attribute to the XML Node
xmlNode_t * XML_GetNode(xmlNode_t *parent, const char *name)
Get first Node of the XML tree by name.
void XML_AddIntValue(xmlNode_t *parent, const char *name, int value)
add a non-zero Int attribute to the XML Node
void XML_AddByteValue(xmlNode_t *parent, const char *name, byte value)
add a non-zero Byte attribute to the XML Node
xmlNode_t * XML_GetNextNode(xmlNode_t *current, xmlNode_t *parent, const char *name)
Get next Node of the XML tree by name.
void XML_AddLongValue(xmlNode_t *parent, const char *name, long value)
add a non-zero Long attribute to the XML Node
xmlNode_t * XML_Parse(const char *buffer)