コード例 #1
0
ファイル: FilePatch.cs プロジェクト: erri120/OMODFramework
 internal FilePatch(OMODCompressedFile from, string to, bool create, bool plugin)
 {
     From     = from;
     To       = to.MakePath();
     Create   = create;
     IsPlugin = plugin;
 }
コード例 #2
0
ファイル: Utils.cs プロジェクト: erri120/OMODFramework
        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));
        }
コード例 #3
0
 internal ScriptReturnFile(OMODCompressedFile compressedFile, string output)
 {
     Input  = compressedFile;
     Output = output.MakePath();
 }
コード例 #4
0
 internal ScriptReturnFile(OMODCompressedFile compressedFile)
 {
     Input  = compressedFile;
     Output = compressedFile.Name;
 }
コード例 #5
0
 internal PluginFile(OMODCompressedFile compressedFile, string output) : base(compressedFile, output)
 {
 }
コード例 #6
0
 internal PluginFile(OMODCompressedFile compressedFile) : base(compressedFile)
 {
 }
コード例 #7
0
 internal DataFile(OMODCompressedFile compressedFile, string output) : base(compressedFile, output)
 {
 }
コード例 #8
0
 internal DataFile(OMODCompressedFile compressedFile) : base(compressedFile)
 {
 }