adjusted indentation with astyle; added Id keyword
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -9,49 +9,49 @@
|
||||
/**
|
||||
@class wxArrayString
|
||||
@wxheader{arrstr.h}
|
||||
|
||||
wxArrayString is an efficient container for storing
|
||||
wxString objects. It has the same features as all
|
||||
|
||||
wxArrayString is an efficient container for storing
|
||||
wxString objects. It has the same features as all
|
||||
wxArray classes, i.e. it dynamically expands when new items
|
||||
are added to it (so it is as easy to use as a linked list), but the access
|
||||
time to the elements is constant, instead of being linear in number of
|
||||
elements as in the case of linked lists. It is also very size efficient and
|
||||
doesn't take more space than a C array @e wxString[] type (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. 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 *
|
||||
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). In
|
||||
general, there is no need to worry about string memory deallocation when using
|
||||
this class - it will always free the memory it uses itself.
|
||||
|
||||
The references returned by wxArrayString::Item,
|
||||
wxArrayString::Last or
|
||||
|
||||
The references returned by wxArrayString::Item,
|
||||
wxArrayString::Last or
|
||||
@ref wxArrayString::operatorindex operator[] are not constant, so the
|
||||
array elements may be modified in place like this
|
||||
|
||||
|
||||
@code
|
||||
array.Last().MakeUpper();
|
||||
@endcode
|
||||
|
||||
|
||||
There is also a variant of wxArrayString called wxSortedArrayString which has
|
||||
exactly the same methods as wxArrayString, but which always keeps the string
|
||||
in it in (alphabetical) order. wxSortedArrayString uses binary search in its
|
||||
in it in (alphabetical) order. wxSortedArrayString uses binary search in its
|
||||
wxArrayString::Index function (instead of linear search for
|
||||
wxArrayString::Index) which makes it much more efficient if you add strings to
|
||||
the array rarely (because, of course, you have to pay for Index() efficiency
|
||||
by having Add() be slower) but search for them often. Several methods should
|
||||
not be used with sorted array (basically, all which break the order of items)
|
||||
which is mentioned in their description.
|
||||
|
||||
|
||||
Final word: none of the methods of wxArrayString is virtual including its
|
||||
destructor, so this class should not be used as a base class.
|
||||
|
||||
|
||||
@library{wxbase}
|
||||
@category{containers}
|
||||
|
||||
|
||||
@seealso
|
||||
wxArray, wxString, @ref overview_wxstringoverview "wxString overview"
|
||||
*/
|
||||
@@ -63,10 +63,10 @@ public:
|
||||
Constructor from a wxString array. Pass a size @e sz and array @e arr.
|
||||
*/
|
||||
wxArrayString();
|
||||
wxArrayString(const wxArrayString& array);
|
||||
wxArrayString(size_t sz, const char** arr);
|
||||
wxArrayString(size_t sz, const wchar_t** arr);
|
||||
wxArrayString(size_t sz, const wxString* arr);
|
||||
wxArrayString(const wxArrayString& array);
|
||||
wxArrayString(size_t sz, const char** arr);
|
||||
wxArrayString(size_t sz, const wchar_t** arr);
|
||||
wxArrayString(size_t sz, const wxString* arr);
|
||||
//@}
|
||||
|
||||
/**
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
void Clear();
|
||||
|
||||
/**
|
||||
Empties the array: after a call to this function
|
||||
Empties the array: after a call to this function
|
||||
GetCount() will return 0. However, this
|
||||
function does not free the memory used by the array and so should be used when
|
||||
the array is going to be reused for storing other strings. Otherwise, you
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
case sensitive (default), otherwise the case is ignored.
|
||||
|
||||
This function uses linear search for wxArrayString and binary search for
|
||||
wxSortedArrayString, but it ignores the @e bCase and @e bFromEnd
|
||||
wxSortedArrayString, but it ignores the @e bCase and @e bFromEnd
|
||||
parameters in the latter case.
|
||||
|
||||
Returns index of the first item matched or @c wxNOT_FOUND if there is no match.
|
||||
@@ -137,11 +137,11 @@ public:
|
||||
Insert the given number of @e copies of the new element in the array before the
|
||||
position @e nIndex. Thus, for
|
||||
example, to insert the string in the beginning of the array you would write
|
||||
If @e nIndex is equal to @e GetCount() this function behaves as
|
||||
If @e nIndex is equal to @e GetCount() this function behaves as
|
||||
Add().
|
||||
|
||||
@b Warning: this function should not be used with sorted arrays because it
|
||||
could break the order of items and, for example, subsequent calls to
|
||||
could break the order of items and, for example, subsequent calls to
|
||||
Index() would then not work!
|
||||
*/
|
||||
void Insert(const wxString& str, size_t nIndex,
|
||||
@@ -201,7 +201,8 @@ public:
|
||||
second one.
|
||||
*/
|
||||
void Sort(bool reverseOrder = @false);
|
||||
Warning: void Sort(CompareFunction compareFunction);
|
||||
Warning:
|
||||
void Sort(CompareFunction compareFunction);
|
||||
//@}
|
||||
|
||||
/**
|
||||
@@ -239,25 +240,25 @@ public:
|
||||
/**
|
||||
Splits the given wxString object using the separator @e sep and returns the
|
||||
result as a wxArrayString.
|
||||
|
||||
|
||||
If the @e escape character is non-@NULL, then the occurrences of @e sep
|
||||
immediately prefixed
|
||||
with @e escape are not considered as separators.
|
||||
|
||||
|
||||
Note that empty tokens will be generated if there are two or more adjacent
|
||||
separators.
|
||||
|
||||
|
||||
@sa wxJoin
|
||||
*/
|
||||
wxArrayString wxSplit(const wxString& str, const wxChar sep,
|
||||
const wxChar escape = '
|
||||
');
|
||||
');
|
||||
|
||||
/**
|
||||
Concatenate all lines of the given wxArrayString object using the separator @e
|
||||
sep and returns
|
||||
the result as a wxString.
|
||||
|
||||
|
||||
If the @e escape character is non-@NULL, then it's used as prefix for each
|
||||
occurrence of @e sep
|
||||
in the strings contained in @e arr before joining them which is necessary
|
||||
|
Reference in New Issue
Block a user