You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2006/03/19 15:29:51 UTC

svn commit: r386972 - in /xerces/c/trunk/src/xercesc: parsers/SAX2XMLReaderImpl.cpp sax2/XMLReaderFactory.hpp

Author: amassari
Date: Sun Mar 19 06:29:49 2006
New Revision: 386972

URL: http://svn.apache.org/viewcvs?rev=386972&view=rev
Log:
Factory method is no more inline to avoid including an internal header in a public one (jira#1579)

Modified:
    xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
    xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp

Modified: xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp?rev=386972&r1=386971&r2=386972&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp Sun Mar 19 06:29:49 2006
@@ -25,6 +25,7 @@
 #include <xercesc/sax2/ContentHandler.hpp>
 #include <xercesc/sax2/LexicalHandler.hpp>
 #include <xercesc/sax2/DeclHandler.hpp>
+#include <xercesc/sax2/XMLReaderFactory.hpp>
 #include <xercesc/sax/DTDHandler.hpp>
 #include <xercesc/sax/ErrorHandler.hpp>
 #include <xercesc/sax/EntityResolver.hpp>
@@ -40,6 +41,14 @@
 #include <string.h>
 
 XERCES_CPP_NAMESPACE_BEGIN
+
+
+SAX2XMLReader * XMLReaderFactory::createXMLReader(  MemoryManager* const  manager
+                                                  , XMLGrammarPool* const gramPool)
+{
+    SAX2XMLReaderImpl* pImpl=new (manager) SAX2XMLReaderImpl(manager, gramPool);
+	return pImpl;
+}
 
 
 const XMLCh gDTDEntityStr[] =

Modified: xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp?rev=386972&r1=386971&r2=386972&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp (original)
+++ xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp Sun Mar 19 06:29:49 2006
@@ -21,7 +21,7 @@
 #ifndef XMLREADERFACTORY_HPP
 #define XMLREADERFACTORY_HPP
 
-#include <xercesc/parsers/SAX2XMLReaderImpl.hpp>
+#include <xercesc/sax2/SAX2XMLReader.hpp>
 #include <xercesc/sax/SAXException.hpp>
 
 XERCES_CPP_NAMESPACE_BEGIN
@@ -45,10 +45,9 @@
 	~XMLReaderFactory() ;
 
 public:
-	static SAX2XMLReader * createXMLReader( 
-                                               MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
-                                             , XMLGrammarPool* const gramPool = 0
-                                               ) ;
+	static SAX2XMLReader * createXMLReader(  MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
+                                           , XMLGrammarPool* const gramPool = 0
+                                          ) ;
 	static SAX2XMLReader * createXMLReader(const XMLCh* className)  ;
 
 private:
@@ -58,13 +57,6 @@
     XMLReaderFactory(const XMLReaderFactory&);
     XMLReaderFactory& operator=(const XMLReaderFactory&);
 };
