You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Thomas Blatter <Th...@wanadoo.fr> on 2002/10/01 12:09:45 UTC

maybe const-glitches in the Apache c++ bindings

Hi,

    i just checked out the Xerces nightly build. I'll list here what i 
think are const-glitches or alike. Most of the ones i found previously are 
now fixed.

    DOMWriter::

    virtual XMLCh*     writeToString(const DOMNode &nodeToWrite) = 0;

    This should take a DOMNode * (and not a reference) like everybody else.

    DOMNode::

    virtual const XMLCh*           getTextContent() const = 0;

    I'd expect here rather a non-const XMLCh* like the above writeToString, 
since I don't think Xerces will ever maintain in memory whole textContents 
for all the nodes.

    DOMImplementation::

    virtual bool  hasFeature(const XMLCh *feature,  const XMLCh *version) = 0;

    Non-const? The DOMDocument::getNormalizationFeature() is const...

    DOMRange::

    virtual const DOMNode* getCommonAncestorContainer() const = 0;

    Why is the returned node for once const?

    Regards

    Thomas Blatter


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


Re: maybe const-glitches in the Apache c++ bindings

Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hi,
	I agree with all your comments. We best sort them out!


On Tue, 1 Oct 2002, Thomas Blatter wrote:

> Hi,
> 
>     i just checked out the Xerces nightly build. I'll list here what i 
> think are const-glitches or alike. Most of the ones i found previously are 
> now fixed.
> 
>     DOMWriter::
> 
>     virtual XMLCh*     writeToString(const DOMNode &nodeToWrite) = 0;
> 
>     This should take a DOMNode * (and not a reference) like everybody else.
> 
>     DOMNode::
> 
>     virtual const XMLCh*           getTextContent() const = 0;
> 
>     I'd expect here rather a non-const XMLCh* like the above writeToString, 
> since I don't think Xerces will ever maintain in memory whole textContents 
> for all the nodes.
> 
>     DOMImplementation::
> 
>     virtual bool  hasFeature(const XMLCh *feature,  const XMLCh *version) = 0;
> 
>     Non-const? The DOMDocument::getNormalizationFeature() is const...
> 
>     DOMRange::
> 
>     virtual const DOMNode* getCommonAncestorContainer() const = 0;
> 
>     Why is the returned node for once const?

I would hazard a guess that this did not compile to start with because 
this method calls a method that takes 2 const DOMNode* . The method can 
potentially return one of these parameters. 

Gareth


-- 
Gareth Reakes, Head of Product Development  
DecisionSoft Ltd.            http://www.decisionsoft.com
Office: +44 (0) 1865 203192



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