]> git.saurik.com Git - wxWidgets.git/commitdiff
ANSI+Unicode compatibility fixes to wxArrayString
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 28 Jun 2007 18:56:00 +0000 (18:56 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 28 Jun 2007 18:56:00 +0000 (18:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/arrstrng.tex
include/wx/arrstr.h
src/common/arrstr.cpp

index a91d710d9de6dfbc17b9459673597c194dfeab1b..fa2bb0af50bc1fc6369f818cf628b4dd9931e11a 100644 (file)
@@ -67,7 +67,9 @@ Default constructor.
 Copy constructor. Note that when an array is assigned to a sorted array, its contents is
 automatically sorted during construction.
 
 Copy constructor. Note that when an array is assigned to a sorted array, its contents is
 automatically sorted during construction.
 
-\func{}{wxArrayString}{\param{size\_t}{ sz}, \param{const wxChar**}{ arr}}
+\func{}{wxArrayString}{\param{size\_t}{ sz}, \param{const char**}{ arr}}
+
+\func{}{wxArrayString}{\param{size\_t}{ sz}, \param{const wchar\_t**}{ arr}}
 
 Constructor from a C string array. Pass a size {\it sz} and array {\it arr}.
 
 
 Constructor from a C string array. Pass a size {\it sz} and array {\it arr}.
 
@@ -163,7 +165,7 @@ Returns the number of items in the array.
 
 \membersection{wxArrayString::Index}\label{wxarraystringindex}
 
 
 \membersection{wxArrayString::Index}\label{wxarraystringindex}
 
-\func{int}{Index}{\param{const wxChar *}{ sz}, \param{bool}{ bCase = true}, \param{bool}{ bFromEnd = false}}
+\func{int}{Index}{\param{const wxString\& }{ sz}, \param{bool}{ bCase = true}, \param{bool}{ bFromEnd = false}}
 
 Search the element in the array, starting from the beginning if
 {\it bFromEnd} is false or from end otherwise. If {\it bCase}, comparison is
 
 Search the element in the array, starting from the beginning if
 {\it bFromEnd} is false or from end otherwise. If {\it bCase}, comparison is
@@ -221,7 +223,7 @@ are done in release mode.
 
 \membersection{wxArrayString::Remove}\label{wxarraystringremove}
 
 
 \membersection{wxArrayString::Remove}\label{wxarraystringremove}
 
-\func{void}{Remove}{\param{const wxChar *}{ sz}}
+\func{void}{Remove}{\param{const wxString\&}{ sz}}
 
 Removes the first item matching this value. An assert failure is provoked by
 an attempt to remove an element which does not exist in debug build.
 
 Removes the first item matching this value. An assert failure is provoked by
 an attempt to remove an element which does not exist in debug build.
index d1e893cd3dba1126e3d8455161f7d6f2ee3ee570..7c7b29290c8b4d92b01173c42e0071f6ce47fe61 100644 (file)
@@ -104,7 +104,8 @@ public:
     //     supported it...
   wxArrayString(int autoSort) { Init(autoSort != 0); }
     // C string array ctor
     //     supported it...
   wxArrayString(int autoSort) { Init(autoSort != 0); }
     // C string array ctor
-  wxArrayString(size_t sz, const wxChar** a);
+  wxArrayString(size_t sz, const char** a);
+  wxArrayString(size_t sz, const wchar_t** a);
     // wxString string array ctor
   wxArrayString(size_t sz, const wxString* a);
     // copy ctor
     // wxString string array ctor
   wxArrayString(size_t sz, const wxString* a);
     // copy ctor
@@ -167,7 +168,7 @@ public:
     // expand the array to have count elements
   void SetCount(size_t count);
     // remove first item matching this value
     // expand the array to have count elements
   void SetCount(size_t count);
     // remove first item matching this value
-  void Remove(const wxChar *sz);
+  void Remove(const wxString& sz);
     // remove item by index
   void RemoveAt(size_t nIndex, size_t nRemove = 1);
 
     // remove item by index
   void RemoveAt(size_t nIndex, size_t nRemove = 1);
 
index ec41806616123b2fba1c8776d5a3c0c80aec668a..fe36a74bf8e5883054ef1500a50f5f16936099a5 100644 (file)
 // ArrayString
 // ============================================================================
 
 // ArrayString
 // ============================================================================
 
-wxArrayString::wxArrayString(size_t sz, const wxChar** a)
+wxArrayString::wxArrayString(size_t sz, const char** a)
+{
+#if !wxUSE_STL
+    Init(false);
+#endif
+    for (size_t i=0; i < sz; i++)
+        Add(a[i]);
+}
+
+wxArrayString::wxArrayString(size_t sz, const wchar_t** a)
 {
 #if !wxUSE_STL
     Init(false);
 {
 #if !wxUSE_STL
     Init(false);
@@ -355,7 +364,7 @@ void wxArrayString::RemoveAt(size_t nIndex, size_t nRemove)
 }
 
 // removes item from array (by value)
 }
 
 // removes item from array (by value)
-void wxArrayString::Remove(const wxChar *sz)
+void wxArrayString::Remove(const wxString& sz)
 {
   int iIndex = Index(sz);
 
 {
   int iIndex = Index(sz);