-
-
-inline SAX2XMLReader * XMLReaderFactory::createXMLReader(MemoryManager* const  manager
-                                                       , XMLGrammarPool* const gramPool)
-{
-	return (SAX2XMLReader*)(new (manager) SAX2XMLReaderImpl(manager, gramPool));
-}
 
 inline SAX2XMLReader * XMLReaderFactory::createXMLReader(const XMLCh *)
 {	



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org


Re: svn commit: r386972 - in /xerces/c/trunk/src/xercesc: parsers/SAX2XMLReaderImpl.cpp sax2/XMLReaderFactory.hpp

Posted by James Berry <jb...@apache.org>.
On Mar 22, 2006, at 1:30 AM, Alberto Massari wrote:

> PSVIWriter needs to access methods from the implementation class,  
> so I have modified it to include the proper header; the same  
> problem also occurs in the SCMPrint sample, and, as it only works  
> with the public interface, I have changed it to use the factory  
> method.
>
> Alberto

Alberto,

Thanks!

James.

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: svn commit: r386972 - in /xerces/c/trunk/src/xercesc: parsers/SAX2XMLReaderImpl.cpp sax2/XMLReaderFactory.hpp

Posted by Alberto Massari <am...@datadirect.com>.
Hi James,

At 04:15 PM 3/21/2006 -0800, James Berry wrote:
>Hey Alberto,
>
>This seems to break build of the sample PSVIWriter, for two reasons:
>
>  (1) The sample directly instanciates an SAX2XMLReaderImpl (but
>doesn't include the impl header). This is probably incorrect behavior
>on the part of the sample: it should call the factory method?
>
>Once that error is corrected in the sample, the sample continues to
>fail build:
>
>  (2) It uses (at least) two methods of SAX2XMLReaderImpl that are
>not exposed by SAX2XMLReader:
>
>src/PSVIWriter/PSVIWriter.cpp:219: error: 'class
>xercesc_3_0::SAX2XMLReader' has no member named 'setPSVIHandler'
>src/PSVIWriter/PSVIWriter.cpp:222: error: 'class
>xercesc_3_0::SAX2XMLReader' has no member named 'setXMLEntityResolver'
>
>Thoughts?

PSVIWriter needs to access methods from the implementation class, so 
I have modified it to include the proper header; the same problem 
also occurs in the SCMPrint sample, and, as it only works with the 
public interface, I have changed it to use the factory method.

Alberto


>James.
>
>On Mar 19, 2006, at 6:29 AM, amassari@apache.org wrote:
>
>>Author: amassari
>>Date: Sun Mar 19 06:29:49 2006
>>New Revision: 386972
>>
>>URL: http://svn.apache.org/viewcvs?rev=386972&view=rev
>>Log:
>>Factory method is no more inline to avoid including an internal
>>header in a public one (jira#1579)
>>
>>Modified:
>>     xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
>>     xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp
>>
>>Modified: xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
>>URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/ 
>>parsers/SAX2XMLReaderImpl.cpp?rev=386972&r1=386971&r2=386972&view=diff
>>====================================================================== 
>>========
>>--- xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
>>(original)
>>+++ xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp Sun
>>Mar 19 06:29:49 2006
>>@@ -25,6 +25,7 @@
>>  #include <xercesc/sax2/ContentHandler.hpp>
>>  #include <xercesc/sax2/LexicalHandler.hpp>
>>  #include <xercesc/sax2/DeclHandler.hpp>
>>+#include <xercesc/sax2/XMLReaderFactory.hpp>
>>  #include <xercesc/sax/DTDHandler.hpp>
>>  #include <xercesc/sax/ErrorHandler.hpp>
>>  #include <xercesc/sax/EntityResolver.hpp>
>>@@ -40,6 +41,14 @@
>>  #include <string.h>
>>
>>  XERCES_CPP_NAMESPACE_BEGIN
>>+
>>+
>>+SAX2XMLReader * XMLReaderFactory::createXMLReader(  MemoryManager*
>>const  manager
>>+                                                  ,
>>XMLGrammarPool* const gramPool)
>>+{
>>+    SAX2XMLReaderImpl* pImpl=new (manager) SAX2XMLReaderImpl 
>>(manager, gramPool);
>>+       return pImpl;
>>+}
>>
>>
>>  const XMLCh gDTDEntityStr[] =
>>
>>Modified: xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp
>>URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/sax2/ 
>>XMLReaderFactory.hpp?rev=386972&r1=386971&r2=386972&view=diff
>>====================================================================== 
>>========
>>--- xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp (original)
>>+++ xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp Sun Mar 19
>>06:29:49 2006
>>@@ -21,7 +21,7 @@
>>  #ifndef XMLREADERFACTORY_HPP
>>  #define XMLREADERFACTORY_HPP
>>
>>-#include <xercesc/parsers/SAX2XMLReaderImpl.hpp>
>>+#include <xercesc/sax2/SAX2XMLReader.hpp>
>>  #include <xercesc/sax/SAXException.hpp>
>>
>>  XERCES_CPP_NAMESPACE_BEGIN
>>@@ -45,10 +45,9 @@
>>         ~XMLReaderFactory() ;
>>
>>  public:
>>-       static SAX2XMLReader * createXMLReader(
>>-                                               MemoryManager*
>>const  manager = XMLPlatformUtils::fgMemoryManager
>>-                                             , XMLGrammarPool*
>>const gramPool = 0
>>-                                               ) ;
>>+       static SAX2XMLReader * createXMLReader(  MemoryManager* const
>>manager = XMLPlatformUtils::fgMemoryManager
>>+                                           , XMLGrammarPool* const
>>gramPool = 0
>>+                                          ) ;
>>         static SAX2XMLReader * createXMLReader(const XMLCh* className)  ;
>>
>>  private:
>>@@ -58,13 +57,6 @@
>>      XMLReaderFactory(const XMLReaderFactory&);
>>      XMLReaderFactory& operator=(const XMLReaderFactory&);
>>  };
>>-
>>-
>>-inline SAX2XMLReader * XMLReaderFactory::createXMLReader 
>>(MemoryManager* const  manager
>>-                                                       ,
>>XMLGrammarPool* const gramPool)
>>-{
>>-       return (SAX2XMLReader*)(new (manager) SAX2XMLReaderImpl(manager,
>>gramPool));
>>-}
>>
>>  inline SAX2XMLReader * XMLReaderFactory::createXMLReader(const
>>XMLCh *)
>>  {
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
>>For additional commands, e-mail: commits-help@xerces.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
>For additional commands, e-mail: c-dev-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: svn commit: r386972 - in /xerces/c/trunk/src/xercesc: parsers/SAX2XMLReaderImpl.cpp sax2/XMLReaderFactory.hpp

Posted by James Berry <jb...@apache.org>.
Hey Alberto,

This seems to break build of the sample PSVIWriter, for two reasons:

  (1) The sample directly instanciates an SAX2XMLReaderImpl (but  
doesn't include the impl header). This is probably incorrect behavior  
on the part of the sample: it should call the factory method?

Once that error is corrected in the sample, the sample continues to  
fail build:

  (2) It uses (at least) two methods of SAX2XMLReaderImpl that are  
not exposed by SAX2XMLReader:

src/PSVIWriter/PSVIWriter.cpp:219: error: 'class  
xercesc_3_0::SAX2XMLReader' has no member named 'setPSVIHandler'
src/PSVIWriter/PSVIWriter.cpp:222: error: 'class  
xercesc_3_0::SAX2XMLReader' has no member named 'setXMLEntityResolver'

Thoughts?

James.

On Mar 19, 2006, at 6:29 AM, amassari@apache.org wrote:

> Author: amassari
> Date: Sun Mar 19 06:29:49 2006
> New Revision: 386972
>
> URL: http://svn.apache.org/viewcvs?rev=386972&view=rev
> Log:
> Factory method is no more inline to avoid including an internal  
> header in a public one (jira#1579)
>
> Modified:
>     xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
>     xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp
>
> Modified: xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
> URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/ 
> parsers/SAX2XMLReaderImpl.cpp?rev=386972&r1=386971&r2=386972&view=diff
> ====================================================================== 
> ========
> --- xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp  
> (original)
> +++ xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp Sun  
> Mar 19 06:29:49 2006
> @@ -25,6 +25,7 @@
>  #include <xercesc/sax2/ContentHandler.hpp>
>  #include <xercesc/sax2/LexicalHandler.hpp>
>  #include <xercesc/sax2/DeclHandler.hpp>
> +#include <xercesc/sax2/XMLReaderFactory.hpp>
>  #include <xercesc/sax/DTDHandler.hpp>
>  #include <xercesc/sax/ErrorHandler.hpp>
>  #include <xercesc/sax/EntityResolver.hpp>
> @@ -40,6 +41,14 @@
>  #include <string.h>
>
>  XERCES_CPP_NAMESPACE_BEGIN
> +
> +
> +SAX2XMLReader * XMLReaderFactory::createXMLReader(  MemoryManager*  
> const  manager
> +                                                  ,  
> XMLGrammarPool* const gramPool)
> +{
> +    SAX2XMLReaderImpl* pImpl=new (manager) SAX2XMLReaderImpl 
> (manager, gramPool);
> +	return pImpl;
> +}
>
>
>  const XMLCh gDTDEntityStr[] =
>
> Modified: xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp
> URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/sax2/ 
> XMLReaderFactory.hpp?rev=386972&r1=386971&r2=386972&view=diff
> ====================================================================== 
> ========
> --- xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp (original)
> +++ xerces/c/trunk/src/xercesc/sax2/XMLReaderFactory.hpp Sun Mar 19  
> 06:29:49 2006
> @@ -21,7 +21,7 @@
>  #ifndef XMLREADERFACTORY_HPP
>  #define XMLREADERFACTORY_HPP
>
> -#include <xercesc/parsers/SAX2XMLReaderImpl.hpp>
> +#include <xercesc/sax2/SAX2XMLReader.hpp>
>  #include <xercesc/sax/SAXException.hpp>
>
>  XERCES_CPP_NAMESPACE_BEGIN
> @@ -45,10 +45,9 @@
>  	~XMLReaderFactory() ;
>
>  public:
> -	static SAX2XMLReader * createXMLReader(
> -                                               MemoryManager*  
> const  manager = XMLPlatformUtils::fgMemoryManager
> -                                             , XMLGrammarPool*  
> const gramPool = 0
> -                                               ) ;
> +	static SAX2XMLReader * createXMLReader(  MemoryManager* const   
> manager = XMLPlatformUtils::fgMemoryManager
> +                                           , XMLGrammarPool* const  
> gramPool = 0
> +                                          ) ;
>  	static SAX2XMLReader * createXMLReader(const XMLCh* className)  ;
>
>  private:
> @@ -58,13 +57,6 @@
>      XMLReaderFactory(const XMLReaderFactory&);
>      XMLReaderFactory& operator=(const XMLReaderFactory&);
>  };
> -
> -
> -inline SAX2XMLReader * XMLReaderFactory::createXMLReader 
> (MemoryManager* const  manager
> -                                                       ,  
> XMLGrammarPool* const gramPool)
> -{
> -	return (SAX2XMLReader*)(new (manager) SAX2XMLReaderImpl(manager,  
> gramPool));
> -}
>
>  inline SAX2XMLReader * XMLReaderFactory::createXMLReader(const  
> XMLCh *)
>  {	
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
> For additional commands, e-mail: commits-help@xerces.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org