summaryrefslogtreecommitdiffstats
path: root/include/utils/string_array.h
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:43 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:43 -0800
commite09fd9e819c23dc90bca68375645e15544861330 (patch)
tree9a9fdadd1301625f875a3c126c986c79e3363ac4 /include/utils/string_array.h
parent7c1b96a165f970a09ed239bb4fb3f1b0d8f2a407 (diff)
downloadframeworks_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.h13
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;