test for name and ccnx-wrapper
diff --git a/src/ccnx-name.cpp b/src/ccnx-name.cpp
index ce5f270..748410f 100644
--- a/src/ccnx-name.cpp
+++ b/src/ccnx-name.cpp
@@ -37,8 +37,15 @@
{
stringstream ss(name);
string compStr;
+ bool first = true;
while(getline(ss, compStr, '/'))
{
+ // discard the first empty comp before the first '/'
+ if (first)
+ {
+ first = false;
+ continue;
+ }
Bytes comp(compStr.begin(), compStr.end());
m_comps.push_back(comp);
}
@@ -74,13 +81,13 @@
return *this;
}
bool
-Name::operator==(const string &str)
+Name::operator==(const string &str) const
{
return this->toString() == str;
}
bool
-Name::operator!=(const string &str)
+Name::operator!=(const string &str) const
{
return !(*this == str);
}