NameBuilder for more convenient CCNx name construction
diff --git a/model/ndn_namebuilder.cc b/model/ndn_namebuilder.cc
new file mode 100644
index 0000000..6bd8398
--- /dev/null
+++ b/model/ndn_namebuilder.cc
@@ -0,0 +1,34 @@
+//
+// ndn_namebuilder.cpp
+// Abstraction
+//
+// Created by Ilya Moiseenko on 04.08.11.
+// Copyright 2011 UCLA. All rights reserved.
+//
+
+#include "ndn_namebuilder.h"
+
+namespace ns3
+{
+namespace NDNabstraction
+{
+ NameBuilder::NameBuilder()
+ {
+ m_value = ccn_charbuf_create();
+ ccn_name_init(m_value);
+ }
+
+ ccn_charbuf*
+ NameBuilder::GetName()
+ {
+ return m_value;
+ }
+
+ void
+ NameBuilder::AddComponent(string s)
+ {
+
+ ccn_name_append_str(m_value,s.c_str());
+ }
+}
+}
\ No newline at end of file
diff --git a/model/ndn_namebuilder.h b/model/ndn_namebuilder.h
new file mode 100644
index 0000000..b2bf088
--- /dev/null
+++ b/model/ndn_namebuilder.h
@@ -0,0 +1,29 @@
+//
+// ndn_namebuilder.h
+// Abstraction
+//
+// Created by Ilya Moiseenko on 04.08.11.
+// Copyright 2011 UCLA. All rights reserved.
+//
+
+#include "ccn_ccn.h"
+#include <string>
+
+using namespace std;
+
+namespace ns3
+{
+namespace NDNabstraction
+{
+ class NameBuilder
+ {
+ public:
+ NameBuilder();
+ ccn_charbuf* GetName();
+ void AddComponent(string s);
+ //TODO add more overloads
+ private:
+ ccn_charbuf *m_value;
+ };
+}
+}
\ No newline at end of file
diff --git a/wscript b/wscript
index ba36821..cb7cbe1 100644
--- a/wscript
+++ b/wscript
@@ -15,6 +15,9 @@
'model/ndn_face.cc',
'model/ndn_interestpacket.cc',
'model/ndn_contentpacket.cc',
+ 'model/ndn_timeoutheader.cc',
+ 'model/ndn_nonceheader.cc',
+ 'model/ndn_namebuilder.cc',
'helper/ndnabstraction-helper.cc',
]
@@ -36,6 +39,9 @@
'model/ndn_face.h',
'model/ndn_interestpacket.h',
'model/ndn_contentpacket.h',
+ 'model/ndn_timeoutheader.h',
+ 'model/ndn_nonceheader.h',
+ 'model/ndn_namebuilder.h',
'helper/ndnabstraction-helper.h',
]