Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] API change announcement

As part of the patch attached to https://bugs.eclipse.org/bugs/show_bug.cgi?id=255952 I'm going to make a backward compatible API change by adding two public methods to org.eclipse.cdt.utils.PathUtil:

    /**
     * Checks whether path1 is a prefix of path2. To be a prefix, path1's segments
     * must appear in path1 in the same order, and their device ids must match.
     * <p>
     * An empty path is a prefix of all paths with the same device; a root path is a prefix of
     * all absolute paths with the same device.
     * </p>
     * @return <code>true</code> if path1 is a prefix of path2, and <code>false</code> otherwise
     *
     * Similar to IPath.isPrefixOf(IPath anotherPath), but takes case sensitivity of the file system
     * into account.
     * @since 5.1
     */
    public static boolean isPrefix(IPath path1, IPath path2);

    /**
     * Returns the number of segments which match in path1 and path2
     * (device ids are ignored), comparing in increasing segment number order.
     *
     * @return the number of matching segments

     * Similar to IPath.matchingFirstSegments(IPath anotherPath), but takes case sensitivity
     * of the file system into account.
     * @since 5.1
     */
    public static int matchingFirstSegments(IPath path1, IPath path2);

-sergey


Back to the top