diff options
author | Jesse Hall <jessehall@google.com> | 2013-03-11 10:16:48 -0700 |
---|---|---|
committer | Alex Ray <aray@google.com> | 2013-07-30 13:57:01 -0700 |
commit | b73559d86c9017166da28e1d59a884f13417426d (patch) | |
tree | 309b276f7c3d2f3488a7d083699adedfe0581127 /include | |
parent | a729ab1e3be17ed20073f7c035df0433888164d6 (diff) | |
download | system_core-b73559d86c9017166da28e1d59a884f13417426d.zip system_core-b73559d86c9017166da28e1d59a884f13417426d.tar.gz system_core-b73559d86c9017166da28e1d59a884f13417426d.tar.bz2 |
Add Vector::resize()
Bug: 8384764
Change-Id: Icee83d389f3e555eba7d419b64c8d52a9aa21b8b
Diffstat (limited to 'include')
-rw-r--r-- | include/utils/Vector.h | 8 | ||||
-rw-r--r-- | include/utils/VectorImpl.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/utils/Vector.h b/include/utils/Vector.h index f3020d6..ed7b725 100644 --- a/include/utils/Vector.h +++ b/include/utils/Vector.h @@ -80,7 +80,13 @@ public: //! sets the capacity. capacity can never be reduced less than size() inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } - /*! + /*! + * set the size of the vector. items are appended with the default + * constructor, or removed from the end as needed. + */ + inline ssize_t resize(size_t size) { return VectorImpl::resize(size); } + + /*! * C-style array access */ diff --git a/include/utils/VectorImpl.h b/include/utils/VectorImpl.h index c4ec2ff..9bc50e6 100644 --- a/include/utils/VectorImpl.h +++ b/include/utils/VectorImpl.h @@ -64,6 +64,7 @@ public: inline bool isEmpty() const { return mCount == 0; } size_t capacity() const; ssize_t setCapacity(size_t size); + ssize_t resize(size_t size); /*! append/insert another vector or array */ ssize_t insertVectorAt(const VectorImpl& vector, size_t index); |