internal FilePatch(OMODCompressedFile from, string to, bool create, bool plugin) { From = from; To = to.MakePath(); Create = create; IsPlugin = plugin; }
private static bool IsMatchingFile(OMODCompressedFile compressedFile, string path, string pattern, bool recursive) { var name = compressedFile.Name; //check if the path is in the current name aka checking if the current file is in the provided folder if (!name.StartsWith(path, StringComparison.OrdinalIgnoreCase)) { return(false); } var dirName = Path.GetDirectoryName(name); if (dirName == null) { return(false); } /* * If we are not searching recursively, we can filter out the files where the directory is not what we * search for. */ if (!recursive && !dirName.Equals(path, StringComparison.OrdinalIgnoreCase)) { return(false); } /* * Pattern is empty or '*' and we are looking recursively means we can return true for all since we * already guarantee that the current file is somewhere in the provided path. */ if (string.IsNullOrWhiteSpace(pattern) || pattern == "*") { return(true); } return(name.Contains(pattern)); }
internal ScriptReturnFile(OMODCompressedFile compressedFile, string output) { Input = compressedFile; Output = output.MakePath(); }
internal ScriptReturnFile(OMODCompressedFile compressedFile) { Input = compressedFile; Output = compressedFile.Name; }
internal PluginFile(OMODCompressedFile compressedFile, string output) : base(compressedFile, output) { }
internal PluginFile(OMODCompressedFile compressedFile) : base(compressedFile) { }
internal DataFile(OMODCompressedFile compressedFile, string output) : base(compressedFile, output) { }
internal DataFile(OMODCompressedFile compressedFile) : base(compressedFile) { }