loading a file as argument

Tom Carly tcarly at esat.kuleuven.ac.be
Tue Feb 25 20:34:38 EST 2003


Hi,

if I use this:

ifstream f("file.txt")

it works


but if I do this:

in something.hh I add this line:
String _filename;
and in something.cc I use this:
ifstream f(_filename)
and have this as configure function:

int
Something::configure(Vector<String> &conf, ErrorHandler *errh)
{
    return cp_va_parse(conf, this, errh,
                       cpFilename, "file to load", &_filename,
                       0);
}

and in the router configuration I use this:
Something("file.txt")
then it doesn't work...

What do I do wrong?

thank you in advance

tom




Op maandag 24 februari 2003 19:15, schreef Eddie Kohler:
> Hi Tom,
>
> The 'cpFilename' configuration type can be used to parse a filename. I've
> never had any problem with multiple files -- I use stdio though. Try
> looking at FromDump (elements/userlevel/fromdump.{cc,hh}). Or be more
> specific about why what you're doing doesn't work?
>
> Eddie





More information about the click mailing list