Boost logo

Boost Users :

From: louis (louis04_at_[hidden])
Date: 2005-08-23 11:45:13


Thanks for the help.

My platform is Win32 and I was able to create a class:

class mystring: public std::iterator<std::bidirectional_iterator_tag, char >

mystring class opens the input file and maps it into memory using:
CreateFileMapping
MapViewOfFile

and I pass this into regex_replace. It seems to work - any thoughts?

Thanks again
Louis

> -----Original Message-----
> From: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of John Maddock
> Sent: Tuesday, August 23, 2005 11:08 AM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] regex_replace with file streams
>
>>I want to use regex_replace to operate on a potentially large input
>>file and output the results to another file. So, I can't load the
>>entire file into a buffer in memory and pass it in as is done in the
>>examples. I can't seem to figure out how to pass fstream or some other
>>file I/O into regex_replace (ie create the proper iterator).
>
> Take a look at the second example in
> http://www.boost.org/libs/regex/doc/partial_matches.html
>
> Unfortunately if you want to do a search and replace in an "infinite" text,
> then you're not going to be able to use regex_replace. Instead you'll have
> to enumerate through the matches and copy unmatched sections to output, and
> then call match_results::format on matched sections to get the text to
> output for that section.
>
> HTH, John.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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