Date: Tuesday, January 24, 2006 @ 11:06:11
Author: gilles
Path: /cvsroot/carob/carob
Modified: include/ConnectionParameters.hpp (1.14 -> 1.15)
src/ConnectionParameters.cpp (1.12 -> 1.13)
Added convenience "to wstring" cast operator
Updated copyright
----------------------------------+
include/ConnectionParameters.hpp | 7 ++++++-
src/ConnectionParameters.cpp | 8 ++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
Index: carob/include/ConnectionParameters.hpp
diff -u carob/include/ConnectionParameters.hpp:1.14
carob/include/ConnectionParameters.hpp:1.15
--- carob/include/ConnectionParameters.hpp:1.14 Fri Jan 6 14:38:51 2006
+++ carob/include/ConnectionParameters.hpp Tue Jan 24 11:06:11 2006
@@ -1,6 +1,6 @@
/*
* Sequoia: Database clustering technology.
- * Copyright (C) 2005 Emic Networks
+ * Copyright (C) 2005-2006 Continuent, Inc.
* Contact: [EMAIL PROTECTED]
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -58,6 +58,11 @@
std::wstring getHostName() const { return host_name; }
/** Gives the host port */
in_port_t getHostPort() const { return host_port; }
+ /**
+ * Cast to wstring operator to ease printing (for debug/traces).
+ * @return sql query as a string
+ */
+ operator std::wstring () const;
private:
/** String representation of the host name, fully qualified or IP address */
std::wstring host_name;
Index: carob/src/ConnectionParameters.cpp
diff -u carob/src/ConnectionParameters.cpp:1.12
carob/src/ConnectionParameters.cpp:1.13
--- carob/src/ConnectionParameters.cpp:1.12 Fri Jan 6 14:38:51 2006
+++ carob/src/ConnectionParameters.cpp Tue Jan 24 11:06:11 2006
@@ -21,12 +21,16 @@
#include "ConnectionParameters.hpp"
+#include "Common.hpp"
+
using std::wstring;
using namespace CarobNS;
+
ControllerInfo::ControllerInfo() : host_name(L""), host_port(0)
{
}
+
ControllerInfo::ControllerInfo(const wstring &name, in_port_t port) :
host_name(name), host_port(port)
{
@@ -44,6 +48,10 @@
return ((host_name == ci.host_name) && (host_port == ci.host_port));
}
+ControllerInfo::operator std::wstring() const
+{
+ return (host_name + toWString((int)host_port));
+}
ConnectionParameters::ConnectionParameters(
const std::wstring& host /*= DEFAULT_DB*/,
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits