From dfcb78c081c6d975cf88dcb2e4cd1b0ada289c67 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 30 Sep 2013 22:03:43 +0200 Subject: [PATCH] [DEV] correction of replace --- etk/Buffer.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/etk/Buffer.h b/etk/Buffer.h index 1b311d6..f2d6f2f 100644 --- a/etk/Buffer.h +++ b/etk/Buffer.h @@ -338,6 +338,17 @@ namespace etk * @param[in] _items Data that might be inserted. */ void Replace(int32_t _pos, int32_t _nbRemoveElement, etk::Vector& _items) + { + Replace(_pos, _nbRemoveElement, _items.DataPointer(), _items.Size()); + } + /** + * @brief Replace specified data. + * @param[in] _pos The first element to remove. + * @param[in] _nbRemoveElement number of element to remove. + * @param[in] _items Data that might be inserted. + * @param[in] _nbElement Number of element that might be added. + */ + void Replace(int32_t _pos, int32_t _nbRemoveElement, int8_t* _items, int32_t _nbElement) { if( _pos > Size() || _pos < 0 ) { @@ -356,7 +367,7 @@ namespace etk m_gapEnd += _nbRemoveElement; //Display(); // insert elements - Insert(_pos, _items); + Insert(_pos, _items, _nbElement); // Resize buffer if needed... GapCheckMaxSize(); }