You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/08/06 03:37:01 UTC

cvs commit: xml-xalan/c/src/XalanSourceTree XalanSourceTreeContentHandler.cpp XalanSourceTreeContentHandler.hpp XalanSourceTreeDocument.cpp XalanSourceTreeDocument.hpp XalanSourceTreeParserLiaison.cpp XalanSourceTreeParserLiaison.hpp

dbertoni    01/08/05 18:37:01

  Modified:    c/src/XalanSourceTree XalanSourceTreeContentHandler.cpp
                        XalanSourceTreeContentHandler.hpp
                        XalanSourceTreeDocument.cpp
                        XalanSourceTreeDocument.hpp
                        XalanSourceTreeParserLiaison.cpp
                        XalanSourceTreeParserLiaison.hpp
  Log:
  Implemented document instance number.
  
  Revision  Changes    Path
  1.6       +0 -36     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeContentHandler.cpp
  
  Index: XalanSourceTreeContentHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeContentHandler.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XalanSourceTreeContentHandler.cpp	2001/01/25 17:13:01	1.5
  +++ XalanSourceTreeContentHandler.cpp	2001/08/06 01:37:01	1.6
  @@ -83,7 +83,6 @@
   	m_elementStack(),
   	m_lastChild(0),
   	m_lastChildStack(),
  -	m_ownsDocument(false),
   	m_accumulateText(fAccumulateText),
   	m_textBuffer()
   {
  @@ -93,10 +92,6 @@
   
   XalanSourceTreeContentHandler::~XalanSourceTreeContentHandler()
   {
  -	if (m_ownsDocument == true)
  -	{
  -		delete m_document;
  -	}
   }
   
   
  @@ -269,18 +264,6 @@
   void
   XalanSourceTreeContentHandler::startDocument()
   {
  -	// Clean up and reset everything...
  -	if (m_document == 0)
  -	{
  -		m_document = new XalanSourceTreeDocument;
  -	}
  -	else if (m_ownsDocument == true)
  -	{
  -		delete m_document;
  -
  -		m_document = new XalanSourceTreeDocument;
  -	}
  -
   	m_currentElement = 0;
   
   	m_elementStack.clear();
  @@ -463,26 +446,7 @@
   void
   XalanSourceTreeContentHandler::setDocument(XalanSourceTreeDocument*	theDocument)
   {
  -	if (m_ownsDocument == true)
  -	{
  -		delete m_document;
  -	}
  -
   	m_document = theDocument;
  -}
  -
  -
  -
  -XalanSourceTreeDocument*
  -XalanSourceTreeContentHandler::detachDocument()
  -{
  -	XalanSourceTreeDocument* const	theDocument = m_document;
  -
  -	m_document = 0;
  -
  -	m_ownsDocument = false;
  -
  -	return theDocument;
   }
   
   
  
  
  
  1.5       +0 -7      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeContentHandler.hpp
  
  Index: XalanSourceTreeContentHandler.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeContentHandler.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XalanSourceTreeContentHandler.hpp	2001/01/16 02:52:35	1.4
  +++ XalanSourceTreeContentHandler.hpp	2001/08/06 01:37:01	1.5
  @@ -220,9 +220,6 @@
   	void
   	setDocument(XalanSourceTreeDocument*	theDocument);
   
  -	XalanSourceTreeDocument*
  -	detachDocument();
  -
   private:
   
   	// Not implemented...
  @@ -272,10 +269,6 @@
   	// Stack of last children appended.  There is a ono-to-one
   	// correspondance to the entries in m_elementStack.
   	LastChildStackType			m_lastChildStack;
  -
  -	// If true, the instance owns the document and will delete
  -	// it when necessary.
  -	bool						m_ownsDocument;
   
   	// If true, the handler will accumulate text from calls to
   	// characters() until another event triggers the creation
  
  
  
  1.19      +10 -0     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.cpp
  
  Index: XalanSourceTreeDocument.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.cpp,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- XalanSourceTreeDocument.cpp	2001/07/18 04:21:41	1.18
  +++ XalanSourceTreeDocument.cpp	2001/08/06 01:37:01	1.19
  @@ -81,6 +81,7 @@
   
   
   XalanSourceTreeDocument::XalanSourceTreeDocument(
  +			unsigned long	theNumber,
   			bool			fPoolAllText,
   			unsigned int	theNamesStringPoolBlockSize,
   			unsigned int	theNamesStringPoolBucketCount,
  @@ -89,6 +90,7 @@
   			unsigned int	theValuesStringPoolBucketCount,
   			unsigned int	theValuesStringPoolBucketSize) :
   	XalanDocument(),
  +	m_number(theNumber),
   	m_firstChild(0),
   	m_documentElement(0),
   	m_attributeAllocator(200),
  @@ -536,6 +538,14 @@
   	{
   		return (*i).second;
   	}
  +}
  +
  +
  +
  +unsigned long
  +XalanSourceTreeDocument::getNumber() const
  +{
  +	return m_number;
   }
   
   
  
  
  
  1.11      +13 -0     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.hpp
  
  Index: XalanSourceTreeDocument.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.hpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- XalanSourceTreeDocument.hpp	2001/07/18 04:21:41	1.10
  +++ XalanSourceTreeDocument.hpp	2001/08/06 01:37:01	1.11
  @@ -154,10 +154,18 @@
   	 *
   	 * Constructor for XalanSourceTreeDocument.
   	 *
  +	 * @param theNumber The number of the document.
   	 * @param fPoolAllText If false, text node data that is not whitespace will not be pooled.
  +	 * @param theNamesStringPoolBlockSize The block size for allocating strings in the name pool
  +	 * @param theNamesStringPoolBucketCount The number of buckets for allocating strings in the name pool
  +	 * @param theNamesStringPoolBucketSize The bucket size for allocating strings in the name pool
  +	 * @param theValuesStringPoolBlockSize The block size for allocating strings in the values pool
  +	 * @param theValuesStringPoolBucketCount The number of buckets for allocating strings in the values pool
  +	 * @param theValuesStringPoolBucketSize The bucket size for allocating strings in the values pool
   	 *
   	 */
   	XalanSourceTreeDocument(
  +			unsigned long	theNumber,
   			bool			fPoolAllText = true,
   			unsigned int	theNamesStringPoolBlockSize = eDefaultNamesStringPoolBlockSize,
   			unsigned int	theNamesStringPoolBucketCount = eDefaultNamesStringPoolBucketCount,
  @@ -320,6 +328,9 @@
   	virtual XalanElement*
   	getElementById(const XalanDOMString&	elementId) const;
   
  +	virtual unsigned long
  +	getNumber() const;
  +
   
   	// Interfaces not inherited from XalanDocument...
   
  @@ -475,6 +486,8 @@
   
   
   	// Data members...
  +	const unsigned long								m_number;
  +
   	XalanNode*										m_firstChild;
   
   	XalanSourceTreeElement*							m_documentElement;
  
  
  
  1.16      +11 -4     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeParserLiaison.cpp
  
  Index: XalanSourceTreeParserLiaison.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeParserLiaison.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- XalanSourceTreeParserLiaison.cpp	2001/07/08 07:00:02	1.15
  +++ XalanSourceTreeParserLiaison.cpp	2001/08/06 01:37:01	1.16
  @@ -128,6 +128,7 @@
   
   
   XalanSourceTreeParserLiaison::XalanSourceTreeParserLiaison(XalanSourceTreeDOMSupport&	/* theSupport */) :
  +	m_documentNumber(0),
   	m_xercesParserLiaison(),
   	m_documentMap(),
   	m_persistentDocumentMap(),
  @@ -237,9 +238,7 @@
   
   	theReader->parse(inputSource);
   
  -	XalanSourceTreeDocument* const	theDocument = theContentHandler.detachDocument();
  -
  -	return theDocument;
  +	return theContentHandler.getDocument();
   }
   
   
  @@ -273,6 +272,14 @@
   
   
   
  +unsigned long
  +XalanSourceTreeParserLiaison::getDocumentNumber()
  +{
  +	return m_documentNumber++;
  +}
  +
  +
  +
   int
   XalanSourceTreeParserLiaison::getIndent() const
   {
  @@ -466,7 +473,7 @@
   XalanSourceTreeParserLiaison::createXalanSourceTreeDocument()
   {
   	XalanSourceTreeDocument* const	theNewDocument =
  -		new XalanSourceTreeDocument(m_poolAllText);
  +		new XalanSourceTreeDocument(m_documentNumber++, m_poolAllText);
   
   	m_documentMap[theNewDocument] = theNewDocument;
   
  
  
  
  1.12      +5 -0      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeParserLiaison.hpp
  
  Index: XalanSourceTreeParserLiaison.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeParserLiaison.hpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XalanSourceTreeParserLiaison.hpp	2001/07/08 07:00:02	1.11
  +++ XalanSourceTreeParserLiaison.hpp	2001/08/06 01:37:01	1.12
  @@ -157,6 +157,9 @@
   	virtual void
   	destroyDocument(XalanDocument*	theDocument);
   
  +	virtual unsigned long
  +	getDocumentNumber();
  +
   	virtual int
   	getIndent() const;
   
  @@ -363,6 +366,8 @@
   private:
   
   	// Data members...
  +
  +	unsigned long				m_documentNumber;
   
   	XercesParserLiaison			m_xercesParserLiaison;
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org