/////////////////////////////////////////////////////////////////////////////////////////////// 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)); }
/////////////////////////////////////////////////////////////////////////////////////////////// #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); }
/////////////////////////////////////////////////////////////////////////////////////////////// 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)); } }