// 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);
}
// searches the array for an item (forward or backwards)
-int wxArrayString::Index(const wxChar *sz, bool bCase, bool bFromEnd) const
+int wxArrayString::Index(const wxString& str, bool bCase, bool bFromEnd) const
{
if ( m_autoSort ) {
// use binary search in the sorted array
while ( lo < hi ) {
i = (lo + hi)/2;
- res = wxStrcmp(sz, m_pItems[i]);
+ res = str.compare(m_pItems[i]);
if ( res < 0 )
hi = i;
else if ( res > 0 )
if ( m_nCount > 0 ) {
size_t ui = m_nCount;
do {
- if ( m_pItems[--ui].IsSameAs(sz, bCase) )
+ if ( m_pItems[--ui].IsSameAs(str, bCase) )
return ui;
}
while ( ui != 0 );
}
else {
for( size_t ui = 0; ui < m_nCount; ui++ ) {
- if( m_pItems[ui].IsSameAs(sz, bCase) )
+ if( m_pItems[ui].IsSameAs(str, bCase) )
return ui;
}
}
}
// removes item from array (by value)
-void wxArrayString::Remove(const wxChar *sz)
+void wxArrayString::Remove(const wxString& sz)
{
int iIndex = Index(sz);