Example #1
0
        public string ReadZone()
        {
            int i1 = giIndexNextChar;
            int ic = ReadCharZone(true);

            if (ic == -1)
            {
                return(null);
            }

            StringZone    sz = new StringZone();
            StringBuilder sb = new StringBuilder();

            sb.Append((char)ic);
            bool bZone = false;

            sz.IsZone = false;
            if (giIndexZone != -1)
            {
                sz.IsZone        = true;
                sz.BeginZoneChar = gcCurrentBeginZoneChar;
                sz.EndZoneChar   = gcCurrentEndZoneChar;
                bZone            = true;
            }
            while ((ic = ReadCharZone(false)) != -1)
            {
                sb.Append((char)ic);
                if (bZone && giIndexZone == -1)
                {
                    break;
                }
            }
            string s = sb.ToString();

            sz.String = s;
            if (bZone)
            {
                if (giIndexZone == -1)
                {
                    sz.ContentString = s.Substring(1, s.Length - 2);
                }
                else
                {
                    sz.ContentString = s.Substring(1);
                }
            }
            else
            {
                sz.ContentString = s;
            }
            if (bZone && giIndexZone != -1)
            {
                sz.EndZoneChar = (char)0;
            }
            gStringZones.Add(sz);
            return(s);
        }
Example #2
0
        public string ReadZone()
        {
            int i1 = giIndexNextChar;
            int ic = ReadCharZone(true);
            if (ic == -1) return null;

            StringZone sz = new StringZone();
            StringBuilder sb = new StringBuilder();
            sb.Append((char)ic);
            bool bZone = false;
            sz.IsZone = false;
            if (giIndexZone != -1)
            {
                sz.IsZone = true;
                sz.BeginZoneChar = gcCurrentBeginZoneChar;
                sz.EndZoneChar = gcCurrentEndZoneChar;
                bZone = true;
            }
            while ((ic = ReadCharZone(false)) != -1)
            {
                sb.Append((char)ic);
                if (bZone && giIndexZone == -1) break;
            }
            string s = sb.ToString();
            sz.String = s;
            if (bZone)
            {
                if (giIndexZone == -1)
                    sz.ContentString = s.Substring(1, s.Length - 2);
                else
                    sz.ContentString = s.Substring(1);
            }
            else
                sz.ContentString = s;
            if (bZone && giIndexZone != -1)
                sz.EndZoneChar = (char)0;
            gStringZones.Add(sz);
            return s;
        }