name assignment fix and use NDN-name like format /a/b/c
Change-Id: I4c1b81d01fa3e3fa549bc87e5135bab0abdd9864
diff --git a/src/name-assignments/assignment-hash.cpp b/src/name-assignments/assignment-hash.cpp
index 22b6e69..4849324 100644
--- a/src/name-assignments/assignment-hash.cpp
+++ b/src/name-assignments/assignment-hash.cpp
@@ -21,8 +21,11 @@
AssignmentHash::getFunction(const std::string &factoryParam) {
std::list<std::string> paramList;
size_t index = 0, startIndex = 0;
- while ((index = factoryParam.find(":", startIndex)) != factoryParam.npos) {
- paramList.push_back(factoryParam.substr(startIndex, index));
+ while ((index = factoryParam.find("/", startIndex)) != std::string::npos) {
+ auto component = factoryParam.substr(startIndex, index - startIndex);
+ if (!component.empty()) {
+ paramList.push_back(component);
+ }
startIndex = index + 1;
}
if (startIndex != factoryParam.size()) {