Added set(struct ndn_Name &)
diff --git a/ndn-cpp/Name.cpp b/ndn-cpp/Name.cpp
index 995746c..5a62801 100644
--- a/ndn-cpp/Name.cpp
+++ b/ndn-cpp/Name.cpp
@@ -5,6 +5,7 @@
*/
#include <sstream>
+#include "c/Name.h"
#include "Name.hpp"
using namespace std;
@@ -15,6 +16,13 @@
{
}
+void Name::set(struct ndn_Name &nameStruct)
+{
+ clear();
+ for (int i = 0; i < nameStruct.nComponents; ++i)
+ addComponent(nameStruct.components[i].value, nameStruct.components[i].valueLength);
+}
+
std::string Name::to_uri()
{
// TODO: implement fully.