AGX Dynamics  2.37.2.0
Xml.h File Reference
#include <agx/String.h>
#include <agx/Name.h>
#include <agx/debug.h>
#include <tinyxml/tinyxml.h>

Go to the source code of this file.

Namespaces

 agx
 The agx namespace contains the dynamics/math part of the AGX Dynamics API.
 

Macros

#define AGX_XML_VERIFY_BUFFER_SIZE   8192
 
#define agxXmlAbort(element, format, ...)
 
#define agxXmlVerify(x, element)
 
#define agxXmlVerify1(x, element, msg)
 
#define agxXmlVerifyN(x, element, format, ...)
 

Functions

template<typename T >
T agx::parseAttribute (const TiXmlElement *element, const char *attributeName)
 
template<>
Name agx::parseAttribute< Name > (const TiXmlElement *element, const char *attributeName)
 
template<>
String agx::parseAttribute< String > (const TiXmlElement *element, const char *attributeName)
 

Macro Definition Documentation

◆ AGX_XML_VERIFY_BUFFER_SIZE

#define AGX_XML_VERIFY_BUFFER_SIZE   8192

Definition at line 60 of file Xml.h.

◆ agxXmlAbort

#define agxXmlAbort (   element,
  format,
  ... 
)
Value:
{ \
agx_snprintf(__str, AGX_XML_VERIFY_BUFFER_SIZE, format, ##__VA_ARGS__); \
std::stringstream __stream; \
__stream << "[" << __FILE__ << ":" << __LINE__ << "] XML error: " << __str << ". Error at row " << (element)->Row() << std::endl; \
__stream << "File: " << (element)->GetDocument()->Value() << std::endl; \
__stream << "==============================================================================" << std::endl; \
(element)->Print(__stream, 0); \
__stream << std::endl; \
__stream << "==============================================================================" << std::endl; \
const std::string& __string = __stream.str(); \
std::cerr << __string << std::endl; \
agxThrow std::runtime_error(__string); \
}
#define AGX_XML_VERIFY_BUFFER_SIZE
Definition: Xml.h:60

Definition at line 79 of file Xml.h.

◆ agxXmlVerify

#define agxXmlVerify (   x,
  element 
)
Value:
if (!(x)) \
{ \
if (!element) \
agxThrow std::runtime_error(std::string("Error in xml-check: Both x and element are nullptr.")); \
std::stringstream __stream; \
__stream << "[" << __FILE__ << ":" << __LINE__ << "] XML error at row " << (element)->Row() << std::endl; \
__stream << "File: " << (element)->GetDocument()->Value() << std::endl; \
__stream << "==============================================================================" << std::endl; \
(element)->Print(__stream, 0); \
__stream << std::endl; \
__stream << "==============================================================================" << std::endl; \
const std::string& __string = __stream.str(); \
std::cerr << __string << std::endl; \
agxThrow std::runtime_error(__string); \
}

Definition at line 28 of file Xml.h.

◆ agxXmlVerify1

#define agxXmlVerify1 (   x,
  element,
  msg 
)
Value:
if (!(x)) \
{ \
std::stringstream __stream; \
__stream << "[" << __FILE__ << ":" << __LINE__ << "] XML error: " << msg << ". Error at row " << (element)->Row() << std::endl; \
__stream << "File: " << (element)->GetDocument()->Value() << std::endl; \
__stream << "==============================================================================" << std::endl; \
(element)->Print(__stream, 0); \
__stream << std::endl; \
__stream << "==============================================================================" << std::endl; \
const std::string& __string = __stream.str(); \
std::cerr << __string << std::endl; \
agxThrow std::runtime_error(__string); \
}

Definition at line 45 of file Xml.h.

◆ agxXmlVerifyN

#define agxXmlVerifyN (   x,
  element,
  format,
  ... 
)
Value:
if (!(x)) \
{ \
agx_snprintf(__str, AGX_XML_VERIFY_BUFFER_SIZE, format, ##__VA_ARGS__); \
std::stringstream __stream; \
__stream << "[" << __FILE__ << ":" << __LINE__ << "] XML error: " << __str << ". Error at row " << (element)->Row() << std::endl; \
__stream << "File: " << (element)->GetDocument()->Value() << std::endl; \
__stream << "==============================================================================" << std::endl; \
(element)->Print(__stream, 0); \
__stream << std::endl; \
__stream << "==============================================================================" << std::endl; \
const std::string& __string = __stream.str(); \
std::cerr << __string << std::endl; \
agxThrow std::runtime_error(__string); \
}
#define AGX_XML_VERIFY_BUFFER_SIZE
Definition: Xml.h:60

Definition at line 61 of file Xml.h.

Referenced by agx::parseAttribute(), agx::parseAttribute< Name >(), and agx::parseAttribute< String >().