Author: mysqlpp
Date: Sun Dec  2 08:12:45 2007
New Revision: 1939

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1939&view=rev
Log:
Moved Connection::api_version to global scope, defined in mysql++
module, since get_library_version() is there already.

Modified:
    trunk/lib/connection.cpp
    trunk/lib/connection.h
    trunk/lib/mysql++.cpp
    trunk/lib/mysql++.h.in

Modified: trunk/lib/connection.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.cpp?rev=1939&r1=1938&r2=1939&view=diff
==============================================================================
--- trunk/lib/connection.cpp (original)
+++ trunk/lib/connection.cpp Sun Dec  2 08:12:45 2007
@@ -43,6 +43,10 @@
 using namespace std;
 
 namespace mysqlpp {
+
+// We could get this by #including mysql++.h but it does too many things
+// for our purposes within the MySQL++ internals.
+extern std::ostream& api_version(std::ostream& os);
 
 /// \brief Sets a variable to a given value temporarily.
 ///
@@ -141,19 +145,6 @@
 }
 
 
-ostream&
-Connection::api_version(ostream& os)
-{
-       const int major = MYSQL_VERSION_ID / 10000;
-       const int minor = (MYSQL_VERSION_ID - (major * 10000)) / 100;
-       const int bug = MYSQL_VERSION_ID - (major * 10000) - (minor * 100);
-
-       os << major << '.' << minor << '.' << bug;
-
-       return os;
-}
-
-
 bool
 Connection::bad_option(Option option, OptionError error)
 {

Modified: trunk/lib/connection.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.h?rev=1939&r1=1938&r2=1939&view=diff
==============================================================================
--- trunk/lib/connection.h (original)
+++ trunk/lib/connection.h Sun Dec  2 08:12:45 2007
@@ -174,12 +174,6 @@
                return mysql_affected_rows(&mysql_);
        }
 
-       /// \brief Insert C API version we're linked against into C++ stream
-       ///
-       /// Version will be of the form X.Y.Z, where X is the major version
-       /// number, Y the minor version, and Z the bug fix number.
-       std::ostream& api_version(std::ostream& os);
-
        /// \brief Get MySQL client library version
        ///
        /// Simply wraps \c mysql_get_client_info() in the C API.

Modified: trunk/lib/mysql++.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/mysql%2B%2B.cpp?rev=1939&r1=1938&r2=1939&view=diff
==============================================================================
--- trunk/lib/mysql++.cpp (original)
+++ trunk/lib/mysql++.cpp Sun Dec  2 08:12:45 2007
@@ -28,6 +28,19 @@
 
 namespace mysqlpp {
 
+std::ostream&
+api_version(std::ostream& os)
+{
+       const int major = MYSQL_VERSION_ID / 10000;
+       const int minor = (MYSQL_VERSION_ID - (major * 10000)) / 100;
+       const int bug = MYSQL_VERSION_ID - (major * 10000) - (minor * 100);
+
+       os << major << '.' << minor << '.' << bug;
+
+       return os;
+}
+
+
 unsigned int 
 get_library_version()
 {

Modified: trunk/lib/mysql++.h.in
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/mysql%2B%2B.h.in?rev=1939&r1=1938&r2=1939&view=diff
==============================================================================
--- trunk/lib/mysql++.h.in (original)
+++ trunk/lib/mysql++.h.in Sun Dec  2 08:12:45 2007
@@ -59,6 +59,12 @@
 #include "transaction.h"
 
 namespace mysqlpp {
+
+/// \brief Insert C API version we're linked against into C++ stream
+///
+/// Version will be of the form X.Y.Z, where X is the major version
+/// number, Y the minor version, and Z the bug fix number.
+std::ostream& api_version(std::ostream& os);
 
 /// \brief Get the current MySQL++ library version number
 ///


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to