Go to file
Eli Schwartz 2ae2ef4e4e
add meson build support
https://mesonbuild.com/

This should be feature-comparable with the cmake build (it even
generates *-config.cmake files for installation, if cmake is installed
to acquire the template). It supports all the major OSes, including
macOS xcode and Windows visual studio support.

meson also comes with some unique advantages. e.g. its builtin
pkg-config generator module allows building third-party projects against
an uninstalled developer build using pkg-config *-uninstalled.pc
support.

Also, and mainly, projects which use meson can make use of meson's
subproject mechanism which allows installing a foo.wrap file into the
project, after which dependency lookups for "foo" can retrieve it as an
external project and build it in a single configure/compile process.
This is very handy for building standalone executables, and somewhat
invaluable on platforms that don't have a usable package manager.

Documentation: https://mesonbuild.com/Wrap-dependency-system-manual.html

In order for projects depending on pugixml to make use of this, pugixml
needs to be buildable by meson, even if it isn't the default build
system.
2021-09-30 20:23:31 -04:00
.github/workflows Update github action to trigger defines via CMake 2021-06-28 13:17:06 +02:00
docs docs: Update manual to be more explicit about save_file return 2021-07-09 17:27:01 -07:00
scripts fix cygwin compilation 2021-05-06 23:25:29 -07:00
src Fix a bug in move construction when move source is empty 2021-05-11 22:53:54 -07:00
tests add meson build support 2021-09-30 20:23:31 -04:00
.codecov.yml Update .codecov.yml 2021-06-30 13:11:45 -07:00
.gitattributes Add .gitattributes file 2018-07-23 23:13:02 -07:00
.gitignore Update .gitignore 2017-06-20 21:11:35 -07:00
appveyor.yml Fix PowerShell errors on stderr 2020-07-06 08:32:24 -07:00
CMakeLists.txt Set CMP0091 CMake policy 2021-08-07 09:57:21 -07:00
LICENSE.md Update copyright year to 2020 everywhere 2020-11-26 01:00:27 -08:00
Makefile scripts: Convert archive.py to Python 3 2020-11-26 01:08:07 -08:00
meson_options.txt add meson build support 2021-09-30 20:23:31 -04:00
meson.build add meson build support 2021-09-30 20:23:31 -04:00
README.md Change badge to GHA badge. 2021-06-27 19:01:06 -07:00
readme.txt Update copyright year to 2020 everywhere 2020-11-26 01:00:27 -08:00

pugixml Actions Status Build status codecov.io MIT

pugixml is a C++ XML processing library, which consists of a DOM-like interface with rich traversal/modification capabilities, an extremely fast XML parser which constructs the DOM tree from an XML file/buffer, and an XPath 1.0 implementation for complex data-driven tree queries. Full Unicode support is also available, with Unicode interface variants and conversions between different Unicode encodings (which happen automatically during parsing/saving).

pugixml is used by a lot of projects, both open-source and proprietary, for performance and easy-to-use interface.

Documentation

Documentation for the current release of pugixml is available on-line as two separate documents:

Youre advised to start with the quick-start guide; however, many important library features are either not described in it at all or only mentioned briefly; if you require more information you should read the complete manual.

Example

Here's an example of how code using pugixml looks; it opens an XML file, goes over all Tool nodes and prints tools that have a Timeout attribute greater than 0:

#include "pugixml.hpp"
#include <iostream>

int main()
{
    pugi::xml_document doc;
    pugi::xml_parse_result result = doc.load_file("xgconsole.xml");
    if (!result)
        return -1;
        
    for (pugi::xml_node tool: doc.child("Profile").child("Tools").children("Tool"))
    {
        int timeout = tool.attribute("Timeout").as_int();
        
        if (timeout > 0)
            std::cout << "Tool " << tool.attribute("Filename").value() << " has timeout " << timeout << "\n";
    }
}

And the same example using XPath:

#include "pugixml.hpp"
#include <iostream>

int main()
{
    pugi::xml_document doc;
    pugi::xml_parse_result result = doc.load_file("xgconsole.xml");
    if (!result)
        return -1;
        
    pugi::xpath_node_set tools_with_timeout = doc.select_nodes("/Profile/Tools/Tool[@Timeout > 0]");
    
    for (pugi::xpath_node node: tools_with_timeout)
    {
        pugi::xml_node tool = node.node();
        std::cout << "Tool " << tool.attribute("Filename").value() <<
            " has timeout " << tool.attribute("Timeout").as_int() << "\n";
    }
}

License

This library is available to anybody free of charge, under the terms of MIT License (see LICENSE.md).