pyrachi
pyrachi

Reputation: 830

Is it possible to tie a C++ output stream to another output stream?

Is it possible to tie a C++ output stream to another output stream?

I'm asking because I've written an ISAPI extension in C++ and I've written ostreams around the WriteClient and ServerSupportFunction/HSE_REQ_SEND_RESPONSE_HEADER_EX functions - one ostream for the HTTP headers and one for the body of the HTTP response. I'd like to tie the streams together so that all the HTTP headers are sent before the rest of the response is sent.

Upvotes: 1

Views: 1081

Answers (1)

anon
anon

Reputation:

Yes, you can:

out1.tie( & out2 );

where both outs are output streams. out2 will be flushed before output to out1.

Upvotes: 5

Related Questions