summaryrefslogtreecommitdiff
path: root/README.md
blob: b2c22f5460685c6efde425ee300650055ee5a2a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
libcxml
=======

This is a very small library which provides a slightly tidier
C++ API than libxml++ for parsing XML.

For example:

    cxml::Document doc("RootNodeName");
    doc.read("foo.xml");

    /* Get the contents of child node <Fred>, throwing an
     * exception if it does not exist
     */
    string s = doc.string_child("Fred");

    /* Get the contents of child node <Jim>, or 42 if it
     * does not exist
     */
    int i = doc.optional_number_child<int>("Jim").get_value_or(42);

    /* Get the contents of <Roger> within <Sheila>,
     * throwing an exception if either node
     * is not present.
     */
    double d = doc.node_child("Sheila").number_child<double>("Roger");

For full details, see src/cxml.h

Building
-------

    ./waf configure
    ./waf build
    sudo ./waf install

### Build options

    --target-windows      set up to do a cross-compile to Windows
    --enable-debug        build with debugging information and without optimisation
    --static              build statically
    --disable-tests       disable building of tests

### Dependencies

- libxml++ (and libffi)


---
Bug reports and queries to Carl Hetherington <cth@carlh.net>