[boost] Re: Interest in library generating streambufs from objects

2003-06-12 Thread Maxim Egorushkin
"Jonathan D. Turkanis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thanks for your interest. I have posted the library at
> http://groups.yahoo.com/group/boost/files/streambuf_lib/.
>
> The implementation needs to be streamlined, but it works, and the main
ideas
> are clear enough.

Hi,

I posted here a while ago streambuf adapters. There was no any answer. May
be you might find it intresting.

The main idea is simple: to present any linear sequence as
std::basic_streambuf<>.

Here are the file.


begin 666 sequence_buffer.hpp
M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O#0HO+R!S97%U96YC95]B=69F97(N: T*#0HC<')A9VUA(&]N8V4-
M"@T*(VEN8VQU9&4@/&%L9V]R:71H;3X-"B-I;F-L=61E(#QI=&5R871O6%B;&4N:'!P
M/@T*(VEN8VQU9&4@/&)O;W-T+W1Y<&5?=')A:71S+FAP<#X-"B-I;F-L=61E
M(#QB;V]S="]M<&PO=F]I9"YH<' ^#0HC:6YC;'5D92 \8F]O6YO<'-I
M&%M<&QE2!P87)A;65T
M97)S#0H)"6-L87-S('-E<75E;F-E7VUO9&5L#0H)+R\@;W!T:6]N86P@<&%R
M86UE=&5R2!P
M87)A;65T97)S#0H)"6-L87-S('-E<75E;F-E7VUO9&5L#0H)+R\@;W!T:6]N
M86P@<&%R86UE=&5RWT[#0IS=')[EMAIL PROTECTED]>F5?=&%G('M].PT*#0IT96UP;&%T
M93QC;&%SPT*"71Y<&[EMAIL PROTECTED]&%G(&YA;64[#0H)='EP961E9B!4('1Y<&4[#0I]
M.PT*#0IS=')[EMAIL PROTECTED]&5F875L=%]P87)A;65T97)?=&%G('M].PT*#0IS=')U
[EMAIL PROTECTED]&5F875L=%]P87)A;65T97(-"@DZ"61E9FEN95]P87)A;65T97(\9&5F
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N86UE('!A
M7!E.PT*"71Y<&[EMAIL PROTECTED]'EP
M96YA;64@<&%R86UE=&5RPT*"0ER96QE87-E7V)U9F9E<[EMAIL PROTECTED]"7T-"@T*
M<')O=&5C=&[EMAIL PROTECTED]"7-E<75E;F-E7V-O;F-E<'0F(&[EMAIL PROTECTED]
M('L@PT*"0D)8VAA7!E*B!B
M=69F97(@/2!A;&QO8V%T95]B=69F97(H*3L-"@D)"7-E=&F4I.PT*
M"0E]#0H)?0T*#0H)=F]I9"!PPT*"0ER971U<[EMAIL PROTECTED]&AIPT*"0ET:&ES+3YA;&QO8V%T;W(Z.F1E86QL;V-A=&4H96)A
[EMAIL PROTECTED]>F4I.PT*"0ES971G*# L(# L(# I.PT*#0H)"71H
M:7,M/F%L;&]C871O7!E;F%M92!S97%U96YC
M95]M;V1E;#HZ:6YP=70L(% Q+"!0,[EMAIL PROTECTED],L(% T/@T*>PT*<')I=F%T93H-
M"@ET>7!E9&5F(&1E=&%I;#HZ8G5F9F5R7V)A7!E"0EC:&%R7W1Y<&4[#0H)
M='EP961E9B!T>7!E;F%M92!B87-E.CITF5?= D)"0D)"6)U9F9EF4[#0H-"@ET>7!E9&5F('1Y<&5N86UE
M('-E<75E;F-E7VUO9&5L.CII;G!U="!S97%U96YC95]C;VYC97!T.PT*"0T*
M#0IP=6)L:6,Z#0H):6YP=71?8G5F9F5R*'-E<75E;F-E7V-O;F-E<'0F('-E
M<75E;F-E*0T*"0DZ"6)AWT-"@T*<')I=F%T93H-
M"@EI;G1?='EP92!U;F1EF5?="!R96%D.PT*"0EI9B H*')E860@/2!G971?
M7!E.CIT;U]I;G1?='[EMAIL PROTECTED])A8VLH*2D[#0H)"7T-"@D)96QS90T*
M"0E[#0H)"0ER971U<[EMAIL PROTECTED]')A:71S7W1Y<&[EMAIL PROTECTED]"0E]#0H)?0T*
M?3L-"@T*+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O#0H-"G1E;7!L871E/ T*"0EC;&%S7!E9&5F
M('1Y<&5N86UE(&)A7!E"0ET7!E9&5F('1Y<&5N86UE('1R86ET7!E.CII;G1?='EP90EI;G1?='EP
M93L-"@ES=&%T:6,@8V]NF4@/2!B
M87-E.CIB=69F97)?F5O9BAC
M:&%R7W1Y<&4I*3L-"@D)"7-E=' H<&)A<

[boost] Re: Interest in library generating streambufs from objects

2003-06-10 Thread Daryle Walker
On Monday, June 9, 2003, at 3:23 PM, Reece Dunn wrote:

[SNIP]
Also, is there a way for you to bind a streambuf to a stream? I have 
not had any direct experience with stream buffers, so I don't know. If 
not, it would be a good idea to have an I/O stream that can have a 
custom stream buffer, that way you can use stream facilities on these 
buffers, thus gaining access to compression, encription, etc.
[TRUNCATE]

I just put several I/O-related items up for review a few months ago.  
One of the items was a set of stream class templates that wrap a 
containing stream buffer.  Look for stuff like "streambuf_wrapping.hpp".

The code as it was reviewed is in the file section of our Yahoo Groups 
space under the name "more_io.zip".  Updated versions of the code exist 
in the Boost-sandbox CVS.

Daryle

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


[boost] RE: Interest in library generating streambufs from objects

2003-06-08 Thread Jonathan D. Turkanis
Thanks for your interest. I have posted the library at
http://groups.yahoo.com/group/boost/files/streambuf_lib/.

The implementation needs to be streamlined, but it works, and the main ideas
are clear enough.

Robert Ramey wrote:
> I think it would be more interesting if the following were considered
>
> a) composability - suppose I have an encryption facility and a
> compression facility.  I would like to be able to make a
> streambuf the compresses thhen encryrpts or vice versa.
...
> c) this suggests to me:
> i) a implemention set of composable iterator adaptors.
> ii) a streambuf that can filter input/output through an itererator
adaptor.  This
> MIGHT be implemented as a codecvt facet that takes an interator
adaptor
> as an argument.
...
> To summarize, I would like see the concept of "adaptable sequence"
factored
> out of streambuf and a streambuf built that can use any "adaptable
sequence".

This is good idea! I had thought about composing streambufs to create new
streambufs, and indeed this seems fairly straightforward using my approach
(perhaps the most difficult part is selecting suitable names for the
composition operations -- how about 'operator+' ?)

However, reworking the project in terms of iterator adaptors is a completely
different story (I think.) Very interesting! Could you give a more detailed
example?

Jeff Garland wrote:
>1) I'd be interested in how this fits with the Boost Socket initiative
>http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostSocket
>2) I've written something similar for zip files, but looks like you may
have
>a more general solution -- a toolkit for creating new streambuf types. If
>this is the case, it would be very handy.

I'll have to look more closely at Boost Sockets (I've only read the
requirements.) Also I will look at your compressed streams tonight.

Thanks,

Jonathan Turkanis

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost