Date: Tuesday, January 30, 2007 @ 11:16:52
  Author: marc
    Path: /cvsroot/carob/carob/include

Modified: StringCodecs.hpp (1.26 -> 1.27)

Fixed comments.


------------------+
 StringCodecs.hpp |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)


Index: carob/include/StringCodecs.hpp
diff -u carob/include/StringCodecs.hpp:1.26 carob/include/StringCodecs.hpp:1.27
--- carob/include/StringCodecs.hpp:1.26 Fri Jan 19 16:02:51 2007
+++ carob/include/StringCodecs.hpp      Tue Jan 30 11:16:52 2007
@@ -49,8 +49,6 @@
 typedef std::codecvt<wchar_t, char, mbstate_t> mbs_codecvt;
 typedef std::codecvt_byname<wchar_t, char, mbstate_t> mbs_codecvt_byname;
 
-// This class should be splitted into interface and implementation,
-// the "MBS" part of being restricted to the implementation.
 
 // For a direct access to iconv read this:
 // 
file://localhost/usr/share/doc/gcc-4.0-base/libstdc++/html/22_locale/codecvt.html
@@ -90,12 +88,9 @@
  */
 class MBSCodec : public StringCodec
 {
-  // TODO: replace loc by an accessor, so we could dynamically use
-  // the (possibly changing) current locale() instead of a constant
-  // one.
-
   // Here order matters (see init below)
-  const std::locale loc; // hold our own (and cheap) copy for safety
+  // Hold our own (and cheap) copy so contained codecvt facet is not deleted
+  const std::locale loc;
   const mbs_codecvt& codecvt;
 
 public:
@@ -118,7 +113,7 @@
   { }
 
   /**
-   * Use locarg locale for conversions
+   * Use codecvt of locale locarg for conversions
    * @param locarg locale to be used
    */
   MBSCodec(const std::locale& locarg) :
@@ -127,7 +122,11 @@
   { }
 
   /**
-   * Use locale named locname for conversions
+   * Use codecvt of locale named locname for conversions.
+   *
+   * May log errors: this constructor is NOT allowed to construct a
+   * static!
+   *
    * @param locname name of the locale to be used
    */
   MBSCodec(const char* locname) throw (CodecException) :

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

Reply via email to