X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b02f1c862d1a3fcd714aef37e67decaa9d67b611..ad51d1c8e95c143eaac1b653ebd2a2124373a4a0:/interface/arrstr.h diff --git a/interface/arrstr.h b/interface/arrstr.h index a5c24c3493..34652fe144 100644 --- a/interface/arrstr.h +++ b/interface/arrstr.h @@ -27,7 +27,7 @@ (wxArrayString uses its knowledge of internals of wxString class to achieve this). This class is used in the same way as other dynamic arrays(), except that no - @e WX_DEFINE_ARRAY declaration is needed for it. + ::WX_DEFINE_ARRAY declaration is needed for it. When a string is added or inserted in the array, a copy of the string is created, so the original string may be safely deleted (e.g. if it was a @e wxChar * pointer the memory it was using can be freed immediately after this). @@ -71,14 +71,14 @@ public: //@{ /** - Constructor from a C string array. Pass a size sz and array arr. + Constructor from a C string array. Pass a size @a sz and an array @a arr. **/ wxArrayString(size_t sz, const char** arr); wxArrayString(size_t sz, const wchar_t** arr); //@} /** - Constructor from a wxString array. Pass a size @a sz and array @e arr. + Constructor from a wxString array. Pass a size @a sz and array @a arr. */ wxArrayString(size_t sz, const wxString* arr); @@ -129,50 +129,49 @@ public: /** Search the element in the array, starting from the beginning if @a bFromEnd - is @false or from end otherwise. If @e bCase, comparison is case sensitive + is @false or from end otherwise. If @a bCase, comparison is case sensitive (default), otherwise the case is ignored. This function uses linear search for wxArrayString. Returns index of the first item matched or @c wxNOT_FOUND if there is no match. */ - int Index(const wxString& sz, bool bCase = true, - bool bFromEnd = false); + int Index(const wxString& sz, bool bCase = true, bool bFromEnd = false) const; /** Insert the given number of @a copies of the new element in the array before the - position @e nIndex. Thus, for example, to insert the string in the beginning of + position @a nIndex. Thus, for example, to insert the string in the beginning of the array you would write: @code Insert("foo", 0); @endcode - If @a nIndex is equal to @e GetCount() this function behaves as Add(). + If @a nIndex is equal to GetCount() this function behaves as Add(). */ void Insert(const wxString& str, size_t nIndex, size_t copies = 1); /** Returns @true if the array is empty, @false otherwise. This function returns the - same result as @e GetCount() == 0 but is probably easier to read. + same result as GetCount() == 0 but is probably easier to read. */ - bool IsEmpty(); + bool IsEmpty() const; /** - Return the array element at position @e nIndex. An assert failure will + Return the array element at position @a nIndex. An assert failure will result from an attempt to access an element beyond the end of array in debug mode, but no check is done in release mode. @see operator[] for the operator version. */ - wxString Item(size_t nIndex) const; + wxString& Item(size_t nIndex) const; /** Returns the last element of the array. Attempt to access the last element of an empty array will result in assert failure in debug build, however no checks are done in release mode. */ - wxString Last(); + wxString& Last() const; /** Removes the first item matching this value. An assert failure is provoked by @@ -206,7 +205,7 @@ public: /** Sorts the array using the specified @a compareFunction for item comparison. - @e CompareFunction is defined as a function taking two @e const wxString + @a CompareFunction is defined as a function taking two @e const wxString parameters and returning an @e int value less than, equal to or greater than 0 if the first string is less than, equal to or greater than the second one. @@ -243,7 +242,7 @@ public: /** Assignment operator. */ - wxArrayString operator =(const wxArrayString& array); + wxArrayString& operator=(const wxArrayString&); /** Compares 2 arrays respecting the case. Returns @true only if the arrays have @@ -252,13 +251,13 @@ public: bool operator ==(const wxArrayString& array) const; /** - Return the array element at position @e nIndex. An assert failure will + Return the array element at position @a nIndex. An assert failure will result from an attempt to access an element beyond the end of array in debug mode, but no check is done in release mode. This is the operator version of the Item() method. */ - wxString operator[](size_t nIndex); + wxString& operator[](size_t nIndex) const; }; @@ -351,6 +350,8 @@ public: separators. @see wxJoin() + + @header{wx/arrstr.h} */ wxArrayString wxSplit(const wxString& str, const wxChar sep, const wxChar escape = '\\'); @@ -360,13 +361,16 @@ wxArrayString wxSplit(const wxString& str, const wxChar sep, @a sep and returns the result as a wxString. If the @a escape character is non-@NULL, then it's used as prefix for each - occurrence of @e sep in the strings contained in @a arr before joining them - which is necessary in order to be able to recover the original array contents - from the string later using wxSplit(). + occurrence of @a sep in the strings contained in @a arr before joining them + which is necessary in order to be able to recover the original array + contents from the string later using wxSplit(). @see wxSplit() + + @header{wx/arrstr.h} */ wxString wxJoin(const wxArrayString& arr, const wxChar sep, const wxChar escape = '\\'); //@} +