void VFSNode::getName(VString& name) const { int lengthWithoutTrailingSeparator; int lastSeparatorIndex = _lastNonTrailingIndexOfPathSeparator(mPath, lengthWithoutTrailingSeparator); // The following works even if lastIndexOf returns -1 "not found", // because we add 1 to get the correct startIndex parameter. name.copyFromBuffer(mPath.chars(), lastSeparatorIndex + 1, lengthWithoutTrailingSeparator); return; }
void VFSNode::getParentPath(VString& parentPath) const { int lengthWithoutTrailingSeparator; int lastSeparatorIndex = _lastNonTrailingIndexOfPathSeparator(mPath, lengthWithoutTrailingSeparator); parentPath.copyFromBuffer(mPath.chars(), 0, lastSeparatorIndex); return; }