Boost logo

Boost Users :

Subject: [Boost-users] compile time (template or preprocessor) text processing
From: Laszlo Marak (ujoimro_at_[hidden])
Date: 2010-12-05 16:04:37


Hello,

My question is c++ related (I like to call the topic extreme c++ programming).
We all know the excellent boost python framework, which exports c++ functions
to python with spectacular elegance. As for the documentation of those
functions boost offers a string parameter, which can contain the description
of the particular function. Sometimes this documentation is already written
(for example in doxygen). It would be good to import this documentation
somehow to python.

Is there a possibility to generate a std::string from a FILE following some
rules using template meta-programming (or possibly the preprocessor)?

For example

my_function.cpp

///*************
// this is the documentation of my_function
//
void my_function()
{
cout << "I've been called.\n"
}

boost_export.cpp

def(
"my_function",
&my_function,
(args()),
generate_the_doc_in_compile_time_from<>("my_function.cpp")
)

Here the generate_the_doc_in_compile_time_from<>("my_function.cpp") would
hard-wire the docs into def at compile time, so it would no longer depend on
my_function.cpp.

Any ideas would be greatly appreciated.

UJ


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net