Some changes, including extension on Ccnx::Name
diff --git a/include/ccnx-name.h b/include/ccnx-name.h
index 7c5447b..8966e50 100644
--- a/include/ccnx-name.h
+++ b/include/ccnx-name.h
@@ -1,3 +1,24 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012-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>
+ */
+
#ifndef CCNX_NAME_H
#define CCNX_NAME_H
#include <boost/shared_ptr.hpp>
@@ -22,6 +43,14 @@
getBuf() { return m_buf; }
static CcnxCharbufPtr Null;
+ const unsigned char *
+ buf () const
+ { return m_buf->buf; }
+
+ size_t
+ length () const
+ { return m_buf->length; }
+
protected:
ccn_charbuf *m_buf;
};
@@ -38,11 +67,14 @@
Name(const vector<Bytes> &comps);
Name(const Name &other);
Name(const unsigned char *data, const ccn_indexbuf *comps);
+ Name (const unsigned char *buf, const size_t length);
virtual ~Name() {}
CcnxCharbufPtr
toCcnxCharbuf() const;
+ operator CcnxCharbufPtr () const { return toCcnxCharbuf (); }
+
Name &
appendComp(const Bytes &comp);