data: Small API to update SignatureValue directly, without replacing the whole Signature (both Info and Value block)
Change-Id: I3e7f6a5005d9034aeaef836b9097ecd0e987540d
diff --git a/include/ndn-cpp/data.hpp b/include/ndn-cpp/data.hpp
index 8f97c87..52b3c89 100644
--- a/include/ndn-cpp/data.hpp
+++ b/include/ndn-cpp/data.hpp
@@ -121,11 +121,13 @@
/**
* @brief Set the signature to a copy of the given signature.
* @param signature The signature object which is cloned.
- * @return This Data so that you can chain calls to update values.
*/
- inline Data&
+ inline void
setSignature(const Signature& signature);
+ inline void
+ setSignatureValue(const Block &value);
+
private:
/**
* @brief Clear the wire encoding.
@@ -252,15 +254,21 @@
return signature_;
}
-inline Data&
+inline void
Data::setSignature(const Signature& signature)
{
onChanged();
signature_ = signature;
-
- return *this;
}
+inline void
+Data::setSignatureValue(const Block &value)
+{
+ onChanged();
+ signature_.setValue(value);
+}
+
+
inline void
Data::onChanged()
{
@@ -269,7 +277,7 @@
// !!!Note!!! Signature is not invalidated and it is responsibility of
// the application to do proper re-signing if necessary
- wire_ = Block();
+ wire_.reset();
}
std::ostream&