Author: afester
Date: Sun Nov 27 07:23:13 2005
New Revision: 349247

URL: http://svn.apache.org/viewcvs?rev=349247&view=rev
Log:
LOGCXX-82: move logstream operators to separate implementation file

Added:
    logging/log4cxx/trunk/src/logstream.cpp
Modified:
    logging/log4cxx/trunk/include/log4cxx/stream.h
    logging/log4cxx/trunk/src/Makefile.am

Modified: logging/log4cxx/trunk/include/log4cxx/stream.h
URL: 
http://svn.apache.org/viewcvs/logging/log4cxx/trunk/include/log4cxx/stream.h?rev=349247&r1=349246&r2=349247&view=diff
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/stream.h (original)
+++ logging/log4cxx/trunk/include/log4cxx/stream.h Sun Nov 27 07:23:13 2005
@@ -20,7 +20,6 @@
 #include <log4cxx/logger.h>
 #include <sstream>
 #include <log4cxx/spi/location/locationinfo.h>
-#include <log4cxx/helpers/transcoder.h>
 
 namespace log4cxx
 {
@@ -147,58 +146,30 @@
 
 }  // namespace log4cxx
 
-#if LOG4CXX_HAS_WCHAR_T
-log4cxx::logstream& operator<<(
-  ::log4cxx::logstream& lhs,
-  const char* rhs) {
-  LOG4CXX_DECODE_CHAR(tmp, rhs);
-  LOG4CXX_ENCODE_WCHAR(msg, tmp);
-  lhs.getStream() << msg;
-  return lhs;
-}
-#else
-log4cxx::logstream& operator<<(
+
+LOG4CXX_EXPORT ::log4cxx::logstream& operator<<(
   ::log4cxx::logstream& lhs,
-  const char* rhs) {
-  LOG4CXX_DECODE_CHAR(tmp, rhs);
-  LOG4CXX_ENCODE_CHAR(msg, tmp);
-  lhs.getStream() << msg;
-  return lhs;
-}
-#endif
+  const char* rhs);
 
 
-::log4cxx::logstream& operator<<(
+LOG4CXX_EXPORT ::log4cxx::logstream& operator<<(
    ::log4cxx::logstream& lhs,
-   const ::log4cxx::spi::LocationInfo& rhs) {
-   lhs.setLocation(rhs);
-   return lhs;
-}
+   const ::log4cxx::spi::LocationInfo& rhs);
 
 
-::log4cxx::logstream& operator<<(
+LOG4CXX_EXPORT ::log4cxx::logstream& operator<<(
    ::log4cxx::logstream& lhs,
-   const ::log4cxx::spi::LocationFlush& rhs) {
-   lhs.flush(rhs);
-   return lhs;
-}
-
-::log4cxx::logstream& operator<<(
-   ::log4cxx::logstream& lhs,
-   const ::log4cxx::LevelPtr& rhs) {
-   lhs.setLevel(rhs);
-   return lhs;
-}
+   const ::log4cxx::spi::LocationFlush& rhs);
 
 
-::log4cxx::logstream& operator<<(
+LOG4CXX_EXPORT ::log4cxx::logstream& operator<<(
    ::log4cxx::logstream& lhs,
-   ::std::ios_base& (*manip)(::std::ios_base&)) {
-     (*manip)(lhs);
-   return lhs;
-}
+   const ::log4cxx::LevelPtr& rhs);
 
 
+LOG4CXX_EXPORT ::log4cxx::logstream& operator<<(
+   ::log4cxx::logstream& lhs,
+   ::std::ios_base& (*manip)(::std::ios_base&));
 
 
 //
@@ -213,6 +184,7 @@
    }
    return lhs;
 }
+
 
 #if !defined(LOG4CXX_ENDMSG)
 #define LOG4CXX_ENDMSG LOG4CXX_LOCATION_FLUSH

Modified: logging/log4cxx/trunk/src/Makefile.am
URL: 
http://svn.apache.org/viewcvs/logging/log4cxx/trunk/src/Makefile.am?rev=349247&r1=349246&r2=349247&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/Makefile.am (original)
+++ logging/log4cxx/trunk/src/Makefile.am Sun Nov 27 07:23:13 2005
@@ -68,6 +68,7 @@
         loggingevent.cpp \
         loglog.cpp \
         logmanager.cpp \
+        logstream.cpp \
         manualtriggeringpolicy.cpp \
         messagepatternconverter.cpp \
         methodlocationpatternconverter.cpp \

Added: logging/log4cxx/trunk/src/logstream.cpp
URL: 
http://svn.apache.org/viewcvs/logging/log4cxx/trunk/src/logstream.cpp?rev=349247&view=auto
==============================================================================
--- logging/log4cxx/trunk/src/logstream.cpp (added)
+++ logging/log4cxx/trunk/src/logstream.cpp Sun Nov 27 07:23:13 2005
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <log4cxx/stream.h>
+#include <log4cxx/helpers/transcoder.h>
+
+#if LOG4CXX_HAS_WCHAR_T
+log4cxx::logstream& operator<<(
+  ::log4cxx::logstream& lhs,
+  const char* rhs) {
+  LOG4CXX_DECODE_CHAR(tmp, rhs);
+  LOG4CXX_ENCODE_WCHAR(msg, tmp);
+  lhs.getStream() << msg;
+  return lhs;
+}
+#else
+log4cxx::logstream& operator<<(
+  ::log4cxx::logstream& lhs,
+  const char* rhs) {
+  LOG4CXX_DECODE_CHAR(tmp, rhs);
+  LOG4CXX_ENCODE_CHAR(msg, tmp);
+  lhs.getStream() << msg;
+  return lhs;
+}
+#endif
+
+::log4cxx::logstream& operator<<(
+   ::log4cxx::logstream& lhs,
+   const ::log4cxx::spi::LocationInfo& rhs) {
+   lhs.setLocation(rhs);
+   return lhs;
+}
+
+
+::log4cxx::logstream& operator<<(
+   ::log4cxx::logstream& lhs,
+   const ::log4cxx::spi::LocationFlush& rhs) {
+   lhs.flush(rhs);
+   return lhs;
+}
+
+::log4cxx::logstream& operator<<(
+   ::log4cxx::logstream& lhs,
+   const ::log4cxx::LevelPtr& rhs) {
+   lhs.setLevel(rhs);
+   return lhs;
+}
+
+
+::log4cxx::logstream& operator<<(
+   ::log4cxx::logstream& lhs,
+   ::std::ios_base& (*manip)(::std::ios_base&)) {
+     (*manip)(lhs);
+   return lhs;
+}


Reply via email to