Change the ExcludeEntry to use a name component directly.
diff --git a/ndn-cpp/interest.hpp b/ndn-cpp/interest.hpp
index ed5835b..5d7169a 100644
--- a/ndn-cpp/interest.hpp
+++ b/ndn-cpp/interest.hpp
@@ -29,7 +29,7 @@
* Create an ExcludeEntry of type ndn_Exclude_COMPONENT
*/
ExcludeEntry(unsigned char *component, unsigned int componentLen)
- : type_(ndn_Exclude_COMPONENT), component_(component, component + componentLen)
+ : type_(ndn_Exclude_COMPONENT), component_(component, componentLen)
{
}
@@ -41,19 +41,17 @@
void get(struct ndn_ExcludeEntry &excludeEntryStruct) const
{
excludeEntryStruct.type = type_;
- if (type_ == ndn_Exclude_COMPONENT) {
- excludeEntryStruct.componentLength = component_.size();
- excludeEntryStruct.component = (unsigned char *)&component_[0];
- }
+ if (type_ == ndn_Exclude_COMPONENT)
+ component_.get(excludeEntryStruct.component);
}
ndn_ExcludeType getType() const { return type_; }
- const std::vector<unsigned char> &getComponent() const { return component_; }
+ const Name::Component &getComponent() const { return component_; }
private:
ndn_ExcludeType type_;
- std::vector<unsigned char> component_; /**< only used if type_ is ndn_Exclude_COMPONENT */
+ Name::Component component_; /**< only used if type_ is ndn_Exclude_COMPONENT */
};
/**