InternetSearchDataSource::GetData(const PRUnichar *dataUni, const char *sectionToFind, PRUint32 sectionNum, const char *attribToFind, nsString &value)
InternetSearchDataSource::GetData(nsString &data, const char *sectionToFind, const char *attribToFind, nsString &value)
InternetSearchDataSource::GetData(const PRUnichar *dataUni, const char *sectionToFind, PRUint32 sectionNum,				  const char *attribToFind, nsString &value){	nsString	buffer(dataUni);	nsresult	rv = NS_RDF_NO_VALUE;	PRBool		inSection = PR_FALSE;	nsAutoString	section;	section.AssignWithConversion("<");	section.AppendWithConversion(sectionToFind);	while(buffer.Length() > 0)	{		PRInt32 eol = buffer.FindCharInSet("\r\n", 0);		if (eol < 0)	break;		nsAutoString	line;		if (eol > 0)		{			buffer.Left(line, eol);		}		buffer.Cut(0, eol+1);		if (line.Length() < 1)	continue;		// skip empty lines		if (line[0] == PRUnichar('#'))	continue;	// skip comments		line.Trim(" \t");		if (inSection == PR_FALSE)		{			PRInt32	sectionOffset = line.Find(section, PR_TRUE);			if (sectionOffset < 0)	continue;			if (sectionNum > 0)			{				--sectionNum;				continue;			}			line.Cut(0, sectionOffset + section.Length() + 1);			inSection = PR_TRUE;		}		line.Trim(" \t");		PRInt32	len = line.Length();		if (len > 0)		{			if (line[len-1] == PRUnichar('>'))			{				inSection = PR_FALSE;				line.SetLength(len-1);			}		}		PRInt32 equal = line.FindChar(PRUnichar('='));		if (equal < 0)	continue;			// skip lines with no equality				nsAutoString	attrib;		if (equal > 0)		{			line.Left(attrib, equal /* - 1 */);		}		attrib.Trim(" \t");		if (attrib.EqualsIgnoreCase(attribToFind))		{			line.Cut(0, equal+1);			line.Trim(" \t");			value = line;			// strip of any enclosing quotes			PRUnichar	quoteChar;			PRBool		foundQuoteChar = PR_FALSE;			if ((value[0] == PRUnichar('\"')) || (value[0] == PRUnichar('\'')))			{				foundQuoteChar = PR_TRUE;				quoteChar = value[0];				value.Cut(0,1);			}			len = value.Length();			if ((len > 0) && (foundQuoteChar == PR_TRUE))			{				PRInt32 quoteEnd = value.FindChar(quoteChar, PR_TRUE);				if (quoteEnd >= 0)				{					value.Truncate(quoteEnd);				}			}			else			{				PRInt32 commentOffset = value.FindCharInSet("# \t", 0);				if (commentOffset >= 0)				{					value.Truncate(commentOffset);				}				value.Trim(" \t");			}			rv = NS_OK;			break;		}	}	return(rv);}