David Abrahams wrote:
on Wed Sep 10 2008, e r
wrote: So I'd like to put all these arguments in a file, each line corresponding to an object, rather than have a messy cpp file. Well, if you're willing to compile that file as C++, you could go back to using Boost.Parameter... ;-) since the arguments to be passed into object constructors are known at compile time, i guess i could still do this?
I guess. Why, exactly, did you want to use strings, then?
I guess in my first post wanted something like this: std::string line; while(std::getline(is,line) ){ } But your remarks have made it irrelevant and I wasn't even thinking of this in my second post.
a) have some sort of cpp template i.e. some, not all the code intentionally left out (say marked by "NA"), to be filled from a text file, via a text processor b) compile the modified cpp file.
i'm not all that experienced with parsers and such. is this where Boost.Xpressive etc fit in or should i just go ahead and use perl?
If you're going to go back to using Boost.Parameter, you probably won't have any use for parsers and such. If you're going to use parsers and such, there probably is no role for Boost.Parameter.
I guess you could set up a toolchain where you parse some text file, generate C++ code, and compile that... is that where you are heading? And if so, why bother with the text file?
generate C++ code from a text file: yes, that's what I meant in my
second post.
Why bother? Because I'd like to have the text file to have a simpler
syntax and a cleaner aspect, particularly if I'm going to change it
often. for example:
args.txt:
{Type=type0,tag::key00=arg00,tag::key01=arg01,...}
.
.
.
{Type=typeN,tag::keyN0=argN0,tag::keyN1=argN1,...}
*.cpp
//Some code here
typedef fusion::vector