]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/string.h
Added DetachOldLog to avoid destruction of old log target
[wxWidgets.git] / include / wx / string.h
index 3296fb40f0315f735195af512684842d663d62a3..7cccebcad3b9ef04c1002ef088fbb8a79022d4b8 100644 (file)
@@ -390,6 +390,10 @@ struct WXDLLIMPEXP_BASE wxStringIteratorNode
     wxStringImpl::const_iterator *m_citer;
     wxStringImpl::iterator *m_iter;
     wxStringIteratorNode *m_prev, *m_next;
+
+    // the node belongs to a particular iterator instance, it's not copied
+    // when a copy of the iterator is made
+    DECLARE_NO_COPY_CLASS(wxStringIteratorNode)
 };
 #endif // wxUSE_UNICODE_UTF8
 
@@ -663,6 +667,8 @@ public:
   public:
       iterator(const iterator& i)
           : m_cur(i.m_cur), m_node(i.str(), &m_cur) {}
+      iterator& operator=(const iterator& i)
+        { m_cur = i.m_cur; return *this; }
 
       reference operator*()
         { return wxUniCharRef::CreateForString(m_node, m_cur); }
@@ -699,6 +705,11 @@ public:
       const_iterator(const iterator& i)
           : m_cur(i.m_cur), m_node(i.str(), &m_cur) {}
 
+      const_iterator& operator=(const const_iterator& i)
+        { m_cur = i.m_cur; return *this; }
+      const_iterator& operator=(const iterator& i)
+        { m_cur = i.m_cur; return *this; }
+
       reference operator*() const
         { return wxStringOperations::DecodeChar(m_cur); }
 
@@ -992,7 +1003,12 @@ public:
     wxString(const std::string& str)
         { assign(str.c_str(), str.length()); }
   #endif
+#endif // wxUSE_STD_STRING
 
+  // Unlike ctor from std::string, we provide conversion to std::string only
+  // if wxUSE_STL and not merely wxUSE_STD_STRING (which is on by default),
+  // because it conflicts with operator const char/wchar_t*:
+#if wxUSE_STL
   #if wxUSE_UNICODE_WCHAR && wxUSE_STL_BASED_WXSTRING
     // wxStringImpl is std::string in the encoding we want
     operator const wxStdWideString&() const { return m_impl; }
@@ -1165,8 +1181,13 @@ public:
 
     // implicit conversion to C string
     operator wxCStrData() const { return c_str(); }
+
+    // these operators conflict with operators for conversion to std::string,
+    // so they must be disabled in STL build:
+#if !wxUSE_STL
     operator const char*() const { return c_str(); }
     operator const wchar_t*() const { return c_str(); }
+#endif
 
     // implicit conversion to untyped pointer for compatibility with previous
     // wxWidgets versions: this is the same as conversion to const char * so it
@@ -2575,6 +2596,10 @@ private:
   {
       wxStringIteratorNodeHead() : ptr(NULL) {}
       wxStringIteratorNode *ptr;
+
+      // copying is disallowed as it would result in more than one pointer into
+      // the same linked list
+      DECLARE_NO_COPY_CLASS(wxStringIteratorNodeHead)
   };
 
   wxStringIteratorNodeHead m_iterators;