ReadHeader() 공개 정적인 메소드

public static ReadHeader ( string path ) : List
path string
리턴 List
예제 #1
0
        public static ppFormat GetFormat(string path)
        {
            ppHeader header = null;

            for (int i = 0; i < ppHeader.Array.Length; i++)
            {
                try
                {
                    if ((header = ppHeader.Array[i].TryHeader(path)) != null)
                    {
                        break;
                    }
                }
                catch
                {
                }
            }

            ppFormat resultFormat = null;

            if (header != null)
            {
                if (header.ppFormats.Length == 1)
                {
                    resultFormat = header.ppFormats[0];
                }
                else
                {
                    List <IWriteFile> subfiles = header.ReadHeader(path, null);
                    for (int i = 0; i < subfiles.Count; i++)
                    {
                        if ((resultFormat = TryFile((ppSubfile)subfiles[i], header.ppFormats)) != null)
                        {
                            break;
                        }
                    }
                }

                if (resultFormat == null)
                {
                    resultFormat = header.ppFormats[0];
                    Report.ReportLog("Couldn't auto-detect the ppFormat for " + path + ". Using " + resultFormat.Name + " instead");
                }
            }

            return(resultFormat);
        }
예제 #2
0
파일: ppFormat.cs 프로젝트: ezdiy/GDImport
        public static ppFormat GetFormat(FileStream stream, out ppHeader header)
        {
            header = null;
            for (int i = 0; i < ppHeader.Array.Length; i++)
            {
                try
                {
                    if ((header = ppHeader.Array[i].TryHeader(stream)) != null)
                    {
                        break;
                    }
                }
                catch
                {
                }
            }

            ppFormat resultFormat = null;

            if (header != null)
            {
                if (header.ppFormats.Length == 1)
                {
                    resultFormat = header.ppFormats[0];
                }
                else
                {
                    List <IWriteFile> subfiles = header.ReadHeader(stream, null);
                    for (int i = 0; i < subfiles.Count; i++)
                    {
                        if ((resultFormat = TryFile(stream, (ppSubfile)subfiles[i], header.ppFormats)) != null)
                        {
                            break;
                        }
                    }
                }
            }

            return(resultFormat);
        }
예제 #3
0
        public static ppFormat GetFormat(FileStream stream, out ppHeader header)
        {
            header = null;
            for (int i = 0; i < ppHeader.Array.Length; i++)
            {
                try
                {
                    if ((header = ppHeader.Array[i].TryHeader(stream)) != null)
                    {
                        break;
                    }
                }
                catch
                {
                }
            }

            ppFormat resultFormat = null;
            if (header != null)
            {
                if (header.ppFormats.Length == 1)
                {
                    resultFormat = header.ppFormats[0];
                }
                else
                {
                    List<IWriteFile> subfiles = header.ReadHeader(stream, null);
                    for (int i = 0; i < subfiles.Count; i++)
                    {
                        if ((resultFormat = TryFile(stream, (ppSubfile)subfiles[i], header.ppFormats)) != null)
                        {
                            break;
                        }
                    }
                }
            }

            return resultFormat;
        }