"Small" reorganization and cleaning
diff --git a/ccnx/ccnx-common.h b/ccnx/ccnx-common.h
index 41d7814..985965c 100644
--- a/ccnx/ccnx-common.h
+++ b/ccnx/ccnx-common.h
@@ -86,6 +86,16 @@
return BytesPtr ();
}
+template<class Msg>
+inline BytesPtr
+serializeMsg(const Msg &msg)
+{
+ int size = msg->ByteSize ();
+ BytesPtr bytes (new Bytes (size));
+ msg->SerializeToArray (head(*bytes), size);
+ return bytes;
+}
+
// --- Bytes operations end ---
// Exceptions
diff --git a/ccnx/ccnx-name.cpp b/ccnx/ccnx-name.cpp
index 4573ed1..848019a 100644
--- a/ccnx/ccnx-name.cpp
+++ b/ccnx/ccnx-name.cpp
@@ -1,3 +1,24 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
#include "ccnx-name.h"
#include <boost/lexical_cast.hpp>
#include <ctype.h>
diff --git a/ccnx/ccnx-name.h b/ccnx/ccnx-name.h
index a07f854..92c3054 100644
--- a/ccnx/ccnx-name.h
+++ b/ccnx/ccnx-name.h
@@ -105,6 +105,9 @@
Name &
operator ()(const T &comp) { return appendComp (comp); }
+ Name &
+ operator ()(const void *buf, size_t size) { return appendComp (buf, size); }
+
int
size() const {return m_comps.size();}