Exemplo n.º 1
0
        public static CASCFolder GetDirectory(this CASCFolder cascFolder, string folderPath)
        {
            CASCFolder currentFolder = cascFolder;

            foreach (string directory in EnumeratedStringPath(folderPath))
            {
                currentFolder = (CASCFolder)currentFolder.GetEntry(directory);
            }

            return(currentFolder);
        }
Exemplo n.º 2
0
        public static IEnumerable <KeyValuePair <int, WDC3Row> > EnumerateTable(this CASCFolder folder, string name, CASCHandler handler)
        {
            var entry = folder.GetEntry(name + ".db2");

            using var stream = handler.OpenFile(entry.Hash);
            var reader = new WDC3Reader(stream);

            foreach (var pair in reader)
            {
                yield return(pair);
            }
        }
Exemplo n.º 3
0
        public static bool DirectoryExists(this CASCFolder cascFolder, string folderPath)
        {
            CASCFolder currentFolder = cascFolder;

            foreach (string directory in EnumeratedStringPath(folderPath))
            {
                if ((CASCFolder)currentFolder.GetEntry(directory) == null)
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 4
0
        public static CASCFolder GetDirectory(this CASCFolder cascFolder, string folderPath)
        {
            if (cascFolder is null)
            {
                throw new ArgumentNullException(nameof(cascFolder));
            }
            if (folderPath is null)
            {
                throw new ArgumentNullException(nameof(folderPath));
            }

            CASCFolder currentFolder = cascFolder;

            foreach (string directory in EnumeratedStringPath(folderPath))
            {
                currentFolder = (CASCFolder)currentFolder.GetEntry(directory);
            }

            return(currentFolder);
        }
Exemplo n.º 5
0
        public static bool DirectoryExists(this CASCFolder cascFolder, string folderPath)
        {
            if (cascFolder is null)
            {
                throw new ArgumentNullException(nameof(cascFolder));
            }
            if (folderPath is null)
            {
                throw new ArgumentNullException(nameof(folderPath));
            }

            CASCFolder currentFolder = cascFolder;

            foreach (string directory in EnumeratedStringPath(folderPath))
            {
                if ((CASCFolder)currentFolder.GetEntry(directory) == null)
                {
                    return(false);
                }
            }

            return(true);
        }