In set methods, make the argument const
diff --git a/ndn-cpp/Interest.cpp b/ndn-cpp/Interest.cpp
index 797fa35..5ddbbab 100644
--- a/ndn-cpp/Interest.cpp
+++ b/ndn-cpp/Interest.cpp
@@ -20,7 +20,7 @@
entries_[i].get(excludeStruct.entries[i]);
}
-void Exclude::set(struct ndn_Exclude &excludeStruct)
+void Exclude::set(const struct ndn_Exclude &excludeStruct)
{
entries_.clear();
for (unsigned int i = 0; i < excludeStruct.nEntries; ++i) {
@@ -35,7 +35,7 @@
}
}
-void Interest::set(struct ndn_Interest &interestStruct)
+void Interest::set(const struct ndn_Interest &interestStruct)
{
name_.set(interestStruct.name);
minSuffixComponents_ = interestStruct.minSuffixComponents;
diff --git a/ndn-cpp/Interest.hpp b/ndn-cpp/Interest.hpp
index 2c6ee3e..36e78ca 100644
--- a/ndn-cpp/Interest.hpp
+++ b/ndn-cpp/Interest.hpp
@@ -85,7 +85,7 @@
* Clear this Exclude, and set the entries by copying from the ndn_Exclude struct.
* @param excludeStruct a C ndn_Exclude struct
*/
- void set(struct ndn_Exclude &excludeStruct);
+ void set(const struct ndn_Exclude &excludeStruct);
/**
* Add a new entry of type ndn_Exclude_ANY
@@ -178,7 +178,7 @@
* Clear this interest, and set the values by copying from the interest struct.
* @param interestStruct a C ndn_Interest struct
*/
- void set(struct ndn_Interest &interestStruct);
+ void set(const struct ndn_Interest &interestStruct);
void setMinSuffixComponents(int value) { minSuffixComponents_ = value; }
diff --git a/ndn-cpp/Name.cpp b/ndn-cpp/Name.cpp
index f80d1a7..63a0c4f 100644
--- a/ndn-cpp/Name.cpp
+++ b/ndn-cpp/Name.cpp
@@ -236,7 +236,7 @@
components_[i].get(nameStruct.components[i]);
}
-void Name::set(struct ndn_Name &nameStruct)
+void Name::set(const struct ndn_Name &nameStruct)
{
clear();
for (unsigned int i = 0; i < nameStruct.nComponents; ++i)
diff --git a/ndn-cpp/Name.hpp b/ndn-cpp/Name.hpp
index 0d43e93..3859014 100644
--- a/ndn-cpp/Name.hpp
+++ b/ndn-cpp/Name.hpp
@@ -101,7 +101,7 @@
* Clear this name, and set the components by copying from the name struct.
* @param nameStruct a C ndn_Name struct
*/
- void set(struct ndn_Name &nameStruct);
+ void set(const struct ndn_Name &nameStruct);
/**
* Add a new component, copying from value of length valueLength.
diff --git a/ndn-cpp/PublisherPublicKeyDigest.hpp b/ndn-cpp/PublisherPublicKeyDigest.hpp
index 5ce4124..95ca25d 100644
--- a/ndn-cpp/PublisherPublicKeyDigest.hpp
+++ b/ndn-cpp/PublisherPublicKeyDigest.hpp
@@ -38,7 +38,7 @@
* Clear this PublisherPublicKeyDigest, and copy from the ndn_PublisherPublicKeyDigest struct.
* @param excludeStruct a C ndn_Exclude struct
*/
- void set(struct ndn_PublisherPublicKeyDigest &publisherPublicKeyDigestStruct)
+ void set(const struct ndn_PublisherPublicKeyDigest &publisherPublicKeyDigestStruct)
{
publisherPublicKeyDigest_.clear();
if (publisherPublicKeyDigestStruct.publisherPublicKeyDigest)