Major update to rename ContentObject to Data everywhere.
diff --git a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
index e0b2b1c..1c6b7b1 100644
--- a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
+++ b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
@@ -5,9 +5,9 @@
#include <stdexcept>
#include "../c/encoding/BinaryXMLInterest.h"
-#include "../c/encoding/BinaryXMLContentObject.h"
+#include "../c/encoding/binary-xml-data.h"
#include "../Interest.hpp"
-#include "../ContentObject.hpp"
+#include "../data.hpp"
#include "BinaryXMLEncoder.hpp"
#include "BinaryXMLDecoder.hpp"
#include "BinaryXMLWireFormat.hpp"
@@ -51,33 +51,33 @@
interest.set(interestStruct);
}
-ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeContentObject(const ContentObject &contentObject)
+ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeData(const Data &data)
{
struct ndn_NameComponent nameComponents[100];
- struct ndn_ContentObject contentObjectStruct;
- ndn_ContentObject_init
- (&contentObjectStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]));
- contentObject.get(contentObjectStruct);
+ struct ndn_Data dataStruct;
+ ndn_Data_init
+ (&dataStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]));
+ data.get(dataStruct);
BinaryXmlEncoder encoder;
- ndn_encodeBinaryXmlContentObject(&contentObjectStruct, &encoder);
+ ndn_encodeBinaryXmlData(&dataStruct, &encoder);
return encoder.getOutput();
}
-void BinaryXmlWireFormat::decodeContentObject(ContentObject &contentObject, const unsigned char *input, unsigned int inputLength)
+void BinaryXmlWireFormat::decodeData(Data &data, const unsigned char *input, unsigned int inputLength)
{
struct ndn_NameComponent nameComponents[100];
- struct ndn_ContentObject contentObjectStruct;
- ndn_ContentObject_init
- (&contentObjectStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]));
+ struct ndn_Data dataStruct;
+ ndn_Data_init
+ (&dataStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]));
BinaryXmlDecoder decoder(input, inputLength);
ndn_Error error;
- if (error = ndn_decodeBinaryXmlContentObject(&contentObjectStruct, &decoder))
+ if (error = ndn_decodeBinaryXmlData(&dataStruct, &decoder))
throw std::runtime_error(ndn_getErrorString(error));
- contentObject.set(contentObjectStruct);
+ data.set(dataStruct);
}
}
diff --git a/ndn-cpp/encoding/BinaryXMLWireFormat.hpp b/ndn-cpp/encoding/BinaryXMLWireFormat.hpp
index ff73218..ffc19b0 100644
--- a/ndn-cpp/encoding/BinaryXMLWireFormat.hpp
+++ b/ndn-cpp/encoding/BinaryXMLWireFormat.hpp
@@ -15,8 +15,8 @@
virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeInterest(const Interest &interest);
virtual void decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength);
- virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeContentObject(const ContentObject &contentObject);
- virtual void decodeContentObject(ContentObject &contentObject, const unsigned char *input, unsigned int inputLength);
+ virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData(const Data &data);
+ virtual void decodeData(Data &data, const unsigned char *input, unsigned int inputLength);
static BinaryXmlWireFormat &getInstance() { return instance_; }
diff --git a/ndn-cpp/encoding/WireFormat.cpp b/ndn-cpp/encoding/WireFormat.cpp
index 238ce9c..39d2e11 100644
--- a/ndn-cpp/encoding/WireFormat.cpp
+++ b/ndn-cpp/encoding/WireFormat.cpp
@@ -18,11 +18,11 @@
throw logic_error("unimplemented");
}
-ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeContentObject(const ContentObject &contentObject)
+ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeData(const Data &data)
{
throw logic_error("unimplemented");
}
-void WireFormat::decodeContentObject(ContentObject &contentObject, const unsigned char *input, unsigned int inputLength)
+void WireFormat::decodeData(Data &data, const unsigned char *input, unsigned int inputLength)
{
throw logic_error("unimplemented");
}
diff --git a/ndn-cpp/encoding/WireFormat.hpp b/ndn-cpp/encoding/WireFormat.hpp
index 1afe25f..a7d62bc 100644
--- a/ndn-cpp/encoding/WireFormat.hpp
+++ b/ndn-cpp/encoding/WireFormat.hpp
@@ -12,15 +12,15 @@
namespace ndn {
class Interest;
-class ContentObject;
+class Data;
class WireFormat {
public:
virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeInterest(const Interest &interest);
virtual void decodeInterest(Interest &interest, const unsigned char *input, unsigned int inputLength);
- virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeContentObject(const ContentObject &contentObject);
- virtual void decodeContentObject(ContentObject &contentObject, const unsigned char *input, unsigned int inputLength);
+ virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData(const Data &data);
+ virtual void decodeData(Data &data, const unsigned char *input, unsigned int inputLength);
};
}