home.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. <!-- Begin Banner -->
  10. <H1 CLASS="title">The Boost Iostreams Library</H1>
  11. <HR CLASS="banner">
  12. <!-- End Banner -->
  13. <DL CLASS="page-index">
  14. <DT><A href="#purpose">Purpose</A></DT>
  15. <DT><A href="#overview">Overview</A></DT>
  16. <DT><A href="#documentation">How to Read the Iostreams Documentation</A></DT>
  17. <DT><A href="#conventions">Conventions</A></DT>
  18. </DL>
  19. <HR>
  20. <!-- Core Components -->
  21. <A NAME="purpose"></A>
  22. <H2>Purpose</H2>
  23. <P>
  24. Boost.Iostreams has three aims:
  25. </P>
  26. <UL>
  27. <LI CLASS="square">
  28. 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>.
  29. </LI>
  30. <LI CLASS="square">
  31. To provide a framework for defining <A HREF="concepts/filter.html">Filters</A> and attaching them to standard streams and stream buffers.
  32. </LI>
  33. <LI CLASS="square">
  34. To provide a collection of ready-to-use Filters, Sources and Sinks.
  35. </LI>
  36. </UL>
  37. <P>
  38. 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.
  39. </P>
  40. <A NAME="overview"></A>
  41. <H2>Overview</H2>
  42. <P>
  43. At the heart of Boost.Iostreams are a collection of <A HREF="http://www.boost.org/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.
  44. </P>
  45. <H3>Concepts</H3>
  46. <P>
  47. 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>.
  48. </P>
  49. <H3>Generic Streams and Stream Buffers</H3>
  50. <P>
  51. 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.
  52. </P>
  53. <H3>Filtering Streams and Stream Buffers</H3>
  54. <P>
  55. 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>.
  56. </P>
  57. <A NAME="documentation"></A>
  58. <H2>How to Read the Iostreams Documentation</H2>
  59. <P>
  60. 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>.
  61. </P>
  62. <P>
  63. Next, take a glance at the <A HREF="quick_reference.html">Quick Reference</A> to get an overview of Boost.Iostream's major components.
  64. </P>
  65. <P>
  66. 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.
  67. </P>
  68. <A NAME="conventions"></A>
  69. <H2>Conventions</H2>
  70. <P>
  71. All classes, functions and templates introduced in the documentation are in the
  72. namespace <CODE>boost::iostreams</CODE>, unless otherwise indicated. Namespace qualification is usually omitted.
  73. </P>
  74. <P>
  75. Specializations of <CODE>std::basic_istream</CODE> will be referred to as
  76. <SPAN CLASS="term">standard input streams</SPAN>, specializations of <CODE>std::basic_ostream</CODE>
  77. as <SPAN CLASS="term">standard output streams</SPAN>, specializations of <CODE>std::basic_iostream</CODE>
  78. as <SPAN CLASS="term">standard i/o streams</SPAN>, and specializations of <CODE>std::basic_streambuf</CODE>
  79. 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.
  80. </P>
  81. <!-- <UL>
  82. <LI CLASS="square">
  83. 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.
  84. </LI>
  85. <LI CLASS="square">
  86. Specializations of <CODE>std::basic_istream</CODE> will be referred to as
  87. <SPAN CLASS="term">standard input streams</SPAN>, specializations of <CODE>std::basic_ostream</CODE>
  88. as <SPAN CLASS="term">standard output streams</SPAN>, specializations of <CODE>std::basic_iostream</CODE>
  89. as <SPAN CLASS="term">standard i/o streams</SPAN>, and specializations of <CODE>std::basic_streambuf</CODE>
  90. 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.
  91. </LI>
  92. </UL> -->
  93. <!-- Begin Footer -->
  94. <HR>
  95. <P CLASS="copyright">&copy; Copyright 2008 <a href="http://www.coderage.com/" target="_top">CodeRage, LLC</a><br/>&copy; Copyright 2004-2007 <a href="https://www.boost.org/users/people/jonathan_turkanis.html" target="_top">Jonathan Turkanis</a></P>
  96. <P CLASS="copyright">
  97. 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>)
  98. </P>
  99. <!-- End Footer -->
  100. </BODY>