Date: Friday, January 27, 2006 @ 18:33:58
  Author: marc
    Path: /cvsroot/carob/carob/src

Modified: ParameterStatement.cpp (1.13 -> 1.14)

Templatized setBoolean() CAROB-55


------------------------+
 ParameterStatement.cpp |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)


Index: carob/src/ParameterStatement.cpp
diff -u carob/src/ParameterStatement.cpp:1.13 
carob/src/ParameterStatement.cpp:1.14
--- carob/src/ParameterStatement.cpp:1.13       Fri Jan 27 16:06:42 2006
+++ carob/src/ParameterStatement.cpp    Fri Jan 27 18:33:58 2006
@@ -16,7 +16,7 @@
  * limitations under the License.
  *
  * Initial developer(s): Zsolt Simon
- * Contributor(s): Gilles Rayrat
+ * Contributor(s): Gilles Rayrat, Marc Herbert
  */
 #include "ParameterStatement.hpp"
 
@@ -72,9 +72,6 @@
                                                      + TAG_MARKER
                                                      + L">";
 
-const std::wstring wsBoolFalse                       = L"false";
-const std::wstring wsBoolTrue                        = L"true";
-
 }
 
 using std::wstring;
@@ -254,8 +251,8 @@
   basic_ostream<wchar_t>& wrapped_stream;
 public:
   FPoneShotFilter(basic_ostream<wchar_t>& s) : wrapped_stream(s) { } ;
-  basic_ostream<wchar_t>&
 
+  basic_ostream<wchar_t>&
   // This is the actual filtering operator
   operator<< (FP value)
   { 
@@ -297,6 +294,18 @@
   oneShotFilter(basic_ostream<wchar_t>& s) : FPoneShotFilter<float>(s) { } ;
 };
 
+// template specialization for bool
+template<class Ch>
+class streamSettings<bool, Ch>
+{
+public:
+  void doManip(basic_ostream<Ch>& s) const
+  {
+    s.imbue(locC);
+    s << std::boolalpha;
+  };
+};
+
 
 } // namespace CarobNS
 
@@ -355,7 +364,7 @@
 void ParameterStatement::setBoolean(const int parameterIndex, const bool x)
     throw (DriverException, UnexpectedException)
 {
-  set<wstring>(parameterIndex, BOOLEAN_TAG, x ? wsBoolTrue : wsBoolFalse);
+  set<bool>(parameterIndex, BOOLEAN_TAG, x);
 }
 
 void ParameterStatement::setByte(const int parameterIndex, const java_byte x)

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to