model: Another major change: switching to NDN.cxx API for ndn::Name
NDN.cxx code is almost exactly the same, with minor NS-3 specific customizations
Refs #1011 (http://redmine.named-data.net/issues/1011)
diff --git a/model/wire/ndnsim/wire-ndnsim.cc b/model/wire/ndnsim/wire-ndnsim.cc
index 7d383a4..8b4d81d 100644
--- a/model/wire/ndnsim/wire-ndnsim.cc
+++ b/model/wire/ndnsim/wire-ndnsim.cc
@@ -26,12 +26,12 @@
i.WriteU16 (static_cast<uint16_t> (SerializedSizeName (name)-2));
- for (std::list<std::string>::const_iterator item = name.begin ();
+ for (Name::const_iterator item = name.begin ();
item != name.end ();
item++)
{
i.WriteU16 (static_cast<uint16_t> (item->size ()));
- i.Write (reinterpret_cast<const uint8_t*> (item->c_str ()), item->size ());
+ i.Write (reinterpret_cast<const uint8_t*> (item->buf ()), item->size ());
}
return i.GetDistanceFrom (start);
@@ -42,7 +42,7 @@
{
size_t nameSerializedSize = 2;
- for (std::list<std::string>::const_iterator i = name.begin ();
+ for (Name::const_iterator i = name.begin ();
i != name.end ();
i++)
{
@@ -67,7 +67,7 @@
uint8_t tmp[length];
i.Read (tmp, length);
- name->Add (std::string (reinterpret_cast<const char*> (tmp), length));
+ name->append (std::string (reinterpret_cast<const char*> (tmp), length));
}
return name;