RequireEnd() public method

public RequireEnd ( ) : void
return void
Ejemplo n.º 1
0
        public FbxReader(BinaryReader reader)
        {
            reader.RequireMagic(Magic);
            Version = reader.ReadInt32();
            if (Version < MinimumSupportedVersion || Version > MaximumSupportedVersion)
                throw new InvalidDataException("Unsupported FBX version " + Version + "; supported versions are " + MinimumSupportedVersion + " to " + MaximumSupportedVersion + ".");

            FbxSection section;

            while ((section = new FbxSection(reader)).IsValid) {
                switch (section.Name) {
                    case FbxHeaderExtension.FbxFileTypeName:
                        new FbxHeaderExtension(section);
                        break;

                    case "FileId": // Seems to be a GUID in raw data.
                    case "CreationTime": // Same as in header.
                    case "Creator": // Same as in header.
                    case "GlobalSettings": // Don't care right now.
                        section.SeekToEnd();
                        break;

                    case "Documents":
                    case "References":
                    case "Definitions":
                        section.SeekToEnd();
                        break;

                    default:
                        throw new InvalidDataException("Unexpected root section '" + section.Name + "'.");
                }

                section.RequireEnd();
            }
        }
Ejemplo n.º 2
0
        public FbxReader(BinaryReader reader)
        {
            reader.RequireMagic(Magic);
            Version = reader.ReadInt32();
            if (Version < MinimumSupportedVersion || Version > MaximumSupportedVersion)
            {
                throw new InvalidDataException("Unsupported FBX version " + Version + "; supported versions are " + MinimumSupportedVersion + " to " + MaximumSupportedVersion + ".");
            }

            FbxSection section;

            while ((section = new FbxSection(reader)).IsValid)
            {
                switch (section.Name)
                {
                case FbxHeaderExtension.FbxFileTypeName:
                    new FbxHeaderExtension(section);
                    break;

                case "FileId":                         // Seems to be a GUID in raw data.
                case "CreationTime":                   // Same as in header.
                case "Creator":                        // Same as in header.
                case "GlobalSettings":                 // Don't care right now.
                    section.SeekToEnd();
                    break;

                case "Documents":
                case "References":
                case "Definitions":
                    section.SeekToEnd();
                    break;


                default:
                    throw new InvalidDataException("Unexpected root section '" + section.Name + "'.");
                }

                section.RequireEnd();
            }
        }