Ejemplo n.º 1
0
        /// <include file='IniReader.xml' path='//Method[@name="Close"]/docs/*' />
        public void Close()
        {
            Reset();
            readState = IniReadState.Closed;

            if (textReader != null)
            {
                textReader.Close();
            }
        }
Ejemplo n.º 2
0
        /// <include file='IniReader.xml' path='//Method[@name="Read"]/docs/*' />
        public bool Read()
        {
            bool result = false;

            if (readState != IniReadState.EndOfFile ||
                readState != IniReadState.Closed)
            {
                readState = IniReadState.Interactive;
                result    = ReadNext();
            }

            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Reads the next INI line item.
        /// </summary>
        private bool ReadNext()
        {
            bool result = true;
            int  ch     = PeekChar();

            Reset();

            if (IsComment(ch))
            {
                iniType = IniType.Empty;
                ReadChar(); // consume comment character
                ReadComment();


                return(result);
            }


            switch (ch)
            {
            case ' ':
            case '\t':
            case '\r':
                SkipWhitespace();
                ReadNext();
                break;

            case '\n':
                ReadChar();
                break;

            case '[':
                ReadSection();
                break;

            case -1:
                readState = IniReadState.EndOfFile;
                result    = false;
                break;

            default:
                ReadKey();
                break;
            }

            return(result);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Reads the next INI line item.
        /// </summary>
        private bool ReadNext()
        {
            bool result = true;
            int ch = PeekChar ();
            Reset ();

            if (IsComment (ch)) {
                iniType = IniType.Empty;
                ReadChar (); // consume comment character
                ReadComment ();

                return result;
            }

            switch (ch)
            {
                case ' ':
                case '\t':
                case '\r':
                    SkipWhitespace ();
                    ReadNext ();
                    break;
                case '\n':
                    ReadChar ();
                    break;
                case '[':
                    ReadSection ();
                    break;
                case -1:
                    readState = IniReadState.EndOfFile;
                    result = false;
                    break;
                default:
                    ReadKey ();
                    break;
            }

            return result;
        }
Ejemplo n.º 5
0
        /// <include file='IniReader.xml' path='//Method[@name="Read"]/docs/*' />
        public bool Read()
        {
            bool result = false;

            if (readState != IniReadState.EndOfFile
                || readState != IniReadState.Closed) {
                readState = IniReadState.Interactive;
                result = ReadNext ();
            }

            return result;
        }
Ejemplo n.º 6
0
        /// <include file='IniReader.xml' path='//Method[@name="Close"]/docs/*' />
        public void Close()
        {
            Reset ();
            readState = IniReadState.Closed;

            if (textReader != null) {
                textReader.Close ();
            }
        }