imbue.html 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Function Template imbue</TITLE>
  5. <LINK REL="stylesheet" HREF="../../../../boost.css">
  6. <LINK REL="stylesheet" HREF="../theme/iostreams.css">
  7. </HEAD>
  8. <BODY>
  9. <!-- Begin Banner -->
  10. <H1 CLASS="title">Function Template <CODE>imbue</CODE></H1>
  11. <HR CLASS="banner">
  12. <!-- End Banner -->
  13. <DL class="page-index">
  14. <DT><A href="#description">Description</A></DT>
  15. <DT><A href="#headers">Headers</A></DT>
  16. <DT><A href="#reference">Reference</A></DT>
  17. </DL>
  18. <A NAME="description"></A>
  19. <H2>Description</H2>
  20. <P>
  21. The function template <CODE>imbue</CODE> is invoked automatically by the Iostreams library when the <CODE>std::locale</CODE> of a library stream or stream buffer is set using <CODE>std::basic_ios::imbue</CODE> or <CODE>std::basic_streambuf::pubimbue</CODE>. When the <CODE>std::locale</CODE> of an instance of <A HREF="../guide/generic_streams.html#stream_buffer"><CODE>stream_buffer</CODE></A> or <A HREF="../guide/generic_streams.html#stream"><CODE>stream</CODE></A> is set, <CODE>imbue</CODE> is invoked on the underlying Device; when the <CODE>std::locale</CODE> of a <A HREF="../classes/filtering_streambuf.html"><CODE>filtering_streambuf</CODE></A> or <A HREF="../classes/filtering_streambuf.html"><CODE>filtering_stream</CODE></A> is set, <CODE>imbue</CODE> is invoked on each Filter and Device in the underlying chain.
  22. </P>
  23. <A NAME="headers"></A>
  24. <H2>Headers</H2>
  25. <DL>
  26. <DT><A CLASS="header" HREF="../../../../boost/iostreams/imbue.hpp"><CODE>&lt;boost/iostreams/detail/imbue.hpp&gt;</CODE></A></DT>
  27. <DT><A CLASS="header" HREF="../../../../boost/iostreams/operations.hpp"><CODE>&lt;boost/iostreams/detail/operations.hpp&gt;</CODE></A></DT>
  28. </DL>
  29. <A NAME="reference"></A>
  30. <H2>Reference</H2>
  31. <A NAME="synopsis"></A>
  32. <H4>Synopsis</H4>
  33. <PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams {
  34. <SPAN CLASS="keyword">template</SPAN>&lt;<SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">T</A>&gt;
  35. <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#semantics">imbue</A>(T&amp; t, <SPAN CLASS="keyword">const</SPAN> std::locale&amp; loc);
  36. } } <SPAN CLASS="comment">// End namespace boost::io</SPAN></PRE>
  37. <A NAME="template_params"></A>
  38. <H4>Template Parameters</H4>
  39. <TABLE STYLE="margin-left:2em" BORDER=0 CELLPADDING=2>
  40. <TR>
  41. <TR>
  42. <TD VALIGN="top"><I>T</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
  43. <TD>A model of one of the <A HREF="../guide/concepts.html#filter_concepts">Filter</A> or <A HREF="../guide/concepts.html#device_concepts">Device</A> concepts</TD>
  44. </TR>
  45. </TABLE>
  46. <A NAME="semantics"></A>
  47. <H4>Semantics</H4>
  48. <P>The semantics of <CODE>imbue</CODE> for a Filter or Device type <CODE>T</CODE> depends on its <A HREF="../guide/traits.html#category">category</A> as follows:</P>
  49. <TABLE STYLE="margin-left:2em; margin-bottom:2em" BORDER=1 CELLPADDING=4>
  50. <TR><TH><CODE>category_of&lt;T&gt;::type</CODE></TH><TH>semantics</TH></TR>
  51. <TR>
  52. <TD VALIGN="top">Convertible to <A HREF="../guide/traits.html#category_tags"><CODE>streambuf_tag</CODE></A></TD>
  53. <TD>calls <CODE>t.pubimbue(loc)</CODE></TD>
  54. </TR>
  55. <TR>
  56. <TD VALIGN="top">Convertible to <A HREF="../guide/traits.html#category_tags"><CODE>localizable_tag</CODE></A> but not to <A HREF="../guide/traits.html#category_tags"><CODE>streambuf_tag</CODE></A></TD>
  57. <TD>calls <CODE>t.imbue(loc)</CODE></TD>
  58. </TR>
  59. <TR>
  60. <TD VALIGN="top"><I>otherwise</I></TD>
  61. <TD>no-op</TD>
  62. </TR>
  63. </TABLE>
  64. <!-- Begin Footer -->
  65. <HR>
  66. <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>
  67. <P CLASS="copyright">
  68. 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>)
  69. </P>
  70. <!-- End Footer -->
  71. </BODY>