Esempio n. 1
0
            /// <inheritdoc />
            protected override RomFormat GetMemo(string filePath, object data)
            {
                var format = LuigiFormatRom.CheckFormat(filePath);

                if (format == RomFormat.None)
                {
                    format = RomFormatRom.CheckFormat(filePath);
                }
                if (format == RomFormat.None)
                {
                    format = BinFormatRom.CheckFormat(filePath);
                }
                return(format);
            }
Esempio n. 2
0
        /// <summary>
        /// Inspects data in the stream to determine if it appears to be a ROM.
        /// </summary>
        /// <param name="stream">The stream containing the data to inspect.</param>
        /// <returns>A <see cref="RomFormat"/> value; a value of <c>RomFormat.None</c> indicates the stream is almost certainly not
        /// a known ROM format. It is possible to get false positive matches resulting in <c>RomFormat.Bin</c> as it is not a
        /// strongly structured format that can be identified with high confidence. It is incumbent upon the caller to do a modicum
        /// of checking, e.g. file name extension checks, or later exception handling, to deal with errors.</returns>
        public static RomFormat GetFormat(System.IO.Stream stream)
        {
            var format = LuigiFormatRom.CheckFormat(stream);

            if (format == RomFormat.None)
            {
                format = RomFormatRom.CheckFormat(stream);
            }
            if (format == RomFormat.None)
            {
                format = BinFormatRom.CheckFormat(stream);
            }
            return(format);
        }