Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 11th, 2006, 09:45 PM
shaun roe
Guest
 
Posts: n/a
Default iomanipulator

Is it possible to write an IO manipulator to replace one word with
another?

e.g.

cout<<replaceHello<<"hello world"<<endl;

would print "goodbye world"

?
  #2  
Old January 11th, 2006, 09:55 PM
Julián Albo
Guest
 
Posts: n/a
Default Re: iomanipulator

shaun roe wrote:
[color=blue]
> Is it possible to write an IO manipulator to replace one word with
> another?[/color]

Yes.

--
Salu2
  #3  
Old January 11th, 2006, 10:05 PM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: iomanipulator

shaun roe wrote:[color=blue]
> Is it possible to write an IO manipulator to replace one word with
> another?
>
> e.g.
>
> cout<<replaceHello<<"hello world"<<endl;
>
> would print "goodbye world"
>
> ?[/color]

If your manipulator stuffs a special buffer into the stream, and then your
special buffer performs like a filter, and delays output to the real
buffer until it gets a whole word, and when the whole word is in, it
outputs something different to the real buffer...

I guess, the answer is "anything is possible".

V
  #4  
Old January 11th, 2006, 11:35 PM
David Harmon
Guest
 
Posts: n/a
Default Re: iomanipulator

On 11 Jan 2006 22:44:40 +0100 in comp.lang.c++, Julián Albo
<JULIANALBO@terra.es> wrote,[color=blue]
>shaun roe wrote:
>[color=green]
>> Is it possible to write an IO manipulator to replace one word with
>> another?[/color]
>
>Yes.[/color]

How?

  #5  
Old January 12th, 2006, 12:45 AM
Mike Wahler
Guest
 
Posts: n/a
Default Re: iomanipulator


"David Harmon" <source@netcom.com> wrote in message
news:440e866d.187381343@news.west.earthlink.net...[color=blue]
> On 11 Jan 2006 22:44:40 +0100 in comp.lang.c++, Julián Albo
> <JULIANALBO@terra.es> wrote,[color=green]
>>shaun roe wrote:
>>[color=darkred]
>>> Is it possible to write an IO manipulator to replace one word with
>>> another?[/color]
>>
>>Yes.[/color]
>
> How?[/color]

See Victor's reply.

-Mike


  #6  
Old January 12th, 2006, 12:45 AM
David Harmon
Guest
 
Posts: n/a
Default Re: iomanipulator

On Thu, 12 Jan 2006 00:31:15 GMT in comp.lang.c++, "Mike Wahler"
<mkwahler@mkwahler.net> wrote,[color=blue]
>
>"David Harmon" <source@netcom.com> wrote in message
>news:440e866d.187381343@news.west.earthlink.net.. .[color=green]
>> On 11 Jan 2006 22:44:40 +0100 in comp.lang.c++, Julián Albo
>> <JULIANALBO@terra.es> wrote,[color=darkred]
>>>shaun roe wrote:
>>>
>>>> Is it possible to write an IO manipulator to replace one word with
>>>> another?
>>>
>>>Yes.[/color]
>>
>> How?[/color]
>
>See Victor's reply.[/color]

But I want to see Julián's reply.

  #7  
Old January 12th, 2006, 05:05 PM
Julián Albo
Guest
 
Posts: n/a
Default Re: iomanipulator

David Harmon wrote:
[color=blue][color=green][color=darkred]
>>>>> Is it possible to write an IO manipulator to replace one word with
>>>>> another?
>>>>
>>>>Yes.
>>>
>>> How?[/color]
>>
>>See Victor's reply.[/color]
>
> But I want to see Julián's reply.[/color]

See Mike's reply.

--
Salu2
  #8  
Old January 13th, 2006, 04:55 PM
Mike Wahler
Guest
 
Posts: n/a
Default Re: iomanipulator


"Julián Albo" <JULIANALBO@terra.es> wrote in message
news:43c6889f_1@x-privat.org...[color=blue]
> David Harmon wrote:
>[color=green][color=darkred]
>>>>>> Is it possible to write an IO manipulator to replace one word with
>>>>>> another?
>>>>>
>>>>>Yes.
>>>>
>>>> How?
>>>
>>>See Victor's reply.[/color]
>>
>> But I want to see Julián's reply.[/color]
>
> See Mike's reply.
>
> --[/color]

Do I detect the scent of recursion?

-Mike


  #9  
Old January 13th, 2006, 05:05 PM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: iomanipulator

Mike Wahler wrote:[color=blue]
> "Julián Albo" <JULIANALBO@terra.es> wrote in message
> news:43c6889f_1@x-privat.org...
>[color=green]
>>David Harmon wrote:
>>
>>[color=darkred]
>>>>>>>Is it possible to write an IO manipulator to replace one word with
>>>>>>>another?
>>>>>>
>>>>>>Yes.
>>>>>
>>>>>How?
>>>>
>>>>See Victor's reply.
>>>
>>>But I want to see Julián's reply.[/color]
>>
>>See Mike's reply.
>>
>>--[/color]
>
>
> Do I detect the scent of recursion?[/color]

I think it's called "wrapping"...

V
  #10  
Old January 13th, 2006, 05:15 PM
Ben Pope
Guest
 
Posts: n/a
Default Re: iomanipulator

Mike Wahler wrote:[color=blue]
> "Julián Albo" <JULIANALBO@terra.es> wrote in message
> news:43c6889f_1@x-privat.org...[color=green]
>> David Harmon wrote:
>>[color=darkred]
>>>>>>> Is it possible to write an IO manipulator to replace one word with
>>>>>>> another?
>>>>>> Yes.
>>>>> How?
>>>> See Victor's reply.
>>> But I want to see Julián's reply.[/color]
>> See Mike's reply.
>>
>> --[/color]
>
> Do I detect the scent of recursion?[/color]

See Mike's reply.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
  #11  
Old January 13th, 2006, 05:35 PM
Julián Albo
Guest
 
Posts: n/a
Default Re: iomanipulator

Mike Wahler wrote:
[color=blue][color=green][color=darkred]
>>>>See Victor's reply.
>>>
>>> But I want to see Julián's reply.[/color]
>>
>> See Mike's reply.
>>[/color]
> Do I detect the scent of recursion?[/color]

I don't think so, unless Victor put a reply saying "See Mike's or Julian's
reply"

--
Salu2
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles