コード例 #1
0
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;
}
コード例 #2
0
void VFSNode::getParentPath(VString& parentPath) const {
    int lengthWithoutTrailingSeparator;
    int lastSeparatorIndex = _lastNonTrailingIndexOfPathSeparator(mPath, lengthWithoutTrailingSeparator);
    parentPath.copyFromBuffer(mPath.chars(), 0, lastSeparatorIndex);
    return;
}