Пример #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);
        }
Пример #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);
            }
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }