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