X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32193feb839f5597211caad34e0e289f6273d9a5..cd79f7b0d9f3fdd716e25a46e370e613e3d4c296:/include/wx/dynarray.h diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index fc49a0f260..702df0bad0 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -17,7 +17,6 @@ #endif #include "wx/defs.h" -#include "wx/debug.h" /** @name Dynamic arrays and object arrays (array which own their elements) @memo Arrays which grow on demand and do range checking (only in debug) @@ -304,7 +303,8 @@ public: \ void Insert(const T* pItem, size_t uiIndex) \ { wxBaseArray::Insert((long)pItem, uiIndex); } \ \ - void Empty(); \ + void Empty() { DoEmpty(); wxBaseArray::Empty(); } \ + void Clear() { DoEmpty(); wxBaseArray::Clear(); } \ \ T* Detach(size_t uiIndex) \ { T* p = (T*)wxBaseArray::Item(uiIndex); \ @@ -315,6 +315,7 @@ public: \ void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \ \ private: \ + void DoEmpty(); \ void DoCopy(const name& src); \ } @@ -448,6 +449,16 @@ WX_DEFINE_EXPORTED_ARRAY(void *, wxArrayPtrVoid); // convinience macros // ----------------------------------------------------------------------------- +// append all element of one array to another one +#define WX_APPEND_ARRAY(array, other) \ + { \ + size_t count = other.Count(); \ + for ( size_t n = 0; n < count; n++ ) \ + { \ + array.Add(other[n]); \ + } \ + } + // delete all array elements // // NB: the class declaration of the array elements must be visible from the