Avoid deprecated ndn-cxx functions
Change-Id: Ib9220786a724327b89dcc328c8f34a5c8fe1fdd9
diff --git a/src/daemon/rrset-factory.cpp b/src/daemon/rrset-factory.cpp
index cded8e0..eed7ad0 100644
--- a/src/daemon/rrset-factory.cpp
+++ b/src/daemon/rrset-factory.cpp
@@ -60,7 +60,7 @@
RrsetFactory::onlyCheckZone()
{
if (m_checked) {
- return ;
+ return;
}
m_checked = true;
@@ -71,7 +71,6 @@
}
}
-
std::pair<Rrset, Name>
RrsetFactory::generateBaseRrset(const Name& label,
const name::Component& type,
@@ -158,10 +157,9 @@
std::tie(rrset, name) = generateBaseRrset(label, label::TXT_RR_TYPE, version, ttl);
std::vector<Block> rrs;
+ rrs.reserve(strings.size());
for (const auto& item : strings) {
- rrs.push_back(makeBinaryBlock(ndns::tlv::RrData,
- item.c_str(),
- item.size()));
+ rrs.push_back(makeBinaryBlock(ndns::tlv::RrData, item.data(), item.size()));
}
Data data(name);
@@ -274,24 +272,23 @@
}
template<encoding::Tag TAG>
-inline size_t
-RrsetFactory::wireEncode(EncodingImpl<TAG>& block, const std::vector<Block>& rrs) const
+size_t
+RrsetFactory::wireEncode(EncodingImpl<TAG>& encoder, const std::vector<Block>& rrs) const
{
// Content :: = CONTENT-TYPE TLV-LENGTH
// Block*
size_t totalLength = 0;
for (auto iter = rrs.rbegin(); iter != rrs.rend(); ++iter) {
- totalLength += block.prependBlock(*iter);
+ totalLength += prependBlock(encoder, *iter);
}
- totalLength += block.prependVarNumber(totalLength);
- totalLength += block.prependVarNumber(::ndn::tlv::Content);
-
+ totalLength += encoder.prependVarNumber(totalLength);
+ totalLength += encoder.prependVarNumber(ndn::tlv::Content);
return totalLength;
}
-const Block
+Block
RrsetFactory::wireEncode(const std::vector<Block>& rrs) const
{
EncodingEstimator estimator;
@@ -315,6 +312,5 @@
return txts;
}
-
} // namespace ndns
} // namespace ndn