Skip to content

CarloWood/ai-xml

Repository files navigation

ai-xml submodule

This repository is a git submodule providing a C++ framework for serializing classes to and from XML with a minimal amount of code per class.

The root project should be using autotools, cwm4 and libcwd.

Example

For example, a program that can read and write the xml file catalog.xml could look something like this.

Checking out a project that uses the ai-xml submodule.

To clone a project example-project that uses ai-xml simply run:

git clone --recursive <URL-to-project>/example-project.git
cd example-project
./autogen.sh

The --recursive is optional because ./autogen.sh will fix it when you forgot it.

Afterwards you probably want to use --enable-mainainer-mode as option to the generated configure script.

Adding the ai-xml submodule to a project

To add this submodule to a project, that project should already be set up to use cwm4.

Simply execute the following in a directory of that project where you what to have the xml subdirectory:

git submodule add https://github.com/CarloWood/ai-xml.git xml

This should clone ai-xml into the subdirectory xml, or if you already cloned it there, it should add it.

Changes to configure.ac and Makefile.am are taken care of by cwm4, except for linking which works as usual;

for example, a module that defines a

bin_PROGRAMS = singlethreaded_foobar multithreaded_foobar

would also define

singlethreaded_foobar_CXXFLAGS = @LIBCWD_FLAGS@
singlethreaded_foobar_LDADD = ../xml/libxml.la ../utils/libutils.la $(top_builddir)/cwds/libcwds.la

multithreaded_foobar_CXXFLAGS = @LIBCWD_R_FLAGS@
multithreaded_foobar_LDADD = ../xml/libxml.la ../utils/libutils_r.la $(top_builddir)/cwds/libcwds_r.la

or whatever the path to xml etc. is, to link with libxml, and assuming you also use the cwds submodule.

Finally, run

./autogen.sh

to let cwm4 do its magic, and commit all the changes.

Checkout ai-xml-testsuite for an example of a project that uses this submodule.

About

A library to serialize custom classes to and from XML by adding a very minimal amount of code to a class.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published