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 2002/10/04 08:59:28 UTC
cvs commit: xml-xalan/c/src/XSLT XResultTreeFrag.cpp XResultTreeFrag.hpp
dbertoni 2002/10/03 23:59:28
Modified: c/src/XSLT XResultTreeFrag.cpp XResultTreeFrag.hpp
Log:
Added new member function to determine length of string value.
Revision Changes Path
1.6 +21 -1 xml-xalan/c/src/XSLT/XResultTreeFrag.cpp
Index: XResultTreeFrag.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XResultTreeFrag.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XResultTreeFrag.cpp 12 Aug 2002 04:04:07 -0000 1.5
+++ XResultTreeFrag.cpp 4 Oct 2002 06:59:28 -0000 1.6
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -73,6 +73,7 @@
+#include <XPath/FormatterStringLengthCounter.hpp>
#include <XPath/NodeRefListBase.hpp>
#include <XPath/ResultTreeFragBase.hpp>
#include <XPath/XObjectTypeCallback.hpp>
@@ -206,6 +207,25 @@
else
{
DOMServices::getNodeData(*m_value, theBuffer);
+ }
+}
+
+
+
+double
+XResultTreeFrag::stringLength() const
+{
+ if (isEmpty(m_cachedStringValue) == false)
+ {
+ return length(m_cachedStringValue);
+ }
+ else
+ {
+ FormatterStringLengthCounter theCounter;
+
+ DOMServices::getNodeData(*m_value, theCounter, FormatterListener::characters);
+
+ return theCounter.getCount();
}
}
1.4 +3 -0 xml-xalan/c/src/XSLT/XResultTreeFrag.hpp
Index: XResultTreeFrag.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XResultTreeFrag.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XResultTreeFrag.hpp 12 Aug 2002 04:04:08 -0000 1.3
+++ XResultTreeFrag.hpp 4 Oct 2002 06:59:28 -0000 1.4
@@ -155,6 +155,9 @@
virtual void
str(XalanDOMString& theBuffer) const;
+ virtual double
+ stringLength() const;
+
virtual const ResultTreeFragBase&
rtree() const;
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org