stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r587471 - in /incubator/stdcxx/trunk/doc/stdlibref: ctype.html locale.html money-put.html moneypunct.html num-put.html numpunct.html strstreambuf.html valarray.html
Date Tue, 23 Oct 2007 12:13:08 GMT
Author: faridz
Date: Tue Oct 23 05:13:07 2007
New Revision: 587471

URL: http://svn.apache.org/viewvc?rev=587471&view=rev
Log:
2007-10-23 Farid Zaripov <farid_zaripov@epam.com>

	Merged r587464 from branches/4.2.x
	* ctype.html: Removed #include <examples.h> from example code.
	* locale.html: Ditto.
	* money-put.html: Ditto.
	* moneypunct.html: Ditto.
	* num-put.html: Ditto.
	* numpunct.html: Ditto.
	* valarray.html: Ditto.
	* strstreambuf.html: Ditto. Updated the example source and
	the program output according to changes in r587173

Modified:
    incubator/stdcxx/trunk/doc/stdlibref/ctype.html
    incubator/stdcxx/trunk/doc/stdlibref/locale.html
    incubator/stdcxx/trunk/doc/stdlibref/money-put.html
    incubator/stdcxx/trunk/doc/stdlibref/moneypunct.html
    incubator/stdcxx/trunk/doc/stdlibref/num-put.html
    incubator/stdcxx/trunk/doc/stdlibref/numpunct.html
    incubator/stdcxx/trunk/doc/stdlibref/strstreambuf.html
    incubator/stdcxx/trunk/doc/stdlibref/valarray.html

Modified: incubator/stdcxx/trunk/doc/stdlibref/ctype.html
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/doc/stdlibref/ctype.html?rev=587471&r1=587470&r2=587471&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibref/ctype.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibref/ctype.html Tue Oct 23 05:13:07 2007
@@ -598,8 +598,6 @@
 <UL><PRE>#include &lt;iostream&gt;   // for cout, endl
 #include &lt;locale&gt;     // for ctype
 
