summaryrefslogtreecommitdiff
path: root/cpp/Element.cpp
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2013-08-12 12:37:18 -0700
committerTim Murray <timmurray@google.com>2013-08-14 01:15:11 +0000
commitab71636b50db242cead6a3787620d6340156684c (patch)
tree95d3cea76e4bcb7a0db4b5500a94e8376e268257 /cpp/Element.cpp
parent8e0edc869aa8d7dbe8d629785b834a5e67d31a4d (diff)
downloadrs-ab71636b50db242cead6a3787620d6340156684c.tar.gz
remove string8, replace with std::string from stlport
also remove unnecessary ALOGEs from header Change-Id: I52953f5edc47fece953fbc3f91c732fcbbfe2d04 (cherry picked from commit f9b6346e62848565a4b45fd1123d41df7634bfd5)
Diffstat (limited to 'cpp/Element.cpp')
-rw-r--r--cpp/Element.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/cpp/Element.cpp b/cpp/Element.cpp
index d4b2c66a..35f081db 100644
--- a/cpp/Element.cpp
+++ b/cpp/Element.cpp
@@ -39,7 +39,7 @@ const char * Element::getSubElementName(uint32_t index) {
if (index >= mVisibleElementMap.size()) {
mRS->throwError("Illegal sub-element index");
}
- return mElementNames[mVisibleElementMap[index]].string();
+ return mElementNames[mVisibleElementMap[index]].c_str();
}
size_t Element::getSubElementArraySize(uint32_t index) {
@@ -135,14 +135,14 @@ void Element::updateVisibleSubElements() {
size_t fieldCount = mElementNames.size();
// Find out how many elements are not padding
for (size_t ct = 0; ct < fieldCount; ct ++) {
- if (mElementNames[ct].string()[0] != '#') {
+ if (mElementNames[ct].c_str()[0] != '#') {
noPaddingFieldCount ++;
}
}
// Make a map that points us at non-padding elements
for (size_t ct = 0; ct < fieldCount; ct ++) {
- if (mElementNames[ct].string()[0] != '#') {
+ if (mElementNames[ct].c_str()[0] != '#') {
mVisibleElementMap.push_back((uint32_t)ct);
}
}
@@ -150,7 +150,7 @@ void Element::updateVisibleSubElements() {
Element::Element(void *id, android::RSC::sp<RS> rs,
std::vector<android::RSC::sp<Element> > &elements,
- std::vector<android::String8> &elementNames,
+ std::vector<std::string> &elementNames,
std::vector<uint32_t> &arraySizes) : BaseObj(id, rs) {
mSizeBytes = 0;
mVectorSize = 1;
@@ -337,11 +337,11 @@ Element::Builder::Builder(android::RSC::sp<RS> rs) {
mSkipPadding = false;
}
-void Element::Builder::add(android::RSC::sp</*const*/ Element>e, android::String8 &name, uint32_t arraySize) {
+void Element::Builder::add(android::RSC::sp</*const*/ Element>e, std::string &name, uint32_t arraySize) {
// Skip padding fields after a vector 3 type.
if (mSkipPadding) {
const char *s1 = "#padding_";
- const char *s2 = name.string();
+ const char *s2 = name.c_str();
size_t len = strlen(s1);
if (strlen(s2) >= len) {
if (!memcmp(s1, s2, len)) {
@@ -369,7 +369,7 @@ android::RSC::sp<const Element> Element::Builder::create() {
size_t* sizeArray = (size_t*)calloc(fieldCount, sizeof(size_t));
for (size_t ct = 0; ct < fieldCount; ct++) {
- nameArray[ct] = mElementNames[ct].string();
+ nameArray[ct] = mElementNames[ct].c_str();
elementArray[ct] = mElements[ct].get();
sizeArray[ct] = mElementNames[ct].length();
}