Feature #3449
closedName class API extension
0%
Description
There are several valuable methods in Name class that are not currently available:
isPrefixOfcompare(int, int, Name, int, int)getSubNamegetSuccessor
For documentation and reference implementation refer to ndn-cxx.
Updated by Jeff Burke almost 10 years ago
Agree they're useful. Just let us know priority of this, and for what libraries first.
Updated by Alex Afanasyev almost 10 years ago
I would use them in Python and Java
Updated by Anonymous almost 10 years ago
- Due date set to 02/29/2016
- Assignee set to Anonymous
getSubName already exists, no?
https://github.com/named-data/PyNDN2/blob/0ead93269386aef5c49db8a2214fa61e5d85430f/python/pyndn/name.py#L366
Updated by Anonymous almost 10 years ago
- Status changed from New to In Progress
Hi Alex. The ndn-cxx doc for compare(int, int, Name, int, int) says "This is equivalent to this->getSubName(pos1, count1).compare(other.getSubName(pos2, count2))". But getSubName treats a negative position as indexing back from the end of the name. However, compare does not do this.
In jNDN, etc. I will go ahead and support negative indexes in compare. Does that sound right? Should I submit an ndn-cxx issue either to fix the doc for compare, or to support negative positions?
Updated by Alex Afanasyev almost 10 years ago
I don't have much opinion. The idea for compare was to have an optimized version to compare parts of the names. Implementing negative indices can help simplifying code (good), but will have a minor performance hit (could be ok).
Updated by Anonymous almost 10 years ago
Then I'll support negative indexes. An application could easily compare the last two components of one name with the last two of another.
Updated by Anonymous over 9 years ago
- Status changed from In Progress to Closed
Added isPrefixOf, getSuccessor and compare(int, int, Name, int, int) to NDN-CPP, PyNDN, NDN-JS and jNDN. Merged to the master branch.