private BlockParsedResult parseIsoIec646Block()
        {
            while (isStillIsoIec646(current.getPosition()))
            {
                DecodedChar iso = decodeIsoIec646(current.getPosition());
                current.setPosition(iso.NewPosition);

                if (iso.isFNC1())
                {
                    DecodedInformation information = new DecodedInformation(current.getPosition(), buffer.ToString());
                    return(new BlockParsedResult(information, true));
                }
                buffer.Append(iso.getValue());
            }

            if (isAlphaOr646ToNumericLatch(current.getPosition()))
            {
                current.incrementPosition(3);
                current.setNumeric();
            }
            else if (isAlphaTo646ToAlphaLatch(current.getPosition()))
            {
                if (current.getPosition() + 5 < this.information.Size)
                {
                    current.incrementPosition(5);
                }
                else
                {
                    current.setPosition(this.information.Size);
                }

                current.setAlpha();
            }
            return(new BlockParsedResult(false));
        }
Esempio n. 2
0
        private BlockParsedResult parseAlphaBlock()
        {
            while (isStillAlpha(current.getPosition()))
            {
                DecodedChar alpha = decodeAlphanumeric(current.getPosition());
                current.setPosition(alpha.NewPosition);

                if (alpha.isFNC1())
                {
                    DecodedInformation information = new DecodedInformation(current.getPosition(), buffer.ToString());
                    return(new BlockParsedResult(information, true)); //end of the char block
                }

                buffer.Append(alpha.getValue());
            }

            if (isAlphaOr646ToNumericLatch(current.getPosition()))
            {
                current.incrementPosition(3);
                current.setNumeric();
            }
            else if (isAlphaTo646ToAlphaLatch(current.getPosition()))
            {
                if (current.getPosition() + 5 < this.information.Size)
                {
                    current.incrementPosition(5);
                }
                else
                {
                    current.setPosition(this.information.Size);
                }

                current.setIsoIec646();
            }
            return(new BlockParsedResult());
        }