[Gambas-devel] Zlib
danielcampos at ...45...
danielcampos at ...45...
Wed Feb 18 12:00:49 CET 2004
>
>created, as he had to with Socket streams.
>
>DIM hFile AS CompressedFile
>hFile = NEW CompressedFile("/home/gambas/source.gz", "rw", 9)
>
>In the future, we could imagine an URL-based OPEN, and that stream >types will
>register under an URL protocol. Something like OPEN
>"gzip:/home/gambas/source.gz" FOR READ or OPEN >"/home/gambas/source.gz"
>PROTOCOL "gzip" FOR READ. >
>
>But I prefer when you instanciate streams. And you can add parameters >to the
>stream constructor! For example, the compression rate for the zlib.
>
>Or OPEN could get a stream type to create the appropriate stream. >This will be
>intelligent!
>
>DIM hFile AS CompressedFile
>OPEN CompressedFile "/home/benoit/source.gz" FOR CREATE AS hFile
>
>I prefer the last soultion finally :-)
>
>What do you think ?
>
This last solution seems to be more ellegant, however, you'd need to add in any part the special options for any stream, for exmple:
OPEN CompressedFile "/home/benoit/source.gz" FOR CREATE AS hFile USING PARAMS "compression=9"
or, in HttpClient:
OPEN HttpClient "http://www.binara.com" FOR READ AS hFile USING PARAMS "POSTMETHOD"
or
OPEN HttpClient "http://www.binara.com" FOR READ AS hFile USING PARAMS "GETMETHOD"
that paremeters should be passed to the object, so it can interpeter these options
regards,
Daniel Campos
-------------------------------------------------------------
NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar...
Web/Wap : www.netcourrier.com
Téléphone/Fax : 08 92 69 00 21 (0,34 TTC/min)
Minitel: 3615 NETCOURRIER (0,16 TTC/min)
More information about the Devel
mailing list