isFinal parameter in XML_Parser() and XML_ParseBuffer()

Albrecht Fritzsche <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
Hi,

I cannot find much documentation about this isFinal parameter in calls 
like XML_Parser() and XML_ParseBuffer(). Is it vital that this one was
called or can I get away w/o using it?

My parsing loop looks like

     const size_t BUFFSIZE = 8192;
     char buffer[BUFFSIZE];

     bool done = false;
     while (!done) {
	int size = m_reader->read(buffer, BUFFSIZE);
	if (size == 0) {
	    // (Debug, "End of file reached");  //<--
	    break;
	}
	else if (size < BUFFSIZE) {
	    done = true;
	}

	if (XML_Parse(parser, buffer, int(size), done) == 0) {
	    // (Warning, "Parse error");
	    return false;
         }
     }

So, if the file size is exactly equal to BUFFSIZE then the XML_Parser() 
gets called only once, the second iteration in the while loop terminates 
because the reader returns now 0.

Do I have to add in line //<-- a

   XML_Parse(parser, buffer, 0, true);

just for the sake of passing the EndOfFile indication?

Thanks
Ali
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.