|
Boost-Commit : |
From: jmcintyre_at_[hidden]
Date: 2008-04-30 18:24:46
Author: jared
Date: 2008-04-30 18:24:45 EDT (Wed, 30 Apr 2008)
New Revision: 44955
URL: http://svn.boost.org/trac/boost/changeset/44955
Log:
explore documentation fixes
added custom associative container doc
Text files modified:
sandbox/explore/libs/explore/doc/custom_containers.qbk | 9 ++++++++-
sandbox/explore/libs/explore/doc/custom_delimeters.qbk | 2 +-
sandbox/explore/libs/explore/doc/html/boost_explore/dependencies_platforms.html | 4 ++--
sandbox/explore/libs/explore/doc/html/boost_explore/design.html | 2 +-
sandbox/explore/libs/explore/doc/html/boost_explore/tutorial.html | 12 ++++++------
sandbox/explore/libs/explore/doc/html/boost_explore/tutorial/custom_containers.html | 12 +++++++++++-
sandbox/explore/libs/explore/doc/html/boost_explore/tutorial/custom_delimeters.html | 2 +-
sandbox/explore/libs/explore/doc/html/index.html | 6 +++---
sandbox/explore/libs/explore/doc/tutorial.qbk | 12 ++++++------
9 files changed, 39 insertions(+), 22 deletions(-)
Modified: sandbox/explore/libs/explore/doc/custom_containers.qbk
==============================================================================
--- sandbox/explore/libs/explore/doc/custom_containers.qbk (original)
+++ sandbox/explore/libs/explore/doc/custom_containers.qbk 2008-04-30 18:24:45 EDT (Wed, 30 Apr 2008)
@@ -45,10 +45,17 @@
With our new overloaded operator<<, the following code
user_vector v;
- str_out << v;
+ std::cout << v;
prints
[1, 2, 3]
+
+If the container had been an associative container of pairs, then the operator<< code would have looked like this:
+
+ std::ostream& operator<<(std::ostream& ostr, const user_vector& u)
+ {
+ return explore::stream_container(ostr, u.begin(), u.end(), explore::stream_map_value());
+ }
[endsect]
Modified: sandbox/explore/libs/explore/doc/custom_delimeters.qbk
==============================================================================
--- sandbox/explore/libs/explore/doc/custom_delimeters.qbk (original)
+++ sandbox/explore/libs/explore/doc/custom_delimeters.qbk 2008-04-30 18:24:45 EDT (Wed, 30 Apr 2008)
@@ -58,7 +58,7 @@
vvi.push_back(vi);
vvi.push_back(vi);
vvi.push_back(vi);
- str_out << format_2d << vvi;
+ std::cout << format_2d << vvi;
This prints
Modified: sandbox/explore/libs/explore/doc/html/boost_explore/dependencies_platforms.html
==============================================================================
--- sandbox/explore/libs/explore/doc/html/boost_explore/dependencies_platforms.html (original)
+++ sandbox/explore/libs/explore/doc/html/boost_explore/dependencies_platforms.html 2008-04-30 18:24:45 EDT (Wed, 30 Apr 2008)
@@ -27,7 +27,7 @@
<a name="boost_explore.dependencies_platforms"></a><a href="dependencies_platforms.html" title="Dependencies and Platforms"> Dependencies and
Platforms</a></h2></div></div></div>
<a name="boost_explore.dependencies_platforms.dependencies"></a><h3>
-<a name="id975827"></a>
+<a name="id976039"></a>
<a href="dependencies_platforms.html#boost_explore.dependencies_platforms.dependencies">Dependencies</a>
</h3>
<p>
@@ -51,7 +51,7 @@
</li>
</ul></div>
<a name="boost_explore.dependencies_platforms.supported_platforms"></a><h3>
-<a name="id975879"></a>
+<a name="id976090"></a>
<a href="dependencies_platforms.html#boost_explore.dependencies_platforms.supported_platforms">Supported
Platforms</a>
</h3>
Modified: sandbox/explore/libs/explore/doc/html/boost_explore/design.html
==============================================================================
--- sandbox/explore/libs/explore/doc/html/boost_explore/design.html (original)
+++ sandbox/explore/libs/explore/doc/html/boost_explore/design.html 2008-04-30 18:24:45 EDT (Wed, 30 Apr 2008)
@@ -25,7 +25,7 @@
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_explore.design"></a> Design Notes</h2></div></div></div>
<a name="boost_explore.design.rationale"></a><h3>
-<a name="id975989"></a>
+<a name="id976200"></a>
<a href="design.html#boost_explore.design.rationale">Rationale</a>
</h3>
<p>
Modified: sandbox/explore/libs/explore/doc/html/boost_explore/tutorial.html
==============================================================================
--- sandbox/explore/libs/explore/doc/html/boost_explore/tutorial.html (original)
+++ sandbox/explore/libs/explore/doc/html/boost_explore/tutorial.html 2008-04-30 18:24:45 EDT (Wed, 30 Apr 2008)
@@ -55,9 +55,9 @@
</p>
<pre class="programlisting">
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="identifier">vi</span><span class="special">;</span>
-<span class="identifier">vvi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
-<span class="identifier">vvi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">2</span><span class="special">);</span>
-<span class="identifier">vvi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
+<span class="identifier">vi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
+<span class="identifier">vi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">2</span><span class="special">);</span>
+<span class="identifier">vi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">vi</span><span class="special">;</span>
</pre>
<p>
@@ -162,9 +162,9 @@
</p>
<pre class="programlisting">
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="identifier">vi</span><span class="special">;</span>
-<span class="identifier">vvi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
-<span class="identifier">vvi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">2</span><span class="special">);</span>
-<span class="identifier">vvi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
+<span class="identifier">vi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
+<span class="identifier">vi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">2</span><span class="special">);</span>
+<span class="identifier">vi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">outVal</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">lexical_cast</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">>(</span><span class="identifier">vi</span><span class="special">)</span> <span class="special">);</span>
</pre>
<p>
Modified: sandbox/explore/libs/explore/doc/html/boost_explore/tutorial/custom_containers.html
==============================================================================
--- sandbox/explore/libs/explore/doc/html/boost_explore/tutorial/custom_containers.html (original)
+++ sandbox/explore/libs/explore/doc/html/boost_explore/tutorial/custom_containers.html 2008-04-30 18:24:45 EDT (Wed, 30 Apr 2008)
@@ -77,7 +77,7 @@
</p>
<pre class="programlisting">
<span class="identifier">user_vector</span> <span class="identifier">v</span><span class="special">;</span>
-<span class="identifier">str_out</span> <span class="special"><<</span> <span class="identifier">v</span><span class="special">;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">v</span><span class="special">;</span>
</pre>
<p>
prints
@@ -85,6 +85,16 @@
<pre class="programlisting">
<span class="special">[</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">]</span>
</pre>
+<p>
+ If the container had been an associative container of pairs, then the operator<<
+ code would have looked like this:
+ </p>
+<pre class="programlisting">
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&</span> <span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span><span class="special">&</span> <span class="identifier">ostr</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">user_vector</span><span class="special">&</span> <span class="identifier">u</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">explore</span><span class="special">::</span><span class="identifier">stream_container</span><span class="special">(</span><span class="identifier">ostr</span><span class="special">,</span> <span class="identifier">u</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">u</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">explore</span><span class="special">::</span><span class="identifier">stream_map_value</span><span class="special">());</span>
+<span class="special">}</span>
+</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
Modified: sandbox/explore/libs/explore/doc/html/boost_explore/tutorial/custom_delimeters.html
==============================================================================
--- sandbox/explore/libs/explore/doc/html/boost_explore/tutorial/custom_delimeters.html (original)
+++ sandbox/explore/libs/explore/doc/html/boost_explore/tutorial/custom_delimeters.html 2008-04-30 18:24:45 EDT (Wed, 30 Apr 2008)
@@ -215,7 +215,7 @@
<span class="identifier">vvi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">vi</span><span class="special">);</span>
<span class="identifier">vvi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">vi</span><span class="special">);</span>
<span class="identifier">vvi</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">vi</span><span class="special">);</span>
-<span class="identifier">str_out</span> <span class="special"><<</span> <span class="identifier">format_2d</span> <span class="special"><<</span> <span class="identifier">vvi</span><span class="special">;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">format_2d</span> <span class="special"><<</span> <span class="identifier">vvi</span><span class="special">;</span>
</pre>
<p>
This prints
Modified: sandbox/explore/libs/explore/doc/html/index.html
==============================================================================
--- sandbox/explore/libs/explore/doc/html/index.html (original)
+++ sandbox/explore/libs/explore/doc/html/index.html 2008-04-30 18:24:45 EDT (Wed, 30 Apr 2008)
@@ -47,7 +47,7 @@
Boost.explore is a cross-platform C++ library for printing of containers.
</p>
<a name="boost_explore..getting_started"></a><h3>
-<a name="id976058"></a>
+<a name="id976270"></a>
<a href="index.html#boost_explore..getting_started">Getting Started</a>
</h3>
<p>
@@ -102,7 +102,7 @@
be considered.
</p>
<a name="boost_explore..supported_containers"></a><h3>
-<a name="id976990"></a>
+<a name="id977201"></a>
<a href="index.html#boost_explore..supported_containers">Supported Containers</a>
</h3>
<div class="itemizedlist"><ul type="disc">
@@ -148,7 +148,7 @@
can also be made to work with explore.
</p>
<a name="boost_explore..acknowledgements"></a><h3>
-<a name="id977070"></a>
+<a name="id977282"></a>
<a href="index.html#boost_explore..acknowledgements">Acknowledgements</a>
</h3>
<p>
Modified: sandbox/explore/libs/explore/doc/tutorial.qbk
==============================================================================
--- sandbox/explore/libs/explore/doc/tutorial.qbk (original)
+++ sandbox/explore/libs/explore/doc/tutorial.qbk 2008-04-30 18:24:45 EDT (Wed, 30 Apr 2008)
@@ -23,9 +23,9 @@
Basic printing of containers requires the inclusing of explore.hpp. Once included, containers can be be streamed in a formated manner.
std::vector<int> vi;
- vvi.push_back(1);
- vvi.push_back(2);
- vvi.push_back(3);
+ vi.push_back(1);
+ vi.push_back(2);
+ vi.push_back(3);
std::cout << vi;
prints
@@ -86,9 +86,9 @@
Because explore works with streaming operators, boost::lexical_cast will work with the explore library to allow you to create strings with the printed output of explore for cases when you don't want to use streaming directly.
std::vector<int> vi;
- vvi.push_back(1);
- vvi.push_back(2);
- vvi.push_back(3);
+ vi.push_back(1);
+ vi.push_back(2);
+ vi.push_back(3);
std::string outVal( boost::lexical_cast<std::string>(vi) );
outVal equals
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk