Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards


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.