build: Finalizing build system conversion
Change-Id: I9ee2e9582ebf7b47054681b26c9ef166d96e0b6b
diff --git a/include/ndn-cpp-dev/encoding/binary-xml-wire-format.hpp b/include/ndn-cpp-dev/encoding/binary-xml-wire-format.hpp
deleted file mode 100644
index cb4f0aa..0000000
--- a/include/ndn-cpp-dev/encoding/binary-xml-wire-format.hpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_BINARYXMLWIREFORMAT_HPP
-#define NDN_BINARYXMLWIREFORMAT_HPP
-
-#include "wire-format.hpp"
-
-namespace ndn {
-
-/**
- * A BinaryXmlWireFormat extends WireFormat to override its virtual methods to implement encoding and decoding
- * using binary XML.
- */
-class BinaryXmlWireFormat : public WireFormat {
-public:
- /**
- * Encode interest in binary XML and return the encoding.
- * @param interest The Interest object to encode.
- * @return A Blob containing the encoding.
- */
- virtual Blob
- encodeInterest(const Interest& interest);
-
- /**
- * Decode input as an interest in binary XML and set the fields of the interest object.
- * @param interest The Interest object whose fields are updated.
- * @param input A pointer to the input buffer to decode.
- * @param inputLength The number of bytes in input.
- */
- virtual void
- decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength);
-
- /**
- * Encode data with binary XML and return the encoding.
- * @param data The Data object to encode.
- * @param signedPortionBeginOffset Return the offset in the encoding of the beginning of the signed portion.
- * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
- * @param signedPortionEndOffset Return the offset in the encoding of the end of the signed portion.
- * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
- * @return A Blob containing the encoding.
- */
- virtual Blob
- encodeData
- (const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
-
- /**
- * Decode input as a data packet in binary XML and set the fields in the data object.
- * @param data The Data object whose fields are updated.
- * @param input A pointer to the input buffer to decode.
- * @param inputLength The number of bytes in input.
- * @param signedPortionBeginOffset Return the offset in the input buffer of the beginning of the signed portion.
- * If you are not decoding in order to verify, you can call
- * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
- * @param signedPortionEndOffset Return the offset in the input buffer of the end of the signed portion.
- * If you are not decoding in order to verify, you can call
- * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
- */
- virtual void
- decodeData
- (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
-
- /**
- * Encode forwardingEntry in binary XML and return the encoding.
- * @param forwardingEntry The ForwardingEntry object to encode.
- * @return A Blob containing the encoding.
- */
- virtual Blob
- encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
-
- /**
- * Decode input as a forwarding entry in binary XML and set the fields of the forwardingEntry object.
- * @param forwardingEntry The ForwardingEntry object whose fields are updated.
- * @param input A pointer to the input buffer to decode.
- * @param inputLength The number of bytes in input.
- */
- virtual void
- decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, size_t inputLength);
-};
-
-}
-
-#endif
-
diff --git a/include/ndn-cpp-dev/encoding/element-listener.hpp b/include/ndn-cpp-dev/encoding/element-listener.hpp
deleted file mode 100644
index 7d13312..0000000
--- a/include/ndn-cpp-dev/encoding/element-listener.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_ELEMENT_LISTENER_HPP
-#define NDN_ELEMENT_LISTENER_HPP
-
-#include "../c/encoding/element-listener.h"
-
-namespace ndn {
-
-/**
- * An ElementListener extends an ndn_ElementListener struct to proved an abstract virtual onReceivedElement function which wraps
- * the onReceivedElement used by the ndn_ElementListener struct. You must extend this class to override onReceivedElement.
- */
-class ElementListener : public ndn_ElementListener {
-public:
- ElementListener()
- {
- ndn_ElementListener_initialize(this, staticOnReceivedElement);
- }
-
- /**
- * This is called when an entire binary XML element is received. You must extend this class to override this method.
- * @param element pointer to the binary XML element. This buffer is only valid during this call. If you need the data
- * later, you must copy.
- * @param elementLength length of element
- */
- virtual void
- onReceivedElement(const uint8_t *element, size_t elementLength) = 0;
-
-private:
- /**
- * Call the virtual method onReceivedElement. This is used to initialize the base ndn_ElementListener struct.
- * @param self
- * @param element
- * @param elementLength
- */
- static void
- staticOnReceivedElement(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength);
-};
-
-}
-
-#endif
diff --git a/include/ndn-cpp-dev/encoding/endian.h b/include/ndn-cpp-dev/encoding/endian.hpp
similarity index 100%
rename from include/ndn-cpp-dev/encoding/endian.h
rename to include/ndn-cpp-dev/encoding/endian.hpp
diff --git a/include/ndn-cpp-dev/encoding/tlv.hpp b/include/ndn-cpp-dev/encoding/tlv.hpp
index 3d42402..511d0f6 100644
--- a/include/ndn-cpp-dev/encoding/tlv.hpp
+++ b/include/ndn-cpp-dev/encoding/tlv.hpp
@@ -13,7 +13,7 @@
#include <stdexcept>
#include <iterator>
#include "buffer.hpp"
-#include "endian.h"
+#include "endian.hpp"
namespace ndn {
diff --git a/include/ndn-cpp-dev/encoding/wire-format.hpp b/include/ndn-cpp-dev/encoding/wire-format.hpp
deleted file mode 100644
index 1a40cd1..0000000
--- a/include/ndn-cpp-dev/encoding/wire-format.hpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_WIREFORMAT_HPP
-#define NDN_WIREFORMAT_HPP
-
-#include "../common.hpp"
-#include "../util/blob.hpp"
-
-namespace ndn {
-
-class Interest;
-class Data;
-class ForwardingEntry;
-
-class WireFormat {
-public:
- /**
- * Encode interest and return the encoding. Your derived class should override.
- * @param interest The Interest object to encode.
- * @return A Blob containing the encoding.
- * @throw logic_error for unimplemented if the derived class does not override.
- */
- virtual Blob
- encodeInterest(const Interest& interest);
-
- /**
- * Decode input as an interest and set the fields of the interest object. Your derived class should override.
- * @param interest The Interest object whose fields are updated.
- * @param input A pointer to the input buffer to decode.
- * @param inputLength The number of bytes in input.
- * @throw logic_error for unimplemented if the derived class does not override.
- */
- virtual void
- decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength);
-
- /**
- * Encode data and return the encoding. Your derived class should override.
- * @param data The Data object to encode.
- * @param signedPortionBeginOffset Return the offset in the encoding of the beginning of the signed portion.
- * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
- * @param signedPortionEndOffset Return the offset in the encoding of the end of the signed portion.
- * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
- * @return A Blob containing the encoding.
- * @throw logic_error for unimplemented if the derived class does not override.
- */
- virtual Blob
- encodeData
- (const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
-
- /**
- * Encode data and return the encoding.
- * @param data The Data object to encode.
- * @return A Blob containing the encoding.
- * @throw logic_error for unimplemented if the derived class does not override.
- */
- Blob
- encodeData(const Data& data)
- {
- size_t dummyBeginOffset, dummyEndOffset;
- return encodeData(data, &dummyBeginOffset, &dummyEndOffset);
- }
-
- /**
- * Decode input as a data packet and set the fields in the data object. Your derived class should override.
- * @param data The Data object whose fields are updated.
- * @param input A pointer to the input buffer to decode.
- * @param inputLength The number of bytes in input.
- * @param signedPortionBeginOffset Return the offset in the input buffer of the beginning of the signed portion.
- * If you are not decoding in order to verify, you can call
- * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
- * @param signedPortionEndOffset Return the offset in the input buffer of the end of the signed portion.
- * If you are not decoding in order to verify, you can call
- * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
- * @throw logic_error for unimplemented if the derived class does not override.
- */
- virtual void
- decodeData
- (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
-
- void
- decodeData(Data& data, const uint8_t *input, size_t inputLength)
- {
- size_t dummyBeginOffset, dummyEndOffset;
- decodeData(data, input, inputLength, &dummyBeginOffset, &dummyEndOffset);
- }
-
- /**
- * Encode forwardingEntry and return the encoding. Your derived class should override.
- * @param forwardingEntry The ForwardingEntry object to encode.
- * @return A Blob containing the encoding.
- * @throw logic_error for unimplemented if the derived class does not override.
- */
- virtual Blob
- encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
-
- /**
- * Decode input as a forwarding entry and set the fields of the forwardingEntry object. Your derived class should override.
- * @param forwardingEntry The ForwardingEntry object whose fields are updated.
- * @param input A pointer to the input buffer to decode.
- * @param inputLength The number of bytes in input.
- * @throw logic_error for unimplemented if the derived class does not override.
- */
- virtual void
- decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, size_t inputLength);
-
- /**
- * Set the static default WireFormat used by default encoding and decoding methods.
- * @param wireFormat A Pointer to an object of a subclass of WireFormat. This does not make a copy and
- * the caller must ensure that the object remains allocated.
- */
- static void
- setDefaultWireFormat(WireFormat *wireFormat)
- {
- defaultWireFormat_ = wireFormat;
- }
-
- /**
- * Return the default WireFormat used by default encoding and decoding methods which was set with
- * setDefaultWireFormat.
- * @return A pointer to the WireFormat object.
- */
- static WireFormat*
- getDefaultWireFormat();
-
-private:
- /**
- * This is implemented by only one of the subclasses of WireFormat to return a new object used
- * as the initial value for the default WireFormat. If the application doesn't include that class, then the application
- * needs to include another subclass which defines WireFormat::newInitialDefaultWireFormat.
- * @return a new object, which is held by a shared_ptr and freed when the application exits.
- */
- static WireFormat*
- newInitialDefaultWireFormat();
-
- static WireFormat *defaultWireFormat_;
-};
-
-}
-
-#endif
-
diff --git a/include/ndn-cpp-dev/security/security-exception.hpp b/include/ndn-cpp-dev/security/security-exception.hpp
deleted file mode 100644
index daf1d61..0000000
--- a/include/ndn-cpp-dev/security/security-exception.hpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Yingdi Yu <yingdi@cs.ucla.edu>
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_SECURITY_EXCEPTION_HPP
-#define NDN_SECURITY_EXCEPTION_HPP
-
-#include <exception>
-#include <string>
-
-namespace ndn {
-
-class SecurityException : public std::exception {
-public:
- SecurityException(const std::string& errorMessage) throw();
-
- virtual ~SecurityException() throw();
-
- std::string Msg() { return errorMessage_; }
-
- virtual const char* what() const throw() { return errorMessage_.c_str(); }
-
-private:
- const std::string errorMessage_;
-};
-
-class UnrecognizedKeyFormatException : public SecurityException {
-public:
- UnrecognizedKeyFormatException(const std::string& errorMessage)
- : SecurityException(errorMessage)
- {
- }
-};
-
-class UnrecognizedDigestAlgorithmException : public SecurityException {
-public:
- UnrecognizedDigestAlgorithmException(const std::string& errorMessage)
- : SecurityException(errorMessage)
- {
- }
-};
-
-}
-
-#endif
diff --git a/include/ndn-cpp-dev/security/sha256-with-rsa-handler.hpp b/include/ndn-cpp-dev/security/sha256-with-rsa-handler.hpp
deleted file mode 100644
index 6627f02..0000000
--- a/include/ndn-cpp-dev/security/sha256-with-rsa-handler.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Yingdi Yu <yingdi@cs.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_SHA256_RSA_HANDLER_HPP
-#define NDN_SHA256_RSA_HANDLER_HPP
-
-#include "../../data.hpp"
-#include "../certificate/public-key.hpp"
-
-namespace ndn{
-
-class Sha256WithRsaHandler {
-public:
- Sha256WithRsaHandler() {}
-
- virtual
- ~Sha256WithRsaHandler() {}
-
- /**
- * Verify the signature on the data packet using the given public key. If there is no data.getDefaultWireEncoding(),
- * this calls data.wireEncode() to set it.
- * @param data The data packet with the signed portion and the signature to verify. The data packet must have a
- * Sha256WithRsaSignature.
- * @param publicKey The public key used to verify the signature.
- * @return true if the signature verifies, false if not.
- * @throw SecurityException if data does not have a Sha256WithRsaSignature.
- */
- static bool
- verifySignature(const Data& data, const PublicKey& publicKey);
-
-};
-
-}
-#endif
diff --git a/include/ndn-cpp-dev/util/blob.hpp b/include/ndn-cpp-dev/util/blob.hpp
deleted file mode 100644
index 4de7a02..0000000
--- a/include/ndn-cpp-dev/util/blob.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_BLOB_HPP
-#define NDN_BLOB_HPP
-
-#include "../common.hpp"
-
-struct ndn_Blob;
-
-namespace ndn {
-
-/**
- * A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.
- * This is like a JavaScript string which is a pointer to an immutable string.
- * It is OK to pass a pointer to the string because the new owner can't change the bytes
- * of the string. However, like a JavaScript string, it is possible to change the pointer, and so this does allow
- * the copy constructor and assignment to change the pointer. Also remember that the pointer can be null.
- * (Note that we could have made Blob derive directly from vector<uint8_t> and then explicitly use
- * a pointer to it like Blob, but this does not enforce immutability because we can't declare
- * Blob as derived from const vector<uint8_t>.)
- */
-class Blob : public ptr_lib::shared_ptr<const std::vector<uint8_t> > {
-public:
- /**
- * Create a new Blob with a null pointer.
- */
- Blob()
- {
- }
-
- /**
- * Create a new Blob with an immutable copy of the given array.
- * @param value A pointer to the byte array which is copied.
- * @param valueLength The length of value.
- */
- Blob(const uint8_t* value, size_t valueLength)
- : ptr_lib::shared_ptr<const std::vector<uint8_t> >(new std::vector<uint8_t>(value, value + valueLength))
- {
- }
-
- /**
- * Create a new Blob with an immutable copy of the array in the given vector.
- * If you want to transfer the array without copying, the the vector has to start as a
- * ptr_lib::shared_ptr<std::vector<uint8_t> > and you can use the Blob constructor with this type.
- * @param value A reference to a vector which is copied.
- */
- Blob(const std::vector<uint8_t> &value)
- : ptr_lib::shared_ptr<const std::vector<uint8_t> >(new std::vector<uint8_t>(value))
- {
- }
-
- /**
- * Create a new Blob with an immutable copy of the array in the given Blob struct.
- * @param blobStruct The C ndn_Blob struct to receive the pointer.
- */
- Blob(const struct ndn_Blob& blobStruct);
-
- /**
- * Create a new Blob to point to an existing byte array. IMPORTANT: After calling this constructor,
- * if you keep a pointer to the array then you must treat the array as immutable and promise not to change it.
- * @param value A pointer to a vector with the byte array. This takes another reference and does not copy the bytes.
- */
- Blob(const ptr_lib::shared_ptr<std::vector<uint8_t> > &value)
- : ptr_lib::shared_ptr<const std::vector<uint8_t> >((const ptr_lib::shared_ptr<const std::vector<uint8_t> > &)value)
- {
- }
- Blob(const ptr_lib::shared_ptr<const std::vector<uint8_t> > &value)
- : ptr_lib::shared_ptr<const std::vector<uint8_t> >(value)
- {
- }
-
- /**
- * Return the length of the immutable byte array.
- */
- size_t
- size() const
- {
- if (*this)
- return (*this)->size();
- else
- return 0;
- }
-
- /**
- * Return a const pointer to the first byte of the immutable byte array, or 0 if the pointer is null.
- */
- const uint8_t*
- buf() const
- {
- if (*this)
- return &(*this)->front();
- else
- return 0;
- }
-
- /**
- * Set the blobStruct to point to this Blob's byte array, without copying any memory.
- * WARNING: The resulting pointer in blobStruct is invalid after a further use of this object which could reallocate memory.
- * @param blobStruct The C ndn_Blob struct to receive the pointer.
- */
- void
- get(struct ndn_Blob& blobStruct) const;
-};
-
-}
-
-#endif
diff --git a/include/ndn-cpp-dev/util/signed-blob.hpp b/include/ndn-cpp-dev/util/signed-blob.hpp
deleted file mode 100644
index 1ad2d25..0000000
--- a/include/ndn-cpp-dev/util/signed-blob.hpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- * @author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_SIGNED_BLOB_HPP
-#define NDN_SIGNED_BLOB_HPP
-
-#include "blob.hpp"
-
-namespace ndn {
-
-/**
- * A SignedBlob extends Blob to keep the offsets of a signed portion (e.g., the bytes of Data packet).
- */
-class SignedBlob : public Blob {
-public:
- /**
- * Create a new SignedBlob with a null pointer.
- */
- SignedBlob()
- : signedPortionBeginOffset_(0), signedPortionEndOffset_(0)
- {
- }
-
- /**
- * Create a new SignedBlob with an immutable copy of the given array.
- * @param value A pointer to the byte array which is copied.
- * @param valueLength The length of value.
- * @param signedPortionBeginOffset The offset in the encoding of the beginning of the signed portion.
- * @param signedPortionEndOffset The offset in the encoding of the end of the signed portion.
- */
- SignedBlob
- (const uint8_t* value, size_t valueLength, size_t signedPortionBeginOffset, size_t signedPortionEndOffset)
- : Blob(value, valueLength), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
- {
- }
-
- /**
- * Create a new SignedBlob with an immutable copy of the array in the given vector.
- * If you want to transfer the array without copying, the the vector has to start as a
- * ptr_lib::shared_ptr<std::vector<uint8_t> > and you can use the SignedBlob constructor with this type.
- * @param value A reference to a vector which is copied.
- * @param signedPortionBeginOffset The offset in the encoding of the beginning of the signed portion.
- * @param signedPortionEndOffset The offset in the encoding of the end of the signed portion.
- */
- SignedBlob
- (const std::vector<uint8_t> &value, size_t signedPortionBeginOffset, size_t signedPortionEndOffset)
- : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
- {
- }
-
- /**
- * Create a new SignedBlob to point to an existing byte array. IMPORTANT: After calling this constructor,
- * if you keep a pointer to the array then you must treat the array as immutable and promise not to change it.
- * @param value A pointer to a vector with the byte array. This takes another reference and does not copy the bytes.
- * @param signedPortionBeginOffset The offset in the array of the beginning of the signed portion.
- * @param signedPortionEndOffset The offset in the array of the end of the signed portion.
- */
- SignedBlob
- (const ptr_lib::shared_ptr<std::vector<uint8_t> > &value,
- size_t signedPortionBeginOffset, size_t signedPortionEndOffset)
- : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
- {
- }
- SignedBlob
- (const ptr_lib::shared_ptr<const std::vector<uint8_t> > &value,
- size_t signedPortionBeginOffset, size_t signedPortionEndOffset)
- : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
- {
- }
-
- /**
- * Return the length of the signed portion of the immutable byte array, or 0 of the pointer to the array is null.
- */
- size_t
- signedSize() const
- {
- if (*this)
- return signedPortionEndOffset_ - signedPortionBeginOffset_;
- else
- return 0;
- }
-
- /**
- * Return a const pointer to the first byte of the signed portion of the immutable byte array, or 0 if the
- * pointer to the array is null.
- */
- const uint8_t*
- signedBuf() const
- {
- if (*this)
- return &(*this)->front() + signedPortionBeginOffset_;
- else
- return 0;
- }
-
- /**
- * Return the offset in the array of the beginning of the signed portion.
- */
- size_t
- getSignedPortionBeginOffset() const { return signedPortionBeginOffset_; }
-
- /**
- * Return the offset in the array of the end of the signed portion.
- */
- size_t
- getSignedPortionEndOffset() const { return signedPortionEndOffset_; }
-
-private:
- size_t signedPortionBeginOffset_;
- size_t signedPortionEndOffset_;
-};
-
-}
-
-#endif