SkipString() public method

public SkipString ( ) : void
return void
コード例 #1
0
ファイル: NbtString.cs プロジェクト: gitter-badger/SharpMC
 internal override bool ReadTag(NbtBinaryReader readStream)
 {
     if (readStream.Selector != null && !readStream.Selector(this))
     {
         readStream.SkipString();
         return(false);
     }
     Value = readStream.ReadString();
     return(true);
 }
コード例 #2
0
        void SkipValue()
        {
            // Make sure to check for "atValue" before calling this method
            switch (TagType)
            {
            case NbtTagType.Byte:
                reader.ReadByte();
                break;

            case NbtTagType.Short:
                reader.ReadInt16();
                break;

            case NbtTagType.Float:
            case NbtTagType.Int:
                reader.ReadInt32();
                break;

            case NbtTagType.Double:
            case NbtTagType.Long:
                reader.ReadInt64();
                break;

            case NbtTagType.ByteArray:
                reader.Skip(TagLength);
                break;

            case NbtTagType.IntArray:
                reader.Skip(sizeof(int) * TagLength);
                break;

            case NbtTagType.LongArray:
                reader.Skip(sizeof(long) * TagLength);
                break;

            case NbtTagType.String:
                reader.SkipString();
                break;

            default:
                throw new InvalidOperationException(NonValueTagError);
            }
            atValue    = false;
            valueCache = null;
        }
コード例 #3
0
ファイル: NbtReader.cs プロジェクト: gitter-badger/SharpMC
        void SkipValue()
        {
            if (!atValue)
            {
                throw new NbtFormatException(NoValueToReadError);
            }
            switch (TagType)
            {
            case NbtTagType.Byte:
                reader.ReadByte();
                break;

            case NbtTagType.Short:
                reader.ReadInt16();
                break;

            case NbtTagType.Float:
            case NbtTagType.Int:
                reader.ReadInt32();
                break;

            case NbtTagType.Double:
            case NbtTagType.Long:
                reader.ReadInt64();
                break;

            case NbtTagType.ByteArray:
                reader.Skip(TagLength);
                break;

            case NbtTagType.IntArray:
                reader.Skip(sizeof(int) * TagLength);
                break;

            case NbtTagType.String:
                reader.SkipString();
                break;

            default:
                throw new InvalidOperationException(NonValueTagError);
            }
            atValue    = false;
            valueCache = null;
        }
コード例 #4
0
ファイル: NbtString.cs プロジェクト: gitter-badger/SharpMC
 internal override void SkipTag(NbtBinaryReader readStream)
 {
     readStream.SkipString();
 }
コード例 #5
0
ファイル: NbtList.cs プロジェクト: wledfor2/fNbt
        internal override void SkipTag(NbtBinaryReader readStream)
        {
            // read list type, and make sure it's defined
            ListType = readStream.ReadTagType();

            int length = readStream.ReadInt32();

            if (length < 0)
            {
                throw new NbtFormatException("Negative list size given.");
            }

            switch (ListType)
            {
            case NbtTagType.Byte:
                readStream.Skip(length);
                break;

            case NbtTagType.Short:
                readStream.Skip(length * sizeof(short));
                break;

            case NbtTagType.Int:
                readStream.Skip(length * sizeof(int));
                break;

            case NbtTagType.Long:
                readStream.Skip(length * sizeof(long));
                break;

            case NbtTagType.Float:
                readStream.Skip(length * sizeof(float));
                break;

            case NbtTagType.Double:
                readStream.Skip(length * sizeof(double));
                break;

            default:
                for (int i = 0; i < length; i++)
                {
                    switch (listType)
                    {
                    case NbtTagType.ByteArray:
                        new NbtByteArray().SkipTag(readStream);
                        break;

                    case NbtTagType.String:
                        readStream.SkipString();
                        break;

                    case NbtTagType.List:
                        new NbtList().SkipTag(readStream);
                        break;

                    case NbtTagType.Compound:
                        new NbtCompound().SkipTag(readStream);
                        break;

                    case NbtTagType.IntArray:
                        new NbtIntArray().SkipTag(readStream);
                        break;
                    }
                }
                break;
            }
        }
コード例 #6
0
ファイル: NbtCompound.cs プロジェクト: mstefarov/fNbt
        internal override void SkipTag(NbtBinaryReader readStream)
        {
            while (true)
            {
                NbtTagType nextTag = readStream.ReadTagType();
                NbtTag     newTag;
                switch (nextTag)
                {
                case NbtTagType.End:
                    return;

                case NbtTagType.Byte:
                    newTag = new NbtByte();
                    break;

                case NbtTagType.Short:
                    newTag = new NbtShort();
                    break;

                case NbtTagType.Int:
                    newTag = new NbtInt();
                    break;

                case NbtTagType.Long:
                    newTag = new NbtLong();
                    break;

                case NbtTagType.Float:
                    newTag = new NbtFloat();
                    break;

                case NbtTagType.Double:
                    newTag = new NbtDouble();
                    break;

                case NbtTagType.ByteArray:
                    newTag = new NbtByteArray();
                    break;

                case NbtTagType.String:
                    newTag = new NbtString();
                    break;

                case NbtTagType.List:
                    newTag = new NbtList();
                    break;

                case NbtTagType.Compound:
                    newTag = new NbtCompound();
                    break;

                case NbtTagType.IntArray:
                    newTag = new NbtIntArray();
                    break;

                case NbtTagType.LongArray:
                    newTag = new NbtLongArray();
                    break;

                default:
                    throw new NbtFormatException("Unsupported tag type found in NBT_Compound: " + nextTag);
                }
                readStream.SkipString();
                newTag.SkipTag(readStream);
            }
        }
コード例 #7
0
ファイル: NbtString.cs プロジェクト: LiveMC/SharpMC
 internal override bool ReadTag( NbtBinaryReader readStream )
 {
     if( readStream.Selector != null && !readStream.Selector( this ) ) {
         readStream.SkipString();
         return false;
     }
     Value = readStream.ReadString();
     return true;
 }
コード例 #8
0
ファイル: NbtString.cs プロジェクト: LiveMC/SharpMC
 internal override void SkipTag( NbtBinaryReader readStream )
 {
     readStream.SkipString();
 }