incremental parsing; xml support; token handler dispatching; performance

git-svn-id: svn://10.0.0.236/trunk@2126 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg
1998-05-21 20:38:32 +00:00
parent 3fac38b3d8
commit f2f5d28308
44 changed files with 1476 additions and 2488 deletions

View File

@@ -154,6 +154,8 @@ void _PreCompressBuffer(nsString& aBuffer,PRInt32& anOffset,PRInt32& aMarkPos){
//we should check mMarkPos. That represents the point at which
//we've guaranteed the client we can back up to, so make sure
//you don't lose any of the data beyond that point.
/*
if((anOffset!=aMarkPos) && (0<=aMarkPos)) {
if(aMarkPos>0) {
aBuffer.Cut(0,aMarkPos);
@@ -162,6 +164,16 @@ void _PreCompressBuffer(nsString& aBuffer,PRInt32& anOffset,PRInt32& aMarkPos){
}
}
else aBuffer.Truncate();
*/
PRInt32 len=aBuffer.Length();
if((aMarkPos<len) && (aMarkPos>=0)) {
aBuffer.Cut(0,aMarkPos);
anOffset-=aMarkPos;
}
else {
aBuffer.Truncate();
anOffset=0;
}
aMarkPos=0;
}
@@ -204,6 +216,19 @@ PRBool CScanner::Append(nsString& aBuffer) {
return PR_TRUE;
}
/**
*
*
* @update gess 5/21/98
* @param
* @return
*/
PRBool CScanner::Append(const char* aBuffer, PRInt32 aLen){
_PreCompressBuffer(mBuffer,mOffset,mMarkPos);
mBuffer.Append(aBuffer,aLen);
return PR_TRUE;
}
/**
* Grab data from underlying stream.
*