[29] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 2 | <HTML> |
---|
| 3 | <HEAD> |
---|
| 4 | <TITLE>The Boost Iostreams library</TITLE> |
---|
| 5 | <LINK REL="stylesheet" HREF="../../../boost.css" type="text/css"> |
---|
| 6 | <LINK REL="stylesheet" HREF="theme/iostreams.css" type="text/css"> |
---|
| 7 | </HEAD> |
---|
| 8 | <BODY> |
---|
| 9 | |
---|
| 10 | <!-- Begin Banner --> |
---|
| 11 | |
---|
| 12 | <H1 CLASS="title">The Boost Iostreams Library</H1> |
---|
| 13 | <HR CLASS="banner"> |
---|
| 14 | |
---|
| 15 | <!-- End Banner --> |
---|
| 16 | |
---|
| 17 | <DL CLASS="page-index"> |
---|
| 18 | <DT><A href="#purpose">Purpose</A></DT> |
---|
| 19 | <DT><A href="#overview">Overview</A></DT> |
---|
| 20 | <DT><A href="#documentation">How to Read the Iostreams Documentation</A></DT> |
---|
| 21 | <DT><A href="#conventions">Conventions</A></DT> |
---|
| 22 | </DL> |
---|
| 23 | |
---|
| 24 | <HR> |
---|
| 25 | |
---|
| 26 | <!-- Core Components --> |
---|
| 27 | |
---|
| 28 | <A NAME="purpose"></A> |
---|
| 29 | <H2>Purpose</H2> |
---|
| 30 | |
---|
| 31 | <P> |
---|
| 32 | Boost.Iostreams has three aims: |
---|
| 33 | </P> |
---|
| 34 | <UL> |
---|
| 35 | <LI CLASS="square"> |
---|
| 36 | To make it easy to create standard C++ streams and stream buffers for accessing new <A HREF="concepts/source.html">Sources</A> and <A HREF="concepts/sink.html">Sinks</A>. |
---|
| 37 | </LI> |
---|
| 38 | <LI CLASS="square"> |
---|
| 39 | To provide a framework for defining <A HREF="concepts/filter.html">Filters</A> and attaching them to standard streams and stream buffers. |
---|
| 40 | </LI> |
---|
| 41 | <LI CLASS="square"> |
---|
| 42 | To provide a collection of ready-to-use Filters, Sources and Sinks. |
---|
| 43 | </LI> |
---|
| 44 | </UL> |
---|
| 45 | |
---|
| 46 | <P> |
---|
| 47 | For example, Boost.Iostreams can be used to create streams to access TCP connections or as a framework for cryptography and data compression. The library includes components for accessing <A HREF="classes/mapped_file.html">memory-mapped files</A>, for file access using operating system <A HREF="classes/file_descriptor.html">file descriptors</A>, for <A HREF="guide/code_conversion.html">code conversion</A>, for text filtering with <A HREF="classes/regex_filter.html">regular expressions</A>, for <A HREF="classes/newline_filter.html">line-ending conversion</A> and for compression and decompression in the <A HREF="classes/zlib.html">zlib</A>, <A HREF="classes/gzip.html">gzip</A> and <A HREF="classes/bzip2.html">bzip2</A> formats. |
---|
| 48 | </P> |
---|
| 49 | |
---|
| 50 | <A NAME="overview"></A> |
---|
| 51 | <H2>Overview</H2> |
---|
| 52 | |
---|
| 53 | <P> |
---|
| 54 | At the heart of Boost.Iostreams are a collection of <A HREF="../../../more/generic_programming.html#concept" TARGET="_top">concepts</A> and set of templates which turn models of these concepts into C++ standard library streams and stream buffers. |
---|
| 55 | </P> |
---|
| 56 | |
---|
| 57 | <H3>Concepts</H3> |
---|
| 58 | |
---|
| 59 | <P> |
---|
| 60 | The fundamental building blocks of the library are the concepts of a <A HREF="concepts/source.html">Source</A>, which provides read access to a sequence of characters, a <A HREF="concepts/sink.html">Sink</A>, which provides write access to a sequence of characters, an <A HREF="concepts/input_filter.html">InputFilter</A>, which filters input read from a Source, and an <A HREF="concepts/output_filter.html">OutputFilter</A>, which filters output written to a Sink. Sources, Sinks and their refinements are called <A HREF="concepts/device.html">Devices</A>. InputFilters, OutputFilters and their refinements are called <A HREF="concepts/filter.html">Filters</A>. |
---|
| 61 | </P> |
---|
| 62 | |
---|
| 63 | <H3>Generic Streams and Stream Buffers</H3> |
---|
| 64 | |
---|
| 65 | <P> |
---|
| 66 | The class templates <A HREF="guide/generic_streams.html#stream_buffer"><CODE>stream_buffer</CODE></A> and <A HREF="guide/generic_streams.html#stream"><CODE>stream</CODE></A> implement standard stream buffers and streams which perform i/o by delegating to a contained <A HREF="concepts/device.html">Device</A>. The Device is accessed using member functions <CODE>open</CODE>, <CODE>is_open</CODE> and <CODE>close</CODE>, providing an interface similar to the standard file-based streams and stream buffers. |
---|
| 67 | </P> |
---|
| 68 | |
---|
| 69 | <H3>Filtering Streams and Stream Buffers</H3> |
---|
| 70 | |
---|
| 71 | <P> |
---|
| 72 | For filtering, Boost.Iostreams provides the templates <A HREF="classes/filtering_streambuf.html"><CODE>filtering_streambuf</CODE></A> and <A HREF="classes/filtering_stream.html"><CODE>filtering_stream</CODE></A>. Instances of <CODE>filtering_streambuf</CODE> or <CODE>filtering_stream</CODE> contain <A HREF="classes/chain.html"><CODE>chains</CODE></A> of Filters and Devices accessed with an interface similar to that of <CODE>std::stack</CODE>. |
---|
| 73 | </P> |
---|
| 74 | |
---|
| 75 | <A NAME="documentation"></A> |
---|
| 76 | <H2>How to Read the Iostreams Documentation</H2> |
---|
| 77 | |
---|
| 78 | <P> |
---|
| 79 | If you haven't used a pre-release version of the library, start by reading the <A HREF="tutorial/tutorial.html">Tutorial</A>. Read the entire section on writing <A HREF="concepts/device.html">Devices</A>, and at least the first few sections on writing <A HREF="concepts/filter.html">Filters</A>. Even if you've used the library before, you might want to check out the Tutorial, since the library interface has been modified to accommodate <A HREF="guide/asynchronous.html">Asynchronous and Non-Blocking I/O</A>. |
---|
| 80 | </P> |
---|
| 81 | |
---|
| 82 | <P> |
---|
| 83 | Next, take a glance at the <A HREF="quick_reference.html">Quick Reference</A> to get an overview of Boost.Iostream's major components. |
---|
| 84 | </P> |
---|
| 85 | |
---|
| 86 | <P> |
---|
| 87 | Finally, consult the <A HREF="guide/guide.html">User's Guide</A>, the <A HREF="reference.html">Reference</A> and the <A HREF="faq.html">FAQ</A> when you have questions not answered by the other sections. The <A HREF="guide/guide.html">User's Guide</A> consists of a collection of short essays, which are mostly independent of each other. The <A HREF="reference.html">Reference</A> contains detailed documentation of each public component of Boost.Iostreams. |
---|
| 88 | </P> |
---|
| 89 | |
---|
| 90 | <A NAME="conventions"></A> |
---|
| 91 | <H2>Conventions</H2> |
---|
| 92 | |
---|
| 93 | <P> |
---|
| 94 | All classes, functions and templates introduced in the documentation are in the |
---|
| 95 | namespace <CODE>boost::iostreams</CODE>, unless otherwise indicated. Namespace qualification is usually omitted. |
---|
| 96 | </P> |
---|
| 97 | <P> |
---|
| 98 | Specializations of <CODE>std::basic_istream</CODE> will be referred to as |
---|
| 99 | <SPAN CLASS="term">standard input streams</SPAN>, specializations of <CODE>std::basic_ostream</CODE> |
---|
| 100 | as <SPAN CLASS="term">standard output streams</SPAN>, specializations of <CODE>std::basic_iostream</CODE> |
---|
| 101 | as <SPAN CLASS="term">standard i/o streams</SPAN>, and specializations of <CODE>std::basic_streambuf</CODE> |
---|
| 102 | as <SPAN CLASS="term">standard stream buffers</SPAN>. Together, standard input streams, standard output streams and standard i/o streams will be referred to as <SPAN CLASS="term">standard streams</SPAN>. Sometimes the qualifier <I>standard</I> will be omitted. |
---|
| 103 | </P> |
---|
| 104 | |
---|
| 105 | <!-- <UL> |
---|
| 106 | <LI CLASS="square"> |
---|
| 107 | All classes, functions and templates introduced in the documentation are in the namespace <CODE>boost::iostreams</CODE> unless otherwise indicated. Namespace qualification will usually be omitted. |
---|
| 108 | </LI> |
---|
| 109 | <LI CLASS="square"> |
---|
| 110 | Specializations of <CODE>std::basic_istream</CODE> will be referred to as |
---|
| 111 | <SPAN CLASS="term">standard input streams</SPAN>, specializations of <CODE>std::basic_ostream</CODE> |
---|
| 112 | as <SPAN CLASS="term">standard output streams</SPAN>, specializations of <CODE>std::basic_iostream</CODE> |
---|
| 113 | as <SPAN CLASS="term">standard i/o streams</SPAN>, and specializations of <CODE>std::basic_streambuf</CODE> |
---|
| 114 | as <SPAN CLASS="term">standard stream buffers</SPAN>. Together, standard input streams, standard output streams and standard i/o streams will be referred to as <SPAN CLASS="term">standard streams</SPAN>. The qualifier <I>standard</I> will usually be omitted. |
---|
| 115 | </LI> |
---|
| 116 | </UL> --> |
---|
| 117 | |
---|
| 118 | <!-- Begin Footer --> |
---|
| 119 | |
---|
| 120 | <HR> |
---|
| 121 | |
---|
| 122 | <P CLASS="copyright">Revised |
---|
| 123 | <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> |
---|
| 124 | 20 May, 2004 |
---|
| 125 | <!--webbot bot="Timestamp" endspan i-checksum="38504" --> |
---|
| 126 | </P> |
---|
| 127 | |
---|
| 128 | <P CLASS="copyright">© Copyright <A HREF="http://www.kangaroologic.com" TARGET="_top">Jonathan Turkanis</A>, 2004</P> |
---|
| 129 | <P CLASS="copyright"> |
---|
| 130 | Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <A HREF="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>) |
---|
| 131 | </P> |
---|
| 132 | <!-- End Footer --> |
---|
| 133 | |
---|
| 134 | </BODY> |
---|