mcpp index

compat.pugixml

#include

Light-weight, simple and fast XML parser for C++ with XPath support

#include <pugixml.hpp>
mcpp add compat.pugixml@1.16

Usage

From this repository's own test project — built and run by CI, not written for the website.

#include <cstdio>
#include <sstream>
#include <string>

#include <pugixml.hpp>

static_assert(PUGIXML_VERSION == 1160, "expected pugixml 1.16 headers");

int main() {
    bool ok = true;

    const char *xml = R"(<?xml version="1.0" encoding="UTF-8"?>
<catalog>
  <book id="1" price="19.99"><title>Alpha</title></book>
  <book id="2" price="29.50"><title>Beta</title></book>
</catalog>)";

    pugi::xml_document doc;
    pugi::xml_parse_result res = doc.load_string(xml);
    if (!res) {
        std::fprintf(stderr, "pugixml load_string failed: %s\n", res.description());
        return 1;
// …

tests/examples/pugixml/tests/test_pugixml.cpp · project tests/examples/pugixml

Build

targets
pugixml (lib)
language
c++23
import std
no
include dirs
*/src

Sources (1)

  • */src/pugixml.cpp

Versions

VersionPlatforms Mirrorssha256
1.16 latest LinuxWindowsmacOS CN GLOBAL 357bcab8877d…