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