You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2001/08/29 19:37:00 UTC
cvs commit: xml-xerces/c/src/internal XMLScanner2.cpp
tng 01/08/29 10:37:00
Modified: c/src/internal XMLScanner2.cpp
Log:
Use XMLBufBid instead of XMLBuffer directly for better performance.
Revision Changes Path
1.55 +20 -11 xml-xerces/c/src/internal/XMLScanner2.cpp
Index: XMLScanner2.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/internal/XMLScanner2.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- XMLScanner2.cpp 2001/08/28 19:20:53 1.54
+++ XMLScanner2.cpp 2001/08/29 17:37:00 1.55
@@ -55,7 +55,7 @@
*/
/*
- * $Id: XMLScanner2.cpp,v 1.54 2001/08/28 19:20:53 tng Exp $
+ * $Id: XMLScanner2.cpp,v 1.55 2001/08/29 17:37:00 tng Exp $
*/
@@ -247,11 +247,13 @@
// This is to tell the Validator that this attribute was
// faulted-in, was not an attribute in the attdef originally
attDef->setCreateReason(XMLAttDef::JustFaultIn);
+ XMLBufBid bbURI(&fBufMgr);
+ XMLBuffer& bufURI = bbURI.getBuffer();
- XMLBuffer bufURI;
getURIText(uriId, bufURI);
- XMLBuffer bufMsg;
+ XMLBufBid bbMsg(&fBufMgr);
+ XMLBuffer& bufMsg = bbMsg.getBuffer();
bufMsg.append(chOpenCurly);
bufMsg.append(bufURI.getRawBuffer());
bufMsg.append(chCloseCurly);
@@ -272,10 +274,12 @@
&& attDef->getCreateReason() == XMLAttDef::JustFaultIn
&& !attDef->getProvided())
{
- XMLBuffer bufURI;
+ XMLBufBid bbURI(&fBufMgr);
+ XMLBuffer& bufURI = bbURI.getBuffer();
getURIText(uriId, bufURI);
- XMLBuffer bufMsg;
+ XMLBufBid bbMsg(&fBufMgr);
+ XMLBuffer& bufMsg = bbMsg.getBuffer();
bufMsg.append(chOpenCurly);
bufMsg.append(bufURI.getRawBuffer());
bufMsg.append(chCloseCurly);
@@ -330,10 +334,12 @@
if (fGrammar->getGrammarType() == Grammar::SchemaGrammarType)
{
// normalize the attribute according to schema whitespace facet
- XMLBuffer toFill;
+ XMLBufBid bbtemp(&fBufMgr);
+ XMLBuffer& tempBuf = bbtemp.getBuffer();
+
DatatypeValidator* tempDV = ((SchemaAttDef*) attDef)->getDatatypeValidator();
- ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, normBuf.getRawBuffer(), toFill);
- normBuf.set(toFill.getRawBuffer());
+ ((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, normBuf.getRawBuffer(), tempBuf);
+ normBuf.set(tempBuf.getRawBuffer());
}
fValidator->validateAttrValue
@@ -1181,7 +1187,8 @@
void XMLScanner::scanRawAttrListforNameSpaces(const RefVectorOf<KVStringPair>* theRawAttrList, int attCount) {
// Schema Xsi Type yyyy (e.g. xsi:type="yyyyy")
- XMLBuffer fXsiType;
+ XMLBufBid bbXsi(&fBufMgr);
+ XMLBuffer& fXsiType = bbXsi.getBuffer();
//
// Make an initial pass through the list and find any xmlns attributes or
@@ -1316,7 +1323,8 @@
parser.setEntityResolver(fEntityResolver);
// Create a buffer for expanding the system id
- XMLBuffer expSysId;
+ XMLBufBid bbSys(&fBufMgr);
+ XMLBuffer& expSysId = bbSys.getBuffer();
//
// Allow the entity handler to expand the system id if they choose
@@ -2707,7 +2715,8 @@
bool XMLScanner::switchGrammar(int newGrammarNameSpaceIndex)
{
- XMLBuffer bufURI;
+ XMLBufBid bbURI(&fBufMgr);
+ XMLBuffer& bufURI = bbURI.getBuffer();
getURIText(newGrammarNameSpaceIndex, bufURI);
Grammar* tempGrammar = fGrammarResolver->getGrammar(bufURI.getRawBuffer());
if (!tempGrammar) {
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org