GitHub - CarloWood/ai-xml: A library to serialize custom classes to and from XML by adding a very minimal amount of code to a class. (original) (raw)
ai-xml submodule
This repository is a git submoduleproviding a C++ framework for serializing classes to and from XML with a minimal amount of code per class.
The root project should be usingautotools,cwm4 andlibcwd.
Example
For example, a program that can read and write the xml file catalog.xmlcould 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-modeas 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.amare 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-testsuitefor an example of a project that uses this submodule.