Switch from NDNx to CCNx
Change-Id: Icc2e6dd95d9c4e0ba22b7efb9933c1db7194842e
diff --git a/src/object-manager.cc b/src/object-manager.cc
index fc50488..9b87853 100644
--- a/src/object-manager.cc
+++ b/src/object-manager.cc
@@ -20,9 +20,9 @@
*/
#include "object-manager.h"
-#include "ccnx-name.h"
-#include "ccnx-common.h"
-#include "ccnx-pco.h"
+#include "ndnx-name.h"
+#include "ndnx-common.h"
+#include "ndnx-pco.h"
#include "object-db.h"
#include "logging.h"
@@ -35,15 +35,15 @@
INIT_LOGGER ("Object.Manager");
-using namespace Ccnx;
+using namespace Ndnx;
using namespace boost;
using namespace std;
namespace fs = boost::filesystem;
const int MAX_FILE_SEGMENT_SIZE = 1024;
-ObjectManager::ObjectManager (Ccnx::CcnxWrapperPtr ccnx, const fs::path &folder, const std::string &appName)
- : m_ccnx (ccnx)
+ObjectManager::ObjectManager (Ndnx::NdnxWrapperPtr ndnx, const fs::path &folder, const std::string &appName)
+ : m_ndnx (ndnx)
, m_folder (folder / ".chronoshare")
, m_appName (appName)
{
@@ -56,7 +56,7 @@
// /<devicename>/<appname>/file/<hash>/<segment>
boost::tuple<HashPtr /*object-db name*/, size_t /* number of segments*/>
-ObjectManager::localFileToObjects (const fs::path &file, const Ccnx::Name &deviceName)
+ObjectManager::localFileToObjects (const fs::path &file, const Ndnx::Name &deviceName)
{
HashPtr fileHash = Hash::FromFileContent (file);
ObjectDb fileDb (m_folder, lexical_cast<string> (*fileHash));
@@ -79,7 +79,7 @@
// cout << name << endl;
//_LOG_DEBUG ("Read " << iff.gcount () << " from " << file << " for segment " << segment);
- Bytes data = m_ccnx->createContentObject (name, buf, iff.gcount ());
+ Bytes data = m_ndnx->createContentObject (name, buf, iff.gcount ());
fileDb.saveContentObject (deviceName, segment, data);
segment ++;
@@ -87,7 +87,7 @@
if (segment == 0) // handle empty files
{
Name name = Name ("/")(m_appName)("file")(fileHash->GetHash (), fileHash->GetHashBytes ())(deviceName)(0);
- Bytes data = m_ccnx->createContentObject (name, 0, 0);
+ Bytes data = m_ndnx->createContentObject (name, 0, 0);
fileDb.saveContentObject (deviceName, 0, data);
segment ++;
@@ -97,7 +97,7 @@
}
bool
-ObjectManager::objectsToLocalFile (/*in*/const Ccnx::Name &deviceName, /*in*/const Hash &fileHash, /*out*/ const fs::path &file)
+ObjectManager::objectsToLocalFile (/*in*/const Ndnx::Name &deviceName, /*in*/const Hash &fileHash, /*out*/ const fs::path &file)
{
string hashStr = lexical_cast<string> (fileHash);
if (!ObjectDb::DoesExist (m_folder, deviceName, hashStr))