예제 #1
0
        ///////////////////////////////////////////////////////////////////////////////////////////////

        public static bool MatchFileName(
            Interpreter interpreter,
            IScriptLocation location1,
            IScriptLocation location2,
            bool exact
            )
        {
            if ((location1 == null) && (location2 == null))
            {
                return(true);
            }
            else if ((location1 == null) || (location2 == null))
            {
                return(false);
            }
            else if (exact)
            {
                if (PathOps.HasPathWildcard(location1.FileName) ||
                    PathOps.HasPathWildcard(location2.FileName))
                {
                    return(false);
                }
            }

            return(MatchFileName(interpreter, location1.FileName, location2.FileName));
        }
예제 #2
0
        ///////////////////////////////////////////////////////////////////////////////////////////////

        #region Public Static Methods
        public static string NormalizeFileName(
            Interpreter interpreter,
            string fileName
            )
        {
            if (!PathOps.HasPathWildcard(fileName) &&
                PathOps.HasDirectory(fileName))
            {
                return(PathOps.GetUnixPath(PathOps.ResolveFullPath(
                                               interpreter, fileName)));
            }

            return(fileName);
        }
예제 #3
0
        ///////////////////////////////////////////////////////////////////////////////////////////////

        public static bool MatchFileName(
            Interpreter interpreter,
            string path1,
            string path2
            )
        {
            //
            // BUGBUG: This might be too slow?
            //
            if (PathOps.HasPathWildcard(path2))
            {
                return(StringOps.Match(
                           interpreter, StringOps.DefaultMatchMode,
                           path1, path2, PathOps.NoCase));
            }
            else
            {
                return(PathOps.IsSameFile(interpreter, path1, path2));
            }
        }