-#include &lt;examples.h&gt;
-
 int main ()
 {
     std::locale loc;

Modified: incubator/stdcxx/trunk/doc/stdlibref/locale.html
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/doc/stdlibref/locale.html?rev=587471&r1=587470&r2=587471&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibref/locale.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibref/locale.html Tue Oct 23 05:13:07 2007
@@ -1835,7 +1835,6 @@
 #include &lt;vector&gt;      // for vector
 
 #include &lt;codecvte.h&gt;
-#include &lt;examples.h&gt;
 
 int main ()
 {

Modified: incubator/stdcxx/trunk/doc/stdlibref/money-put.html
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/doc/stdlibref/money-put.html?rev=587471&r1=587470&r2=587471&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibref/money-put.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibref/money-put.html Tue Oct 23 05:13:07 2007
@@ -181,8 +181,6 @@
 #include &lt;iterator&gt;   // for ostreambuf_iterator
 #include &lt;string&gt;     // for string
 
-#include &lt;examples.h&gt;
-
 
 int main ()
 {

Modified: incubator/stdcxx/trunk/doc/stdlibref/moneypunct.html
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/doc/stdlibref/moneypunct.html?rev=587471&r1=587470&r2=587471&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibref/moneypunct.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibref/moneypunct.html Tue Oct 23 05:13:07 2007
@@ -317,8 +317,6 @@
 #include &lt;iostream&gt;   // for cout, endl
 #include &lt;limits&gt;     // for numeric_limits
 
-#include &lt;examples.h&gt;
-
 
 int main ()
 {

Modified: incubator/stdcxx/trunk/doc/stdlibref/num-put.html
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/doc/stdlibref/num-put.html?rev=587471&r1=587470&r2=587471&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibref/num-put.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibref/num-put.html Tue Oct 23 05:13:07 2007
@@ -448,8 +448,6 @@
 #include &lt;iterator&gt;   // for ostreambuf_iterator
 #include &lt;locale&gt;     // for time_put
 
-#include &lt;examples.h&gt;
-
 // custom numeric punctuation facet
 struct Punct: std::numpunct&lt;char&gt;
 {

Modified: incubator/stdcxx/trunk/doc/stdlibref/numpunct.html
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/doc/stdlibref/numpunct.html?rev=587471&r1=587470&r2=587471&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibref/numpunct.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibref/numpunct.html Tue Oct 23 05:13:07 2007
@@ -210,8 +210,6 @@
 #include &lt;locale&gt;     // for locale, numpunct, use_facet
 #include &lt;stdexcept&gt;  // for runtime_error
 
-#include &lt;examples.h&gt;
-
 
 #if defined (_WIN32) || defined (_WIN64)
 #  define GERMAN_LOCALE "german_germany.1252"

Modified: incubator/stdcxx/trunk/doc/stdlibref/strstreambuf.html
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/doc/stdlibref/strstreambuf.html?rev=587471&r1=587470&r2=587471&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibref/strstreambuf.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibref/strstreambuf.html Tue Oct 23 05:13:07 2007
@@ -335,7 +335,8 @@
 //
  
 #include &lt;iomanip&gt;     // for setw
-#include &lt;iostream&gt;    // for cerr, cout, endl
+#include &lt;ios&gt;         // for dec, ends
+#include &lt;iostream&gt;    // for cerr, cout
 #include &lt;strstream&gt;   // for istream, ostrstream
 
 
@@ -348,21 +349,19 @@
     std::istream in (out.rdbuf ());   
 
     // output to out
-    out &lt;&lt; "Anticonstitutionellement is a big word!!!\n";
+    out &lt;&lt; "Anticonstitutionnellement is a big word!!!\n";
 
     // create a NTBS 
     const char s[] ="Le rat des villes et le rat des champs.";
 
     // output the NTBS
-    out &lt;&lt; s &lt;&lt; std::endl;   
+    out &lt;&lt; s &lt;&lt; '\n';
 
     // (try to) resize the buffer
-    if (out.rdbuf ()-&gt;pubsetbuf (0, 5000))
-        std::cout &lt;&lt; "Successfully allocated buffer." 
-                  &lt;&lt; std::endl;
+    if (out.rdbuf ()-&gt;pubsetbuf (0, 128L))
+        std::cout &lt;&lt; "Successfully allocated buffer.\n";
     else
-        std::cerr &lt;&lt; "Failed to allocate buffer." 
-                  &lt;&lt; std::endl;
+        std::cerr &lt;&lt; "Failed to allocate buffer.\n";
 
     // output the contents of the buffer to standard output
     std::cout &lt;&lt; in.rdbuf ();
@@ -371,28 +370,31 @@
     out &lt;&lt; std::dec              // decimal base
         &lt;&lt; std::setfill ('#')    // set fill character
         &lt;&lt; std::setw (16)        // set field width
-        &lt;&lt; 0x100 &lt;&lt; std::endl;   // format
+        &lt;&lt; 0x100 &lt;&lt; '\n';        // format
   
-    // output the content of the input sequence to 
-    // standard output
-    std::cout &lt;&lt; in.rdbuf( ) &lt;&lt; std::endl;
+    // output the content of the input sequence to standard output
+    std::cout &lt;&lt; in.rdbuf( ) &lt;&lt; '\n';
 
     // number of elements in the output sequence
-    std::cout &lt;&lt; "Buffer size is " &lt;&lt; out.rdbuf ()-&gt;pcount
()
-              &lt;&lt; std::endl;
+    const std::streamsize pcount = std::streamsize (out.rdbuf ()-&gt;pcount ());
 
-    // (try to) resize the buffer to a minimum size
-    if (out.rdbuf()-&gt;pubsetbuf (0,out.rdbuf()-&gt;pcount() + 1))
-        std::cout &lt;&lt; std::endl 
-                  &lt;&lt; "Successfully resized buffer." 
-                  &lt;&lt; std::endl;
+    std::cout &lt;&lt; "Buffer size is " &lt;&lt; pcount &lt;&lt;
'\n';
+
+    // (try to) resize the buffer
+    if (out.rdbuf ()-&gt;pubsetbuf (0, pcount * 2L))
+        std::cout &lt;&lt; "\nSuccessfully resized buffer to " &lt;&lt; pcount
* 2 &lt;&lt; '\n';
     else
-        std::cerr &lt;&lt; "Failed to resize buffer." &lt;&lt; std::endl;
+        std::cerr &lt;&lt; "\nFailed to resize buffer to " &lt;&lt; pcount
* 2 &lt;&lt; '\n';
 
-    // output the contents of the streambuf object 
-    // associated with out
+    // NUL-terminate the character array before streaming it out
+    out &lt;&lt; std::ends;
+
+    // output the contents of the streambuf object associated with out
     std::cout &lt;&lt; out.rdbuf ()-&gt;str ();
 
+    // unfreeze the streambuf so it cleans up its allocated memory
+    out.rdbuf ()-&gt;freeze (false);
+
     return 0;
 }
 
@@ -402,6 +404,14 @@
 <UL><PRE>Successfully allocated buffer.
 Anticonstitutionnellement is a big word!!!
 Le rat des villes et le rat des champs.
+#############256
+
+Buffer size is 100
+
+Successfully resized buffer to 200
+Anticonstitutionnellement is a big word!!!
+Le rat des villes et le rat des champs.
+#############256
 </PRE></UL>
 <A NAME="sec11"><H3>See Also</H3></A>
 <P><B><I><A HREF="char-traits.html">char_traits</A></I></B>,
<B><I><A HREF="ios-base.html">ios_base</A></I></B>, <B><I><A
HREF="basic-ios.html">basic_ios</A></I></B>, <B><I><A
HREF="basic-streambuf.html">basic_streambuf</A></I></B>, <B><I><A
HREF="istrstream.html">istrstream</A></I></B>, <B><I><A
HREF="ostrstream.html">ostrstream</A></I></B>, <B><I><A
HREF="strstream.html">strstream</A></I></B></P>

Modified: incubator/stdcxx/trunk/doc/stdlibref/valarray.html
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/doc/stdlibref/valarray.html?rev=587471&r1=587470&r2=587471&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibref/valarray.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibref/valarray.html Tue Oct 23 05:13:07 2007
@@ -861,8 +861,6 @@
 #include &lt;iostream&gt;     // for cout
 #include &lt;valarray&gt;     // for valarray
 
-#include &lt;examples.h&gt;
-
 
 template &lt;class T&gt; 
 inline std::ostream&



Mime
View raw message