Exporting An Entire Header

| Exporting An Entire Header

Pyste also supports a mechanism to export all declarations found in a header file. Suppose again our file, `hello.h`:

`

        struct World
        {
            World(std::string msg): msg(msg) {}
            void set(std::string msg) { this->msg = msg; }
            std::string greet() { return msg; }
            std::string msg;
        };

        enum choice { red, blue };

        void show(choice c) { std::cout << "value: " << (int)c << std::endl; }

`

You can just use the `AllFromHeader` construct:

`

        hello = AllFromHeader("hello.h")

`

this will export all the declarations found in `hello.h`, which is equivalent to write:

`

        Class("World", "hello.h")
        Enum("choice", "hello.h")
        Function("show", "hello.h")

`

Note that you can still use the functions `rename`, `set_policy`, `exclude`, etc. Just access the members of the header object like this:

`

        rename(hello.World.greet, "Greet")
        exclude(hello.World.set, "Set")

`

AllFromHeader is broken in some cases. Until it is fixed, use at you own risk.

Copyright © 2003 Bruno da Silva de Oliveira
Copyright © 2002-2003 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)