stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r546535 - /incubator/stdcxx/trunk/include/sstream
Date Tue, 12 Jun 2007 15:39:21 GMT
Author: faridz
Date: Tue Jun 12 08:39:20 2007
New Revision: 546535

URL: http://svn.apache.org/viewvc?view=rev&rev=546535
Log:
2007-06-12 Farid Zaripov <Farid_Zaripov@epam.com>

	* sstream (str): Method definition moved outside of the class definition.

Modified:
    incubator/stdcxx/trunk/include/sstream

Modified: incubator/stdcxx/trunk/include/sstream
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/sstream?view=diff&rev=546535&r1=546534&r2=546535
==============================================================================
--- incubator/stdcxx/trunk/include/sstream (original)
+++ incubator/stdcxx/trunk/include/sstream Tue Jun 12 08:39:20 2007
@@ -124,24 +124,7 @@
 
     virtual ~basic_stringbuf ();
     
-    _C_string_type str () const {
-        const char_type * first_ = 0;
-        const char_type * last_ = 0;
-
-        if (this->_C_is_out ()) {
-            // in out only or in|out mode
-            first_ = this->pbase ();
-            last_ = this->egptr () < this->pptr () ?
-                this->pptr () : this->egptr ();
-        }
-        else if (this->_C_is_in ()) {
-            // in in only mode
-            first_ = this->eback ();
-            last_ = this->egptr ();
-        }
-
-        return _C_string_type (first_, last_ - first_);
-    }
+    _C_string_type str () const;
 
 #ifdef _RWSTD_NO_EXT_STRINGBUF_STR
 
@@ -194,6 +177,28 @@
     void _C_catchup (char_type*);
 };
 
+template <class _CharT, class _Traits, class _Allocator>
+inline basic_string<_CharT, _Traits, _Allocator>
+basic_stringbuf<_CharT, _Traits, _Allocator>::
+str () const {
+
+    const char_type * __first = 0;
+    const char_type * __last = 0;
+
+    if (this->_C_is_out ()) {
+        // in out only or in|out mode
+        __first = this->pbase ();
+        __last = this->egptr () < this->pptr () ?
+            this->pptr () : this->egptr ();
+    }
+    else if (this->_C_is_in ()) {
+        // in in only mode
+        __first = this->eback ();
+        __last = this->egptr ();
+    }
+
+    return _C_string_type (__first, __last - __first);
+}
 
 template <class _CharT, class _Traits, class _Allocator>
 inline _RWSTD_STREAMSIZE



Mime
View raw message