X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/60d8e88654bc14d7c7016f1f8281a26656dc3b10..ce3b4b90c51756092f1db8e5d87d07adb0a96e73:/include/wx/arrstr.h diff --git a/include/wx/arrstr.h b/include/wx/arrstr.h index 36091d589a..95b3519e80 100644 --- a/include/wx/arrstr.h +++ b/include/wx/arrstr.h @@ -42,12 +42,20 @@ public: wxArrayString() { } wxArrayString(const wxArrayString& a) : wxArrayStringBase(a) { } + wxArrayString(size_t sz, const wxChar** a); + wxArrayString(size_t sz, const wxString* a); int Index(const wxChar* sz, bool bCase = true, bool bFromEnd = false) const; void Sort(bool reverseOrder = false); void Sort(CompareFunction function); void Sort(CMPFUNCwxString function) { wxArrayStringBase::Sort(function); } + + size_t Add(const wxString& string, size_t copies = 1) + { + wxArrayStringBase::Add(string, copies); + return size() - copies; + } }; class WXDLLIMPEXP_BASE wxSortedArrayString : public wxSortedArrayStringBase @@ -110,6 +118,10 @@ public: // of course, using explicit would be even better - if all compilers // supported it... wxArrayString(int autoSort) { Init(autoSort != 0); } + // C string array ctor + wxArrayString(size_t sz, const wxChar** a); + // wxString string array ctor + wxArrayString(size_t sz, const wxString* a); // copy ctor wxArrayString(const wxArrayString& array); // assignment operator @@ -155,13 +167,6 @@ public: return Item(Count() - 1); } - // return a wxString[], useful for the controls which - // take one in their ctor. You must delete[] it yourself - // once you are done with it. Will return NULL if the - // ArrayString was empty. -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( wxString* GetStringArray() const ); -#endif // item management // Search the element in the array, starting from the beginning if @@ -179,9 +184,6 @@ public: // remove first item matching this value void Remove(const wxChar *sz); // remove item by index -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( void Remove(size_t nIndex, size_t nRemove = 1) ); -#endif void RemoveAt(size_t nIndex, size_t nRemove = 1); // sorting @@ -316,7 +318,7 @@ private: size_t m_nSize, // current size of the array m_nCount; // current number of elements - wxChar **m_pItems; // pointer to data + const wxChar **m_pItems; // pointer to data bool m_autoSort; // if true, keep the array always sorted };