summary refs log tree commit diff stats
path: root/src/xml.cpp
blob: f6f60ea596bf735781e5e9973ad9c9c65b81cef2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "xml.h"
#include <stdexcept>

xmlChar* getProp(xmlNodePtr node, const char* attr)
{
  xmlChar* key = xmlGetProp(node, reinterpret_cast<const xmlChar*>(attr));
  if (key == nullptr)
  {
    throw std::invalid_argument("Error parsing XML file");
  }

  return key;
}