Abstracting testbed prepended name components
Change-Id: Ieb3b3971fb09e31ddb15d85b5907ee7be41ef6ae
diff --git a/src/torrent-file.cpp b/src/torrent-file.cpp
index e5ef53e..544f9ce 100644
--- a/src/torrent-file.cpp
+++ b/src/torrent-file.cpp
@@ -252,7 +252,8 @@
Name directoryPathName(directoryPath);
fs::recursive_directory_iterator directoryPtr(fs::system_complete(directoryPath).string());
- Name commonPrefix("/ndn/multicast/NTORRENT" +
+ std::string prefix = std::string(SharedConstants::commonPrefix) + "/NTORRENT";
+ Name commonPrefix(prefix +
directoryPathName.getSubName(directoryPathName.size() - 1).toUri());
Name torrentName(commonPrefix.toUri() + "/torrent-file");
@@ -265,7 +266,7 @@
}
size_t manifestFileCounter = 0u;
for (const auto& fileName : fileNames) {
- Name manifestPrefix("/ndn/multicast/NTORRENT" +
+ Name manifestPrefix(prefix +
directoryPathName.getSubName(directoryPathName.size() - 1).toUri());
std::pair<std::vector<FileManifest>, std::vector<Data>> currentManifestPair =
FileManifest::generate(fileName,