Change type of ndn_MetaInfo.finalBlockID to struct ndn_NameComponent.
diff --git a/ndn-cpp/data.cpp b/ndn-cpp/data.cpp
index 0c5e7f3..387d291 100644
--- a/ndn-cpp/data.cpp
+++ b/ndn-cpp/data.cpp
@@ -48,12 +48,7 @@
metaInfoStruct.timestampMilliseconds = timestampMilliseconds_;
metaInfoStruct.type = type_;
metaInfoStruct.freshnessSeconds = freshnessSeconds_;
-
- metaInfoStruct.finalBlockIDLength = finalBlockID_.getValue().size();
- if (metaInfoStruct.finalBlockIDLength > 0)
- metaInfoStruct.finalBlockID = (unsigned char *)finalBlockID_.getValue().buf();
- else
- metaInfoStruct.finalBlockID = 0;
+ finalBlockID_.get(metaInfoStruct.finalBlockID);
}
void MetaInfo::set(const struct ndn_MetaInfo& metaInfoStruct)
@@ -61,7 +56,7 @@
timestampMilliseconds_ = metaInfoStruct.timestampMilliseconds;
type_ = metaInfoStruct.type;
freshnessSeconds_ = metaInfoStruct.freshnessSeconds;
- finalBlockID_.setValue(Blob(metaInfoStruct.finalBlockID, metaInfoStruct.finalBlockIDLength));
+ finalBlockID_.setValue(Blob(metaInfoStruct.finalBlockID.value, metaInfoStruct.finalBlockID.valueLength));
}
void Data::get(struct ndn_Data& dataStruct) const