Esempio n. 1
0
        private static cSequenceSetItem[] ZFromNumber(uint pNumber)
        {
            if (pNumber == 0)
            {
                throw new ArgumentOutOfRangeException(nameof(pNumber));
            }

            cSequenceSetItem[] lItems = new cSequenceSetItem[1];

            // 1)
            //if (pNumber == uint.MaxValue) lItems[0] = cSequenceSetItem.Asterisk;
            //else

            lItems[0] = new cSequenceSetNumber(pNumber);

            return(lItems);
        }
Esempio n. 2
0
        private bool ZGetSequenceSetItem(out cSequenceSetItem rItem)
        {
            uint lNumber;
            cSequenceSetRangePart lItem;

            if (SkipByte(cASCII.ASTERISK))
            {
                lItem = cSequenceSetItem.Asterisk;
            }
            else
            {
                if (!GetNZNumber(out _, out lNumber))
                {
                    rItem = null; return(false);
                }
                lItem = new cSequenceSetNumber(lNumber);
            }

            var lBookmark = Position;

            if (!SkipByte(cASCII.COLON))
            {
                rItem = lItem;
                return(true);
            }

            if (SkipByte(cASCII.ASTERISK))
            {
                rItem = new cSequenceSetRange(lItem, cSequenceSetItem.Asterisk);
                return(true);
            }

            if (GetNZNumber(out _, out lNumber))
            {
                rItem = new cSequenceSetRange(lItem, new cSequenceSetNumber(lNumber));
            }
            else
            {
                Position = lBookmark;
                rItem    = lItem;
            }

            return(true);
        }