Lines Matching refs:item

67         Item *item = &mItems[i];
68 delete[] item->mName;
69 item->mName = NULL;
70 freeItemValue(item);
75 void AMessage::freeItemValue(Item *item) {
76 switch (item->mType) {
79 delete item->u.stringValue;
87 if (item->u.refValue != NULL) {
88 item->u.refValue->decStrong(this);
157 // assumes item's name was uninitialized or NULL
167 Item *item;
170 item = &mItems[i];
171 freeItemValue(item);
175 item = &mItems[i];
176 item->setName(name, len);
179 return item;
186 const Item *item = &mItems[i];
187 return item->mType == type ? item : NULL;
200 Item *item = allocateItem(name); \
202 item->mType = kType##NAME; \
203 item->u.FIELDNAME = value; \
207 const Item *item = findItem(name, kType##NAME); \
208 if (item) { \
209 *value = item->u.FIELDNAME; \
226 Item *item = allocateItem(name);
227 item->mType = kTypeString;
228 item->u.stringValue = new AString(s, len < 0 ? strlen(s) : len);
238 Item *item = allocateItem(name);
239 item->mType = type;
242 item->u.refValue = obj.get();
254 Item *item = allocateItem(name);
255 item->mType = kTypeMessage;
258 item->u.refValue = obj.get();
264 Item *item = allocateItem(name);
265 item->mType = kTypeRect;
267 item->u.rectValue.mLeft = left;
268 item->u.rectValue.mTop = top;
269 item->u.rectValue.mRight = right;
270 item->u.rectValue.mBottom = bottom;
274 const Item *item = findItem(name, kTypeString);
275 if (item) {
276 *value = *item->u.stringValue;
283 const Item *item = findItem(name, kTypeObject);
284 if (item) {
285 *obj = item->u.refValue;
292 const Item *item = findItem(name, kTypeBuffer);
293 if (item) {
294 *buf = (ABuffer *)(item->u.refValue);
301 const Item *item = findItem(name, kTypeMessage);
302 if (item) {
303 *obj = static_cast<AMessage *>(item->u.refValue);
312 const Item *item = findItem(name, kTypeRect);
313 if (item == NULL) {
317 *left = item->u.rectValue.mLeft;
318 *top = item->u.rectValue.mTop;
319 *right = item->u.rectValue.mRight;
320 *bottom = item->u.rectValue.mBottom;
447 const Item &item = mItems[i];
449 switch (item.mType) {
452 "int32_t %s = %d", item.mName, item.u.int32Value);
456 "int64_t %s = %lld", item.mName, item.u.int64Value);
460 "size_t %s = %d", item.mName, item.u.sizeValue);
464 "float %s = %f", item.mName, item.u.floatValue);
468 "double %s = %f", item.mName, item.u.doubleValue);
472 "void *%s = %p", item.mName, item.u.ptrValue);
477 item.mName,
478 item.u.stringValue->c_str());
482 "RefBase *%s = %p", item.mName, item.u.refValue);
486 sp<ABuffer> buffer = static_cast<ABuffer *>(item.u.refValue);
489 tmp = StringPrintf("Buffer %s = {\n", item.mName);
495 "Buffer *%s = %p", item.mName, buffer.get());
502 item.mName,
504 item.u.refValue)->debugString(
505 indent + strlen(item.mName) + 14).c_str());
510 item.mName,
511 item.u.rectValue.mLeft,
512 item.u.rectValue.mTop,
513 item.u.rectValue.mRight,
514 item.u.rectValue.mBottom);
539 Item *item = &msg->mItems[i];
542 item->setName(name, strlen(name));
543 item->mType = static_cast<Type>(parcel.readInt32());
545 switch (item->mType) {
548 item->u.int32Value = parcel.readInt32();
554 item->u.int64Value = parcel.readInt64();
560 item->u.sizeValue = static_cast<size_t>(parcel.readInt32());
566 item->u.floatValue = parcel.readFloat();
572 item->u.doubleValue = parcel.readDouble();
578 item->u.stringValue = new AString(parcel.readCString());
587 item->u.refValue = subMsg.get();
607 const Item &item = mItems[i];
609 parcel->writeCString(item.mName);
610 parcel->writeInt32(static_cast<int32_t>(item.mType));
612 switch (item.mType) {
615 parcel->writeInt32(item.u.int32Value);
621 parcel->writeInt64(item.u.int64Value);
627 parcel->writeInt32(static_cast<int32_t>(item.u.sizeValue));
633 parcel->writeFloat(item.u.floatValue);
639 parcel->writeDouble(item.u.doubleValue);
645 parcel->writeCString(item.u.stringValue->c_str());
651 static_cast<AMessage *>(item.u.refValue)->writeToParcel(parcel);