本文整理汇总了C++中Parcel::readDouble方法的典型用法代码示例。如果您正苦于以下问题:C++ Parcel::readDouble方法的具体用法?C++ Parcel::readDouble怎么用?C++ Parcel::readDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parcel
的用法示例。
在下文中一共展示了Parcel::readDouble方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: android_os_Parcel_readDouble
static jdouble android_os_Parcel_readDouble(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
return parcel->readDouble();
}
return 0;
}
示例2: readFromParcel
int32_t MediaAnalyticsItem::readFromParcel(const Parcel& data) {
// into 'this' object
// .. we make a copy of the string to put away.
mKey = data.readCString();
mSessionID = data.readInt64();
mFinalized = data.readInt32();
mTimestamp = data.readInt64();
int count = data.readInt32();
for (int i = 0; i < count ; i++) {
MediaAnalyticsItem::Attr attr = data.readCString();
int32_t ztype = data.readInt32();
switch (ztype) {
case MediaAnalyticsItem::kTypeInt32:
setInt32(attr, data.readInt32());
break;
case MediaAnalyticsItem::kTypeInt64:
setInt64(attr, data.readInt64());
break;
case MediaAnalyticsItem::kTypeDouble:
setDouble(attr, data.readDouble());
break;
case MediaAnalyticsItem::kTypeCString:
setCString(attr, data.readCString());
break;
case MediaAnalyticsItem::kTypeRate:
{
int64_t count = data.readInt64();
int64_t duration = data.readInt64();
setRate(attr, count, duration);
}
break;
default:
ALOGE("reading bad item type: %d, idx %d",
ztype, i);
return -1;
}
}
return 0;
}