diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:43 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:43 -0800 |
commit | e09fd9e819c23dc90bca68375645e15544861330 (patch) | |
tree | 9a9fdadd1301625f875a3c126c986c79e3363ac4 /include/utils/string_array.h | |
parent | 7c1b96a165f970a09ed239bb4fb3f1b0d8f2a407 (diff) | |
download | frameworks_native-e09fd9e819c23dc90bca68375645e15544861330.zip frameworks_native-e09fd9e819c23dc90bca68375645e15544861330.tar.gz frameworks_native-e09fd9e819c23dc90bca68375645e15544861330.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'include/utils/string_array.h')
-rw-r--r-- | include/utils/string_array.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/utils/string_array.h b/include/utils/string_array.h index ede0644..064dda2 100644 --- a/include/utils/string_array.h +++ b/include/utils/string_array.h @@ -111,6 +111,19 @@ public: return mArray[idx]; } + // + // Set entry N to specified string. + // [should use operator[] here] + // + void setEntry(int idx, const char* str) { + if (idx < 0 || idx >= mCurrent) + return; + delete[] mArray[idx]; + int len = strlen(str); + mArray[idx] = new char[len+1]; + memcpy(mArray[idx], str, len+1); + } + private: int mMax; int mCurrent; |