You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by ca...@apache.org on 2008/01/04 20:59:35 UTC

svn commit: r608975 - in /logging/log4cxx/trunk/src: main/cpp/messagebuffer.cpp main/cpp/simpledateformat.cpp main/include/log4cxx/helpers/messagebuffer.h test/cpp/streamtestcase.cpp

Author: carnold
Date: Fri Jan  4 11:59:33 2008
New Revision: 608975

URL: http://svn.apache.org/viewvc?rev=608975&view=rev
Log:
LOGCXX-74: MinGW doesn't define std::wostream, etc

Modified:
    logging/log4cxx/trunk/src/main/cpp/messagebuffer.cpp
    logging/log4cxx/trunk/src/main/cpp/simpledateformat.cpp
    logging/log4cxx/trunk/src/main/include/log4cxx/helpers/messagebuffer.h
    logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp

Modified: logging/log4cxx/trunk/src/main/cpp/messagebuffer.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/cpp/messagebuffer.cpp?rev=608975&r1=608974&r2=608975&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/cpp/messagebuffer.cpp (original)
+++ logging/log4cxx/trunk/src/main/cpp/messagebuffer.cpp Fri Jan  4 11:59:33 2008
@@ -168,22 +168,22 @@
     return (stream != 0);
 }
 
-std::wostream& WideMessageBuffer::operator<<(ios_base_manip manip) {
-	std::wostream& s = *this;
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(ios_base_manip manip) {
+	std::basic_ostream<wchar_t>& s = *this;
 	(*manip)(s);
 	return s;
 }
 
-std::wostream& WideMessageBuffer::operator<<(bool val) { return ((std::wostream&) *this).operator<<(val); }
-std::wostream& WideMessageBuffer::operator<<(short val) { return ((std::wostream&) *this).operator<<(val); }
-std::wostream& WideMessageBuffer::operator<<(int val) { return ((std::wostream&) *this).operator<<(val); }
-std::wostream& WideMessageBuffer::operator<<(unsigned int val) { return ((std::wostream&) *this).operator<<(val); }
-std::wostream& WideMessageBuffer::operator<<(long val) { return ((std::wostream&) *this).operator<<(val); }
-std::wostream& WideMessageBuffer::operator<<(unsigned long val) { return ((std::wostream&) *this).operator<<(val); }
-std::wostream& WideMessageBuffer::operator<<(float val) { return ((std::wostream&) *this).operator<<(val); }
-std::wostream& WideMessageBuffer::operator<<(double val) { return ((std::wostream&) *this).operator<<(val); }
-std::wostream& WideMessageBuffer::operator<<(long double val) { return ((std::wostream&) *this).operator<<(val); }
-std::wostream& WideMessageBuffer::operator<<(void* val) { return ((std::wostream&) *this).operator<<(val); }
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(bool val) { return ((std::basic_ostream<wchar_t>&) *this).operator<<(val); }
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(short val) { return ((std::basic_ostream<wchar_t>&) *this).operator<<(val); }
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(int val) { return ((std::basic_ostream<wchar_t>&) *this).operator<<(val); }
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(unsigned int val) { return ((std::basic_ostream<wchar_t>&) *this).operator<<(val); }
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(long val) { return ((std::basic_ostream<wchar_t>&) *this).operator<<(val); }
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(unsigned long val) { return ((std::basic_ostream<wchar_t>&) *this).operator<<(val); }
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(float val) { return ((std::basic_ostream<wchar_t>&) *this).operator<<(val); }
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(double val) { return ((std::basic_ostream<wchar_t>&) *this).operator<<(val); }
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(long double val) { return ((std::basic_ostream<wchar_t>&) *this).operator<<(val); }
+std::basic_ostream<wchar_t>& WideMessageBuffer::operator<<(void* val) { return ((std::basic_ostream<wchar_t>&) *this).operator<<(val); }
 
 
 MessageBuffer::MessageBuffer()  : wbuf(0)
@@ -264,7 +264,7 @@
 	return wbuf->str(buf);
 }
 
