Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Structure

Include

Spirit is a header file only library. There are no libraries to link to. This section documents the structure of the Spirit headers.

Spirit contains five sub-libraries plus a 'support' module where common support classes are placed:

  • Classic
  • Qi
  • Karma
  • Lex
  • Phoenix
  • Support

The top spirit directory is:

BOOST_ROOT/boost/spirit

Currently, the directory contains:

[actor]     [attribute]     [core]      [dynamic]
[debug]     [error_handling][home]      [include]
[iterator]  [meta]          [phoenix]   [symbols]
[tree]      [utility]

These include some old v1.8 directories that are now depracated. These are: actor, attribute, core, dynamic, debug, error_handling, iterator, meta, phoenix, symbols, tree and utility. There is no guarantee that these directories will still be present in future versions of Spirit. We only keep them for backward compatibility. Please be warned.

Each directory (except include and home) have a corresponding header file that contains forwarding includes of each relevant include files that the directory contains. For example, there exists a <boost/spirit/actor.hpp> header file.

To distinguish between Spirit versions, you can inspect the version file:

<boost/spirit/version.hpp>

using the preprocessor define

SPIRIT_VERSION

It is a hex number where the first two digits determine the major version while the last two digits determine the minor version. For example:

#define SPIRIT_VERSION 0x2010 // version 2.1

The include directory at:

BOOST_ROOT/boost/spirit/include

is a special flat-structured directory that contains all the spirit headers. The accomodate the flat structure, the headers are prefixed with the sub- library name:

  • classic_
  • karma_
  • lex_
  • phoenix1_
  • phoenix_
  • qi_
  • support_

For example, if you used to include <boost/spirit/actor.hpp>, which is now a deprecated header, you should instead include <boost/spirit/include/classic_actor.hpp>

If you want to simply include the main sub-library name, then you can include:

  • <boost/spirit/include/classic.hpp>
  • <boost/spirit/include/karma.hpp>
  • <boost/spirit/include/lex.hpp>
  • <boost/spirit/include/phoenix1.hpp>
  • <boost/spirit/include/phoenix.hpp>
  • <boost/spirit/include/qi.hpp>
  • <boost/spirit/include/support.hpp>

The home directory:

BOOST_ROOT/boost/spirit/home

is the real home of spirit. It is the place where the various sub-libraries actually exist. The home directory contains:

[classic]   [karma]     [lex]
[phoenix]   [qi]        [support]

As usual, these directories have their corresponding include files:

  • <boost/spirit/home/classic.hpp>
  • <boost/spirit/home/karma.hpp>
  • <boost/spirit/home/lex.hpp>
  • <boost/spirit/home/phoenix.hpp>
  • <boost/spirit/home/qi.hpp>
  • <boost/spirit/home/support.hpp>

The various sub-libraries include files can be found in each sub-directory containing the particular sub-library. The include structure of each sub-library are documented in each (sub)libraries' documentation. Each sub-library follows the same consistent scheme as above.

To keep it simple for you, the client, you can simply use the main flat include directory where all include files are all placed together.


PrevUpHomeNext