Make Name::Component.getValue() return Blob& .
diff --git a/ndn-cpp/interest.cpp b/ndn-cpp/interest.cpp
index 39e3358..35ed7ad 100644
--- a/ndn-cpp/interest.cpp
+++ b/ndn-cpp/interest.cpp
@@ -49,7 +49,7 @@
if (entries_[i].getType() == ndn_Exclude_ANY)
result << "*";
else
- Name::toEscapedString(entries_[i].getComponent().getValue(), result);
+ Name::toEscapedString(*entries_[i].getComponent().getValue(), result);
}
return result.str();
diff --git a/ndn-cpp/name.cpp b/ndn-cpp/name.cpp
index dedbfd1..6881d80 100644
--- a/ndn-cpp/name.cpp
+++ b/ndn-cpp/name.cpp
@@ -222,7 +222,7 @@
ostringstream result;
for (unsigned int i = 0; i < components_.size(); ++i) {
result << "/";
- toEscapedString(components_[i].getValue(), result);
+ toEscapedString(*components_[i].getValue(), result);
}
return result.str();
diff --git a/ndn-cpp/name.hpp b/ndn-cpp/name.hpp
index 41811f5..7079233 100644
--- a/ndn-cpp/name.hpp
+++ b/ndn-cpp/name.hpp
@@ -67,7 +67,9 @@
*/
bool setFromEscapedString(const char *first, const char *last);
- const std::vector<unsigned char>& getValue() const { return (*value_); }
+ const Blob& getValue() const { return value_; }
+
+ void setValue(const Blob& value) { value_ = value; }
/**
* Set this component to the encoded segment number.