| Class Specialization GZ File Stream Adaption from gzFile of <zlib.h> to streams.
StreamConcept
Stream
GZ File Stream
Stream<GZFile> Include Headers seqan/stream.h Remarks This is only available if SEQAN_HAS_ZLIB is set to 1. Not copy constructable, not assignable. Follows the RIIA pattern when the file is opened through open (and thus the underlying gzFile is owned). Can be used as a wrapper around a gzFile or create such an object itself through open. Also see the constructor. Specialization of Stream Implements StreamConcept Functions
atEnd | Determines whether an iterator is at the end position. (Stream)
close | Closes a file. (Stream)
isDirect | Query a GZ File Stream for being "direct."
open | Opens a file, stream, or persistent string. (Stream)
Examples It is easy to open a GZ file via open. #include <seqan/stream.h> Stream<GZFile> gzStream; open(gzStream, "/path/to/file.txt.gz", "r"); // binary is implicit // Now, work with gzStream. The object will close the file on destruction. You can also use GZ File Stream as a wrapper around an gzFile object. In this case, we have to deal with the verbose code for opening the gzFile object. #include <zlib.h> #include <seqan/stream.h> gzFile gzOut = gzopen("/path/to/file.txt.gz", "wb"); SEQAN_ASSERT(gzOut != NULL); Stream<GZFile> gzStream(gzOut); // Now, you can work with the stream gzStream. // Note that you only have to close gzOut and not gzStream. int res = gzclose(gzOut); SEQAN_ASSERT_EQ(res, 0); SeqAn - Sequence Analysis Library - www.seqan.de

Page built @2014/10/13 16:13:00