Tag: cws_src680_sdblogging
User: fs      
Date: 2007/04/12 04:20:55

Modified:
   dba/connectivity/source/drivers/jdbc/ConnectionLog.cxx

Log:
 #i10000# declare various convertLogArgToString overloads in this file here

File Changes:

Directory: /dba/connectivity/source/drivers/jdbc/
=================================================

File [changed]: ConnectionLog.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/jdbc/ConnectionLog.cxx?r1=1.1.2.2&r2=1.1.2.3
Delta lines:  +59 -2
--------------------
--- ConnectionLog.cxx   11 Apr 2007 13:52:04 -0000      1.1.2.2
+++ ConnectionLog.cxx   12 Apr 2007 11:20:52 -0000      1.1.2.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ConnectionLog.cxx,v $
  *
- *  $Revision: 1.1.2.2 $
+ *  $Revision: 1.1.2.3 $
  *
- *  last change: $Author: fs $ $Date: 2007/04/11 13:52:04 $
+ *  last change: $Author: fs $ $Date: 2007/04/12 11:20:52 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -36,6 +36,15 @@
 #include "java/sql/ConnectionLog.hxx"
 
 /** === begin UNO includes === **/
+#ifndef _COM_SUN_STAR_UTIL_DATE_HPP_
+#include <com/sun/star/util/Date.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_TIME_HPP_
+#include <com/sun/star/util/Time.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_
+#include <com/sun/star/util/DateTime.hpp>
+#endif
 /** === end UNO includes === **/
 
 //........................................................................
@@ -83,4 +92,52 @@
 
 //........................................................................
 } } } // namespace connectivity::java::sql
+//........................................................................
+
+//........................................................................
+namespace comphelper { namespace log { namespace convert
+{
+//........................................................................
+
+       /** === begin UNO using === **/
+    using ::com::sun::star::uno::Reference;
+    using ::com::sun::star::uno::XComponentContext;
+    using ::com::sun::star::util::Date;
+    using ::com::sun::star::util::Time;
+    using ::com::sun::star::util::DateTime;
+       /** === end UNO using === **/
+
+    //--------------------------------------------------------------------
+    ::rtl::OUString convertLogArgToString( const Date& _rDate )
+    {
+        char buffer[ 30 ];
+        const size_t buffer_size = sizeof( buffer );
+        snprintf( buffer, buffer_size, "%04i-%02i-%02i",
+            (int)_rDate.Year, (int)_rDate.Month, (int)_rDate.Day );
+        return ::rtl::OUString::createFromAscii( buffer );
+    }
+
+    //--------------------------------------------------------------------
+    ::rtl::OUString convertLogArgToString( const Time& _rTime )
+    {
+        char buffer[ 30 ];
+        const size_t buffer_size = sizeof( buffer );
+        snprintf( buffer, buffer_size, "%02i:%02i:%02i.%02i",
+            (int)_rTime.Hours, (int)_rTime.Minutes, (int)_rTime.Seconds, 
(int)_rTime.HundredthSeconds );
+        return ::rtl::OUString::createFromAscii( buffer );
+    }
+
+    //--------------------------------------------------------------------
+    ::rtl::OUString convertLogArgToString( const DateTime& _rDateTime )
+    {
+        char buffer[ 30 ];
+        const size_t buffer_size = sizeof( buffer );
+        snprintf( buffer, buffer_size, "%04i-%02i-%02i %02i:%02i:%02i.%02i",
+            (int)_rDateTime.Year, (int)_rDateTime.Month, (int)_rDateTime.Day,
+            (int)_rDateTime.Hours, (int)_rDateTime.Minutes, 
(int)_rDateTime.Seconds, (int)_rDateTime.HundredthSeconds );
+        return ::rtl::OUString::createFromAscii( buffer );
+    }
+
+//........................................................................
+} } }   // comphelper::log::convert
 //........................................................................




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to