public uint ReadLine(ref GedcomParserProgress progress)
        {
            ResetLine();

            bool endOfLine      = false;
            uint noOfChars      = 0;
            int  lfCnt          = 0;
            bool lineEndStarted = false;

            while ((progress.position < progress.size) && !endOfLine)
            {
                char ch;
                ch = (char)progress.data[progress.position++];

                if (lineEndStarted || parser.IsNewLine(ch))
                {
                    if (lineFeedString[lfCnt++] != ch)
                    {
                        DebugStringAdd("Line:" + lineNo + " Inconsistent line feeds!");
                        if ((progress.data.Length > progress.position) && (parser.IsNewLine((char)progress.data[progress.position + 1])))
                        {
                            progress.position++;
                        }
                        endOfLine = true;
                    }
                    if (lfCnt == lineFeedString.Length)
                    {
                        endOfLine = true;
                    }
                    lineEndStarted = true;
                }
                else
                {
                    AddChar(ch);
                    noOfChars++;
                }
            }

            //trace.TraceInformation("ReadLine end");
            return(noOfChars);
        }