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 | f013e1afd1e68af5e3b868c26a653bbfb39538f8 (patch) | |
| tree | 7ad6c8fd9c7b55f4b4017171dec1cb760bbd26bf /include/utils/string_array.h | |
| parent | e70cfafe580c6f2994c4827cd8a534aabf3eb05c (diff) | |
| download | frameworks_base-f013e1afd1e68af5e3b868c26a653bbfb39538f8.zip frameworks_base-f013e1afd1e68af5e3b868c26a653bbfb39538f8.tar.gz frameworks_base-f013e1afd1e68af5e3b868c26a653bbfb39538f8.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; |
