Boost logo

Boost Users :

Subject: Re: [Boost-users] [wave] Custom I/O handling (include paths, etc.)?
From: Anteru (newsgroups_at_[hidden])
Date: 2011-03-21 03:54:05


Hi Hartmut,

I'm not sure how exactly it should look like, but I guess the interface
should be part of the input policy, as they have to work in tandem.
Basically, you call an input policy function which returns true/false
depending on whether it can open a given include file (providing the
include paths, system include paths and the include type to it.) If the
input policy returns true, then it must also return the full file path.
The full path is then passed back into the input facility via the
context, as usual.

That should do the trick, unless there's more hidden I/O that I didn't
find yet.

Cheers,
  Anteru

Am 20.03.2011 23:32, schrieb Hartmut Kaiser:
>> I'm trying to adopt Wave as my custom preprocessor for a project. So far,
>> things work fine, but there is one problem with Wave: I need to override
>> all I/O functions, in particular, reading from files and opening files.
>> Reading is easily changed by the input policy, but I couldn't find a way
>> to register an include handler hook. There's found_include_directive, but
>> nothing that allows me to get in-between wave and the filesystem. In my
>> case, I on-demand construct some data which I want to be able to #include
>> (i.e. #include <generated>) and some files are stored in
>> resources/compressed files (#include <zip/file.h>).
>> My include handler can open them, but how can I tell Wave to ask my
>> include handler whether it can find a file instead of using
>> boost::filesystem?
>
> Sorry, that's currently not supported.
>
> What interface have you been thinking to use? Any suggestions on how such a
> facility could be integrated into Wave?
>
> Regards Hartmut
> ---------------
> http://boost-spirit.com


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