-const std::wstring& MessageBuffer::str(std::wostream& os) {
+const std::wstring& MessageBuffer::str(std::basic_ostream<wchar_t>& os) {
 	return wbuf->str(os);
 }
 

Modified: logging/log4cxx/trunk/src/main/cpp/simpledateformat.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/cpp/simpledateformat.cpp?rev=608975&r1=608974&r2=608975&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/cpp/simpledateformat.cpp (original)
+++ logging/log4cxx/trunk/src/main/cpp/simpledateformat.cpp Fri Jan  4 11:59:33 2008
@@ -119,7 +119,7 @@
                     if (HAS_FACET(*locale, std::time_put<wchar_t>)) {
                         const std::time_put<wchar_t>& facet = USE_FACET(*locale, std::time_put<wchar_t>);
                         size_t start = 0;
-                        std::wostringstream os;
+                        std::basic_ostringstream<wchar_t> os;
                         for(; valueIter != values.end(); valueIter++) {
                             PUT_FACET(facet, os, &time, (wchar_t) wspec);
                             Transcoder::decode(os.str().substr(start), *valueIter);

Modified: logging/log4cxx/trunk/src/main/include/log4cxx/helpers/messagebuffer.h
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/include/log4cxx/helpers/messagebuffer.h?rev=608975&r1=608974&r2=608975&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/include/log4cxx/helpers/messagebuffer.h (original)
+++ logging/log4cxx/trunk/src/main/include/log4cxx/helpers/messagebuffer.h Fri Jan  4 11:59:33 2008
@@ -415,68 +415,68 @@
          *   @param manip manipulator.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(ios_base_manip manip);
+        std::basic_ostream<wchar_t>& operator<<(ios_base_manip manip);
         /**
          *   Insertion operator for built-in type.
          *   @param val build in type.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(bool val);
+        std::basic_ostream<wchar_t>& operator<<(bool val);
 
         /**
          *   Insertion operator for built-in type.
          *   @param val build in type.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(short val);
+        std::basic_ostream<wchar_t>& operator<<(short val);
         /**
          *   Insertion operator for built-in type.
          *   @param val build in type.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(int val);
+        std::basic_ostream<wchar_t>& operator<<(int val);
         /**
          *   Insertion operator for built-in type.
          *   @param val build in type.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(unsigned int val);
+        std::basic_ostream<wchar_t>& operator<<(unsigned int val);
         /**
          *   Insertion operator for built-in type.
          *   @param val build in type.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(long val);
+        std::basic_ostream<wchar_t>& operator<<(long val);
         /**
          *   Insertion operator for built-in type.
          *   @param val build in type.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(unsigned long val);
+        std::basic_ostream<wchar_t>& operator<<(unsigned long val);
         /**
          *   Insertion operator for built-in type.
          *   @param val build in type.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(float val);
+        std::basic_ostream<wchar_t>& operator<<(float val);
         /**
          *   Insertion operator for built-in type.
          *   @param val build in type.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(double val);
+        std::basic_ostream<wchar_t>& operator<<(double val);
         /**
          *   Insertion operator for built-in type.
          *   @param val build in type.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(long double val);
+        std::basic_ostream<wchar_t>& operator<<(long double val);
         /**
          *   Insertion operator for built-in type.
          *   @param val build in type.
          *   @return encapsulated STL stream.
          */
-        std::wostream& operator<<(void* val);
+        std::basic_ostream<wchar_t>& operator<<(void* val);
 
 
         /**
@@ -748,7 +748,7 @@
 		 *       the character type and that
 		 *       the embedded stream was used.
 		 */
-		const std::wstring& str(std::wostream& os);
+		const std::wstring& str(std::basic_ostream<wchar_t>& os);
         
 #if LOG4CXX_UNICHAR_API || LOG4CXX_CFSTRING_API
 		/**

Modified: logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp?rev=608975&r1=608974&r2=608975&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp Fri Jan  4 11:59:33 2008
@@ -391,7 +391,7 @@
           CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
        }
        
-       void wreport(std::wostream& os) {
+       void wreport(std::basic_ostream<wchar_t>& os) {
           os << L"This just in: \n";
           os << L"Use logstream in places that expect a std::ostream.\n";
        }