dbertoni 2004/10/28 15:30:59
Modified: c/src/xalanc/XPath XBoolean.cpp XBoolean.hpp
XNodeSetBase.cpp XNodeSetBase.hpp XNull.cpp
XNull.hpp XNumberBase.cpp XNumberBase.hpp
XObject.cpp XObject.hpp XPathInit.cpp
XStringBase.cpp XStringBase.hpp XToken.cpp
XToken.hpp XUnknown.cpp XUnknown.hpp
Log:
Cleaned up mess with embedded string literals and unnecessary copies.
Revision Changes Path
1.5 +2 -2 xml-xalan/c/src/xalanc/XPath/XBoolean.cpp
Index: XBoolean.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XBoolean.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XBoolean.cpp 26 Feb 2004 22:40:34 -0000 1.4
+++ XBoolean.cpp 28 Oct 2004 22:30:59 -0000 1.5
@@ -71,10 +71,10 @@
-XalanDOMString
+const XalanDOMString&
XBoolean::getTypeString() const
{
- return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("#BOOLEAN"));
+ return s_booleanString;
}
1.5 +1 -1 xml-xalan/c/src/xalanc/XPath/XBoolean.hpp
Index: XBoolean.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XBoolean.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XBoolean.hpp 26 Feb 2004 22:40:34 -0000 1.4
+++ XBoolean.hpp 28 Oct 2004 22:30:59 -0000 1.5
@@ -59,7 +59,7 @@
#endif
clone(void* theAddress = 0) const;
- virtual XalanDOMString
+ virtual const XalanDOMString&
getTypeString() const;
virtual double
1.6 +2 -2 xml-xalan/c/src/xalanc/XPath/XNodeSetBase.cpp
Index: XNodeSetBase.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XNodeSetBase.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XNodeSetBase.cpp 26 Feb 2004 22:40:34 -0000 1.5
+++ XNodeSetBase.cpp 28 Oct 2004 22:30:59 -0000 1.6
@@ -71,10 +71,10 @@
-XalanDOMString
+const XalanDOMString&
XNodeSetBase::getTypeString() const
{
- return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("#NODESET"));
+ return s_nodesetString;
}
1.7 +1 -1 xml-xalan/c/src/xalanc/XPath/XNodeSetBase.hpp
Index: XNodeSetBase.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XNodeSetBase.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XNodeSetBase.hpp 26 Feb 2004 22:40:34 -0000 1.6
+++ XNodeSetBase.hpp 28 Oct 2004 22:30:59 -0000 1.7
@@ -58,7 +58,7 @@
#endif
clone(void* theAddress = 0) const = 0;
- virtual XalanDOMString
+ virtual const XalanDOMString&
getTypeString() const;
virtual double
1.4 +35 -3 xml-xalan/c/src/xalanc/XPath/XNull.cpp
Index: XNull.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XNull.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XNull.cpp 26 Feb 2004 22:40:34 -0000 1.3
+++ XNull.cpp 28 Oct 2004 22:30:59 -0000 1.4
@@ -26,6 +26,22 @@
+XalanDOMString XNull::s_nullString;
+
+
+static const XalanDOMChar s_null[] =
+{
+ XalanUnicode::charLessThanSign,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charGreaterThanSign,
+ 0
+};
+
+
+
XNull::XNull() :
XObject(eTypeNull)
{
@@ -65,10 +81,10 @@
-XalanDOMString
+const XalanDOMString&
XNull::getTypeString() const
{
- return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("#NULL"));
+ return s_nullString;
}
@@ -92,7 +108,7 @@
const XalanDOMString&
XNull::str() const
{
- return s_nullString;
+ return s_emptyString;
}
@@ -126,6 +142,22 @@
XNull::ProcessXObjectTypeCallback(XObjectTypeCallback&
theCallbackObject) const
{
theCallbackObject.Null(*this);
+}
+
+
+
+void
+XNull::initialize()
+{
+ s_nullString = s_null;
+}
+
+
+
+void
+XNull::terminate()
+{
+ releaseMemory(s_nullString);
}
1.5 +17 -2 xml-xalan/c/src/xalanc/XPath/XNull.hpp
Index: XNull.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XNull.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XNull.hpp 26 Feb 2004 22:40:34 -0000 1.4
+++ XNull.hpp 28 Oct 2004 22:30:59 -0000 1.5
@@ -39,6 +39,18 @@
typedef XObject ParentType;
/**
+ * Perform static initialization. See class XPathInit.
+ */
+ static void
+ initialize();
+
+ /**
+ * Perform static shut down. See class XPathInit.
+ */
+ static void
+ terminate();
+
+ /**
* Create an XNull.
*
*/
@@ -65,7 +77,7 @@
#endif
clone(void* theAddress = 0) const;
- virtual XalanDOMString
+ virtual const XalanDOMString&
getTypeString() const;
virtual double
@@ -97,8 +109,11 @@
private:
+ static XalanDOMString s_nullString;
+
// not implemented
- XNull& operator=(const XNull &);
+ XNull&
+ operator=(const XNull &);
};
1.5 +2 -2 xml-xalan/c/src/xalanc/XPath/XNumberBase.cpp
Index: XNumberBase.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XNumberBase.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XNumberBase.cpp 26 Feb 2004 22:40:34 -0000 1.4
+++ XNumberBase.cpp 28 Oct 2004 22:30:59 -0000 1.5
@@ -50,10 +50,10 @@
-XalanDOMString
+const XalanDOMString&
XNumberBase::getTypeString() const
{
- return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("#NUMBER"));
+ return s_numberString;
}
1.5 +1 -1 xml-xalan/c/src/xalanc/XPath/XNumberBase.hpp
Index: XNumberBase.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XNumberBase.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XNumberBase.hpp 26 Feb 2004 22:40:34 -0000 1.4
+++ XNumberBase.hpp 28 Oct 2004 22:30:59 -0000 1.5
@@ -49,7 +49,7 @@
// These methods are inherited from XObject ...
- virtual XalanDOMString
+ virtual const XalanDOMString&
getTypeString() const;
virtual double
1.9 +942 -816 xml-xalan/c/src/xalanc/XPath/XObject.cpp
Index: XObject.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XObject.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XObject.cpp 24 Aug 2004 14:03:15 -0000 1.8
+++ XObject.cpp 28 Oct 2004 22:30:59 -0000 1.9
@@ -24,6 +24,7 @@
#include <xalanc/PlatformSupport/DoubleSupport.hpp>
#include <xalanc/PlatformSupport/XalanMessageLoader.hpp>
+#include <xalanc/PlatformSupport/XalanUnicode.hpp>
@@ -40,20 +41,140 @@
XALAN_CPP_NAMESPACE_BEGIN
+XalanDOMString s_localBooleanString;
+XalanDOMString s_localFalseString;
+XalanDOMString s_localNodesetString;
+XalanDOMString s_localNumberString;
+XalanDOMString s_localResultTreeFragmentString;
+XalanDOMString s_localStringString;
+XalanDOMString s_localTrueString;
-XalanDOMString XObject::s_falseString;
+const XalanDOMString& XObject::s_booleanString =
+ s_localBooleanString;
-XalanDOMString XObject::s_trueString;
+const XalanDOMString& XObject::s_falseString =
+ s_localFalseString;
-const XalanDOMString XObject::s_nullString;
+const XalanDOMString& XObject::s_nodesetString =
+ s_localNodesetString;
+const XalanDOMString& XObject::s_numberString =
+ s_localNumberString;
+
+const XalanDOMString& XObject::s_resultTreeFragmentString =
+ s_localResultTreeFragmentString;
+
+const XalanDOMString& XObject::s_stringString =
+ s_localStringString;
+
+const XalanDOMString& XObject::s_trueString =
+ s_localTrueString;
+
+const XalanDOMString XObject::s_emptyString;
+
+
+static const XalanDOMChar s_boolean[] =
+{
+ XalanUnicode::charLetter_b,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_n,
+ 0
+};
+
+static const XalanDOMChar s_false[] =
+{
+ XalanUnicode::charLetter_f,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_e,
+ 0
+};
+
+static const XalanDOMChar s_number[] =
+{
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_b,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_r,
+ 0
+};
+
+static const XalanDOMChar s_nodeset[] =
+{
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_d,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charHyphenMinus,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+static const XalanDOMChar s_resultTreeFragment[] =
+{
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charSpace,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charSpace,
+ XalanUnicode::charLetter_f,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_g,
+ XalanUnicode::charLetter_m,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_t,
+ 0
+};
+
+static const XalanDOMChar s_string[] =
+{
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_g,
+ 0
+};
+
+static const XalanDOMChar s_true[] =
+{
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_e,
+ 0
+};
void
XObject::initialize()
{
- s_falseString = XALAN_STATIC_UCODE_STRING("false");
- s_trueString = XALAN_STATIC_UCODE_STRING("true");
+ s_localBooleanString = s_boolean;
+ s_localFalseString = s_false;
+ s_localNodesetString = s_nodeset;
+ s_localNumberString = s_number;
+ s_localResultTreeFragmentString = s_resultTreeFragment;
+ s_localStringString = s_string;
+ s_localTrueString = s_true;
}
@@ -61,23 +182,28 @@
void
XObject::terminate()
{
- releaseMemory(s_falseString);
- releaseMemory(s_trueString);
+ releaseMemory(s_localBooleanString);
+ releaseMemory(s_localFalseString);
+ releaseMemory(s_localNodesetString);
+ releaseMemory(s_localNumberString);
+ releaseMemory(s_localResultTreeFragmentString);
+ releaseMemory(s_localStringString);
+ releaseMemory(s_localTrueString);
}
-XObject::XObject(eObjectType theObjectType) :
- m_objectType(theObjectType),
- m_factory(0)
+XObject::XObject(eObjectType theObjectType) :
+ m_objectType(theObjectType),
+ m_factory(0)
{
}
-XObject::XObject(const XObject& source) :
- m_objectType(source.m_objectType),
- m_factory(0)
+XObject::XObject(const XObject& source) :
+ m_objectType(source.m_objectType),
+ m_factory(0)
{
}
@@ -92,7 +218,7 @@
XObject::eObjectType
XObject::getRealType() const
{
- return m_objectType;
+ return m_objectType;
}
@@ -106,35 +232,35 @@
double
XObject::number(
- XPathExecutionContext& executionContext,
- const XalanNode& theNode)
+ XPathExecutionContext& executionContext,
+ const XalanNode& theNode)
{
- XPathExecutionContext::GetAndReleaseCachedString
theGuard(executionContext);
+ XPathExecutionContext::GetAndReleaseCachedString
theGuard(executionContext);
- XalanDOMString& theString = theGuard.get();
+ XalanDOMString& theString = theGuard.get();
- XObject::string(theNode, theString);
+ XObject::string(theNode, theString);
- return XObject::number(theString);
+ return XObject::number(theString);
}
double
XObject::number(
- XPathExecutionContext& executionContext,
- const NodeRefListBase& theNodeList)
+ XPathExecutionContext& executionContext,
+ const NodeRefListBase& theNodeList)
{
- if (theNodeList.getLength() == 0)
- {
- return number(s_nullString);
- }
- else
- {
- assert(theNodeList.item(0) != 0);
+ if (theNodeList.getLength() == 0)
+ {
+ return number(s_emptyString);
+ }
+ else
+ {
+ assert(theNodeList.item(0) != 0);
- return number(executionContext, *theNodeList.item(0));
- }
+ return number(executionContext, *theNodeList.item(0));
+ }
}
@@ -142,10 +268,10 @@
void
XObject::dereferenced()
{
- if (m_factory != 0)
- {
- m_factory->returnObject(this);
- }
+ if (m_factory != 0)
+ {
+ m_factory->returnObject(this);
+ }
}
@@ -153,10 +279,10 @@
double
XObject::num() const
{
- throw XObjectInvalidConversionException(getTypeString(),
TranscodeFromLocalCodePage("number"));
+ throw XObjectInvalidConversionException(getTypeString(), s_numberString);
- // This is just a dummy value to satisfy the compiler.
- return 0.0;
+ // This is just a dummy value to satisfy the compiler.
+ return 0.0;
}
@@ -164,10 +290,10 @@
bool
XObject::boolean() const
{
- throw XObjectInvalidConversionException(getTypeString(),
TranscodeFromLocalCodePage("boolean"));
+ throw XObjectInvalidConversionException(getTypeString(),
s_booleanString);
- // This is just a dummy value to satisfy the compiler.
- return false;
+ // This is just a dummy value to satisfy the compiler.
+ return false;
}
@@ -175,28 +301,28 @@
const XalanDOMString&
XObject::str() const
{
- throw XObjectInvalidConversionException(getTypeString(),
TranscodeFromLocalCodePage("string"));
+ throw XObjectInvalidConversionException(getTypeString(), s_stringString);
- // This is just a dummy value to satisfy the compiler.
- return s_nullString;
+ // This is just a dummy value to satisfy the compiler.
+ return s_emptyString;
}
void
XObject::str(
- FormatterListener& /* formatterListener */,
- MemberFunctionPtr /* function */) const
+ FormatterListener& /* formatterListener */,
+ MemberFunctionPtr /* function */) const
{
- throw XObjectInvalidConversionException(getTypeString(),
TranscodeFromLocalCodePage("string"));
+ throw XObjectInvalidConversionException(getTypeString(), s_stringString);
}
void
-XObject::str(XalanDOMString& theBuffer) const
+XObject::str(XalanDOMString& theBuffer) const
{
- append(theBuffer, str());
+ append(theBuffer, str());
}
@@ -206,40 +332,40 @@
const XalanDocumentFragment&
XObject::rtree() const
{
- throw XObjectInvalidConversionException(getTypeString(),
TranscodeFromLocalCodePage("result tree fragment"));
+ throw XObjectInvalidConversionException(getTypeString(),
s_resultTreeFragmentString);
- // This is just a dummy value to satisfy the compiler.
+ // This is just a dummy value to satisfy the compiler.
#if defined(XALAN_OLD_STYLE_CASTS)
- return (const XalanDocumentFragment&)foo;
+ return (const XalanDocumentFragment&)foo;
#else
- return reinterpret_cast<const XalanDocumentFragment&>(foo);
+ return reinterpret_cast<const XalanDocumentFragment&>(foo);
#endif
}
-static const NodeRefList s_dummyList;
+static const NodeRefList s_dummyList;
const NodeRefListBase&
XObject::nodeset() const
{
- throw XObjectInvalidConversionException(getTypeString(),
TranscodeFromLocalCodePage("node set"));
+ throw XObjectInvalidConversionException(getTypeString(),
TranscodeFromLocalCodePage("node-set"));
- // error will throw, so this is just a dummy
- // value to satisfy the compiler.
- return s_dummyList;
+ // error will throw, so this is just a dummy
+ // value to satisfy the compiler.
+ return s_dummyList;
}
void
getStringFromNode(
- const XalanNode& theNode,
- XalanDOMString& theString)
+ const XalanNode& theNode,
+ XalanDOMString& theString)
{
- DOMServices::getNodeData(theNode, theString);
+ DOMServices::getNodeData(theNode, theString);
}
@@ -247,34 +373,34 @@
struct
getStringFromNodeFunction
{
- getStringFromNodeFunction(XPathExecutionContext&
executionContext) :
- m_executionContext(executionContext)
- {
- }
-
- const XalanDOMString
- operator()(const XalanNode& theNode) const
- {
- XPathExecutionContext::GetAndReleaseCachedString
theGuard(m_executionContext);
-
- XalanDOMString& theString = theGuard.get();
-
- getStringFromNode(theNode, theString);
-
- return theString;
- }
-
- void
- operator()(
- const XalanNode& theNode,
- XalanDOMString& theString) const
- {
- getStringFromNode(theNode, theString);
- }
+ getStringFromNodeFunction(XPathExecutionContext& executionContext) :
+ m_executionContext(executionContext)
+ {
+ }
+
+ const XalanDOMString
+ operator()(const XalanNode& theNode) const
+ {
+ XPathExecutionContext::GetAndReleaseCachedString
theGuard(m_executionContext);
+
+ XalanDOMString& theString = theGuard.get();
+
+ getStringFromNode(theNode, theString);
+
+ return theString;
+ }
+
+ void
+ operator()(
+ const XalanNode& theNode,
+ XalanDOMString& theString) const
+ {
+ getStringFromNode(theNode, theString);
+ }
private:
- XPathExecutionContext& m_executionContext;
+ XPathExecutionContext& m_executionContext;
};
@@ -282,46 +408,46 @@
struct
getNumberFromNodeFunction
{
- getNumberFromNodeFunction(XPathExecutionContext&
executionContext) :
- m_executionContext(executionContext)
- {
- }
-
- double
- operator()(const XalanNode& theNode) const
- {
- return getNumberFromNode(theNode);
- }
-
- void
- operator()(
- const XalanNode& theNode,
- double& theNumber) const
- {
- getNumberFromNode(theNode, theNumber);
- }
+ getNumberFromNodeFunction(XPathExecutionContext& executionContext) :
+ m_executionContext(executionContext)
+ {
+ }
+
+ double
+ operator()(const XalanNode& theNode) const
+ {
+ return getNumberFromNode(theNode);
+ }
+
+ void
+ operator()(
+ const XalanNode& theNode,
+ double& theNumber) const
+ {
+ getNumberFromNode(theNode, theNumber);
+ }
private:
- double
- getNumberFromNode(const XalanNode& theNode) const
- {
- XPathExecutionContext::GetAndReleaseCachedString
theString(m_executionContext);
-
- getStringFromNode(theNode, theString.get());
-
- return DoubleSupport::toDouble(theString.get());
- }
-
- void
- getNumberFromNode(
- const XalanNode& theNode,
- double& theNumber) const
- {
- theNumber = getNumberFromNode(theNode);
- }
+ double
+ getNumberFromNode(const XalanNode& theNode) const
+ {
+ XPathExecutionContext::GetAndReleaseCachedString
theString(m_executionContext);
+
+ getStringFromNode(theNode, theString.get());
+
+ return DoubleSupport::toDouble(theString.get());
+ }
+
+ void
+ getNumberFromNode(
+ const XalanNode& theNode,
+ double& theNumber) const
+ {
+ theNumber = getNumberFromNode(theNode);
+ }
- XPathExecutionContext& m_executionContext;
+ XPathExecutionContext& m_executionContext;
};
@@ -329,29 +455,29 @@
struct
equalsDOMString
{
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DOMStringEqualsFunction()(theLHS, theRHS);
- }
-
- bool
- operator()(
- const XObject& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DOMStringEqualsFunction()(theLHS.str(), theRHS);
- }
-
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XObject& theRHS) const
- {
- return DOMStringEqualsFunction()(theLHS, theRHS.str());
- }
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DOMStringEqualsFunction()(theLHS, theRHS);
+ }
+
+ bool
+ operator()(
+ const XObject& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DOMStringEqualsFunction()(theLHS.str(), theRHS);
+ }
+
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XObject& theRHS) const
+ {
+ return DOMStringEqualsFunction()(theLHS, theRHS.str());
+ }
};
@@ -359,29 +485,29 @@
struct
notEqualsDOMString
{
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DOMStringNotEqualsFunction()(theLHS, theRHS);
- }
-
- bool
- operator()(
- const XObject& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DOMStringNotEqualsFunction()(theLHS.str(), theRHS);
- }
-
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XObject& theRHS) const
- {
- return DOMStringNotEqualsFunction()(theLHS, theRHS.str());
- }
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DOMStringNotEqualsFunction()(theLHS, theRHS);
+ }
+
+ bool
+ operator()(
+ const XObject& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DOMStringNotEqualsFunction()(theLHS.str(), theRHS);
+ }
+
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XObject& theRHS) const
+ {
+ return DOMStringNotEqualsFunction()(theLHS, theRHS.str());
+ }
};
@@ -389,35 +515,35 @@
struct
lessThanDOMString
{
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DoubleSupport::lessThan(
- DOMStringToDouble(theLHS),
- DOMStringToDouble(theRHS));
- }
-
- bool
- operator()(
- const XObject& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DoubleSupport::lessThan(
- theLHS.num(),
- DOMStringToDouble(theRHS));
- }
-
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XObject& theRHS) const
- {
- return DoubleSupport::lessThan(
- DOMStringToDouble(theLHS),
- theRHS.num());
- }
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DoubleSupport::lessThan(
+ DOMStringToDouble(theLHS),
+ DOMStringToDouble(theRHS));
+ }
+
+ bool
+ operator()(
+ const XObject& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DoubleSupport::lessThan(
+ theLHS.num(),
+ DOMStringToDouble(theRHS));
+ }
+
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XObject& theRHS) const
+ {
+ return DoubleSupport::lessThan(
+ DOMStringToDouble(theLHS),
+ theRHS.num());
+ }
};
@@ -425,35 +551,35 @@
struct
lessThanOrEqualDOMString
{
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DoubleSupport::lessThanOrEqual(
- DOMStringToDouble(theLHS),
- DOMStringToDouble(theRHS));
- }
-
- bool
- operator()(
- const XObject& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DoubleSupport::lessThanOrEqual(
- theLHS.num(),
- DOMStringToDouble(theRHS));
- }
-
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XObject& theRHS) const
- {
- return DoubleSupport::lessThanOrEqual(
- DOMStringToDouble(theLHS),
- theRHS.num());
- }
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DoubleSupport::lessThanOrEqual(
+ DOMStringToDouble(theLHS),
+ DOMStringToDouble(theRHS));
+ }
+
+ bool
+ operator()(
+ const XObject& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DoubleSupport::lessThanOrEqual(
+ theLHS.num(),
+ DOMStringToDouble(theRHS));
+ }
+
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XObject& theRHS) const
+ {
+ return DoubleSupport::lessThanOrEqual(
+ DOMStringToDouble(theLHS),
+ theRHS.num());
+ }
};
@@ -461,35 +587,35 @@
struct
greaterThanDOMString
{
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DoubleSupport::greaterThan(
- DOMStringToDouble(theLHS),
- DOMStringToDouble(theRHS));
- }
-
- bool
- operator()(
- const XObject& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DoubleSupport::greaterThan(
- theLHS.num(),
- DOMStringToDouble(theRHS));
- }
-
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XObject& theRHS) const
- {
- return DoubleSupport::greaterThan(
- DOMStringToDouble(theLHS),
- theRHS.num());
- }
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DoubleSupport::greaterThan(
+ DOMStringToDouble(theLHS),
+ DOMStringToDouble(theRHS));
+ }
+
+ bool
+ operator()(
+ const XObject& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DoubleSupport::greaterThan(
+ theLHS.num(),
+ DOMStringToDouble(theRHS));
+ }
+
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XObject& theRHS) const
+ {
+ return DoubleSupport::greaterThan(
+ DOMStringToDouble(theLHS),
+ theRHS.num());
+ }
};
@@ -497,35 +623,35 @@
struct
greaterThanOrEqualDOMString
{
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DoubleSupport::greaterThanOrEqual(
- DOMStringToDouble(theLHS),
- DOMStringToDouble(theRHS));
- }
-
- bool
- operator()(
- const XObject& theLHS,
- const XalanDOMString& theRHS) const
- {
- return DoubleSupport::greaterThanOrEqual(
- theLHS.num(),
- DOMStringToDouble(theRHS));
- }
-
- bool
- operator()(
- const XalanDOMString& theLHS,
- const XObject& theRHS) const
- {
- return DoubleSupport::greaterThanOrEqual(
- DOMStringToDouble(theLHS),
- theRHS.num());
- }
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DoubleSupport::greaterThanOrEqual(
+ DOMStringToDouble(theLHS),
+ DOMStringToDouble(theRHS));
+ }
+
+ bool
+ operator()(
+ const XObject& theLHS,
+ const XalanDOMString& theRHS) const
+ {
+ return DoubleSupport::greaterThanOrEqual(
+ theLHS.num(),
+ DOMStringToDouble(theRHS));
+ }
+
+ bool
+ operator()(
+ const XalanDOMString& theLHS,
+ const XObject& theRHS) const
+ {
+ return DoubleSupport::greaterThanOrEqual(
+ DOMStringToDouble(theLHS),
+ theRHS.num());
+ }
};
@@ -533,66 +659,66 @@
template<class CompareFunction, class TypeFunction>
bool
doCompareNodeSets(
- const NodeRefListBase& theLHSNodeSet,
- const NodeRefListBase& theRHSNodeSet,
- const TypeFunction& theTypeFunction,
- const CompareFunction& theCompareFunction,
- XPathExecutionContext& executionContext)
-{
- // From http://www.w3.org/TR/xpath:
- // If both objects to be compared are node-sets, then the comparison
- // will be true if and only if there is a node in the first node-set
- // and a node in the second node-set such that the result of performing
- // the comparison on the string-values of the two nodes is true.
-
- // Note this little gem from the draft:
- // NOTE: If $x is bound to a node-set, then $x="foo"
- // does not mean the same as not($x!="foo"): the former
- // is true if and only if some node in $x has the string-value
- // foo; the latter is true if and only if all nodes in $x have
- // the string-value foo.
- bool theResult = false;
-
- const NodeRefListBase::size_type len1 =
theLHSNodeSet.getLength();
-
- if (len1 > 0)
- {
- const NodeRefListBase::size_type len2 =
theRHSNodeSet.getLength();
-
- if (len2 > 0)
- {
- XPathExecutionContext::GetAndReleaseCachedString
s1(executionContext);
-
- XPathExecutionContext::GetAndReleaseCachedString
s2(executionContext);
-
- for(NodeRefListBase::size_type i = 0; i < len1 &&
theResult == false; i++)
- {
- const XalanNode* const theLHSNode =
theLHSNodeSet.item(i);
- assert(theLHSNode != 0);
-
- theTypeFunction(*theLHSNode, s1.get());
-
- for(NodeRefListBase::size_type k = 0; k < len2
&& theResult == false; k++)
- {
- const XalanNode* const theRHSNode =
theRHSNodeSet.item(k);
- assert(theRHSNode != 0);
-
- theTypeFunction(*theRHSNode, s2.get());
-
- if(theCompareFunction(s1.get(),
s2.get()) == true)
- {
- theResult = true;
- }
-
- clear(s2.get());
- }
-
- clear(s1.get());
- }
- }
- }
+ const NodeRefListBase& theLHSNodeSet,
+ const NodeRefListBase& theRHSNodeSet,
+ const TypeFunction& theTypeFunction,
+ const CompareFunction& theCompareFunction,
+ XPathExecutionContext& executionContext)
+{
+ // From http://www.w3.org/TR/xpath:
+ // If both objects to be compared are node-sets, then the comparison
+ // will be true if and only if there is a node in the first node-set
+ // and a node in the second node-set such that the result of performing
+ // the comparison on the string-values of the two nodes is true.
+
+ // Note this little gem from the draft:
+ // NOTE: If $x is bound to a node-set, then $x="foo"
+ // does not mean the same as not($x!="foo"): the former
+ // is true if and only if some node in $x has the string-value
+ // foo; the latter is true if and only if all nodes in $x have
+ // the string-value foo.
+ bool theResult = false;
+
+ const NodeRefListBase::size_type len1 = theLHSNodeSet.getLength();
+
+ if (len1 > 0)
+ {
+ const NodeRefListBase::size_type len2 = theRHSNodeSet.getLength();
+
+ if (len2 > 0)
+ {
+ XPathExecutionContext::GetAndReleaseCachedString
s1(executionContext);
+
+ XPathExecutionContext::GetAndReleaseCachedString
s2(executionContext);
+
+ for(NodeRefListBase::size_type i = 0; i < len1 && theResult ==
false; i++)
+ {
+ const XalanNode* const theLHSNode = theLHSNodeSet.item(i);
+ assert(theLHSNode != 0);
+
+ theTypeFunction(*theLHSNode, s1.get());
+
+ for(NodeRefListBase::size_type k = 0; k < len2 && theResult
== false; k++)
+ {
+ const XalanNode* const theRHSNode =
theRHSNodeSet.item(k);
+ assert(theRHSNode != 0);
+
+ theTypeFunction(*theRHSNode, s2.get());
+
+ if(theCompareFunction(s1.get(), s2.get()) == true)
+ {
+ theResult = true;
+ }
+
+ clear(s2.get());
+ }
+
+ clear(s1.get());
+ }
+ }
+ }
- return theResult;
+ return theResult;
}
@@ -600,36 +726,36 @@
template<class CompareFunction, class StringFunction>
bool
doCompareString(
- const NodeRefListBase& theLHSNodeSet,
- const StringFunction& theStringFunction,
- const XObject& theRHS,
- const CompareFunction& theCompareFunction,
- XPathExecutionContext& executionContext)
+ const NodeRefListBase& theLHSNodeSet,
+ const StringFunction& theStringFunction,
+ const XObject& theRHS,
+ const CompareFunction& theCompareFunction,
+ XPathExecutionContext& executionContext)
{
- bool theResult = false;
+ bool theResult = false;
- const NodeRefListBase::size_type len1 =
theLHSNodeSet.getLength();
+ const NodeRefListBase::size_type len1 = theLHSNodeSet.getLength();
- XPathExecutionContext::GetAndReleaseCachedString
theGuard(executionContext);
+ XPathExecutionContext::GetAndReleaseCachedString
theGuard(executionContext);
- XalanDOMString& theLHS = theGuard.get();
+ XalanDOMString& theLHS = theGuard.get();
- for(NodeRefListBase::size_type i = 0; i < len1 && theResult == false;
i++)
- {
- const XalanNode* const theLHSNode = theLHSNodeSet.item(i);
- assert(theLHSNode != 0);
+ for(NodeRefListBase::size_type i = 0; i < len1 && theResult == false;
i++)
+ {
+ const XalanNode* const theLHSNode = theLHSNodeSet.item(i);
+ assert(theLHSNode != 0);
- theStringFunction(*theLHSNode, theLHS);
+ theStringFunction(*theLHSNode, theLHS);
- if (theCompareFunction(theLHS, theRHS) == true)
- {
- theResult = true;
- }
+ if (theCompareFunction(theLHS, theRHS) == true)
+ {
+ theResult = true;
+ }
- clear(theLHS);
- }
+ clear(theLHS);
+ }
- return theResult;
+ return theResult;
}
@@ -637,29 +763,29 @@
template<class CompareFunction, class NumberFunction>
bool
doCompareNumber(
- const NodeRefListBase& theLHSNodeSet,
- const NumberFunction& theNumberFunction,
- const double theRHS,
- const CompareFunction& theCompareFunction)
+ const NodeRefListBase& theLHSNodeSet,
+ const NumberFunction& theNumberFunction,
+ const double theRHS,
+ const CompareFunction& theCompareFunction)
{
- bool theResult = false;
+ bool theResult = false;
- const NodeRefListBase::size_type len1 =
theLHSNodeSet.getLength();
+ const NodeRefListBase::size_type len1 = theLHSNodeSet.getLength();
- for(NodeRefListBase::size_type i = 0; i < len1 && theResult == false;
i++)
- {
- const XalanNode* const theLHSNode = theLHSNodeSet.item(i);
- assert(theLHSNode != 0);
+ for(NodeRefListBase::size_type i = 0; i < len1 && theResult == false;
i++)
+ {
+ const XalanNode* const theLHSNode = theLHSNodeSet.item(i);
+ assert(theLHSNode != 0);
- const double theLHS = theNumberFunction(*theLHSNode);
+ const double theLHS = theNumberFunction(*theLHSNode);
- if (theCompareFunction(theLHS, theRHS) == true)
- {
- theResult = true;
- }
- }
+ if (theCompareFunction(theLHS, theRHS) == true)
+ {
+ theResult = true;
+ }
+ }
- return theResult;
+ return theResult;
}
@@ -667,480 +793,480 @@
template<class StringCompareFunction, class NumberCompareFunction>
bool
compareNodeSets(
- const XObject& theLHS,
- const XObject& theRHS,
- XObject::eObjectType theRHSType,
- const StringCompareFunction&
theStringCompareFunction,
- const NumberCompareFunction&
theNumberCompareFunction,
- XPathExecutionContext&
executionContext)
-{
- bool theResult = false;
-
- if(theRHSType == XObject::eTypeNodeSet)
- {
- // Compare as node sets...
- theResult = doCompareNodeSets(
- theLHS.nodeset(),
- theRHS.nodeset(),
- getStringFromNodeFunction(executionContext),
- theStringCompareFunction,
- executionContext);
-
- }
- else if(theRHSType == XObject::eTypeBoolean)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a
boolean,
- // then the comparison will be true if and only if the result of
- // performing the comparison on the boolean and on the result of
- // converting the node-set to a boolean using the boolean function
- // is true.
- const double num1 = theLHS.boolean() == true ? 1.0 : 0.0;
-
- theResult = theNumberCompareFunction(num1, theRHS.num());
- }
- else if(theRHSType == XObject::eTypeNumber)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is
a number,
- // then the comparison will be true if and only if there is a
- // node in the node-set such that the result of performing the
- // comparison on the number to be compared and on the result of
- // converting the string-value of that node to a number using
- // the number function is true.
-
- theResult = doCompareNumber(
- theLHS.nodeset(),
- getNumberFromNodeFunction(executionContext),
- theRHS.num(),
- theNumberCompareFunction);
- }
- else if(theRHSType == XObject::eTypeResultTreeFrag)
- {
- // hmmm...
- const double theRHSNumber = theRHS.num();
-
- if(DoubleSupport::isNaN(theRHSNumber) == false)
- {
- // Compare as number...
- theResult = doCompareNumber(
- theLHS.nodeset(),
-
getNumberFromNodeFunction(executionContext),
- theRHS.num(),
- theNumberCompareFunction);
- }
- else
- {
- // Compare as string...
- theResult = doCompareString(
- theLHS.nodeset(),
-
getStringFromNodeFunction(executionContext),
- theRHS,
- theStringCompareFunction,
- executionContext);
- }
- }
- else if(theRHSType == XObject::eTypeString)
- {
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is
a
- // string, then the comparison will be true if and only if
there
- // is a node in the node-set such that the result of performing
- // the comparison on the string-value of the node and the other
- // string is true.
- theResult = doCompareString(
- theLHS.nodeset(),
- getStringFromNodeFunction(executionContext),
- theRHS,
- theStringCompareFunction,
- executionContext);
- }
- else if (theRHSType != XObject::eTypeUnknown)
- {
- assert(false);
- }
+ const XObject& theLHS,
+ const XObject& theRHS,
+ XObject::eObjectType theRHSType,
+ const StringCompareFunction& theStringCompareFunction,
+ const NumberCompareFunction& theNumberCompareFunction,
+ XPathExecutionContext& executionContext)
+{
+ bool theResult = false;
+
+ if(theRHSType == XObject::eTypeNodeSet)
+ {
+ // Compare as node sets...
+ theResult = doCompareNodeSets(
+ theLHS.nodeset(),
+ theRHS.nodeset(),
+ getStringFromNodeFunction(executionContext),
+ theStringCompareFunction,
+ executionContext);
+
+ }
+ else if(theRHSType == XObject::eTypeBoolean)
+ {
+ // From http://www.w3.org/TR/xpath:
+ // If one object to be compared is a node-set and the other is a
boolean,
+ // then the comparison will be true if and only if the result of
+ // performing the comparison on the boolean and on the result of
+ // converting the node-set to a boolean using the boolean function
+ // is true.
+ const double num1 = theLHS.boolean() == true ? 1.0 : 0.0;
+
+ theResult = theNumberCompareFunction(num1, theRHS.num());
+ }
+ else if(theRHSType == XObject::eTypeNumber)
+ {
+ // From http://www.w3.org/TR/xpath:
+ // If one object to be compared is a node-set and the other is a
number,
+ // then the comparison will be true if and only if there is a
+ // node in the node-set such that the result of performing the
+ // comparison on the number to be compared and on the result of
+ // converting the string-value of that node to a number using
+ // the number function is true.
+
+ theResult = doCompareNumber(
+ theLHS.nodeset(),
+ getNumberFromNodeFunction(executionContext),
+ theRHS.num(),
+ theNumberCompareFunction);
+ }
+ else if(theRHSType == XObject::eTypeResultTreeFrag)
+ {
+ // hmmm...
+ const double theRHSNumber = theRHS.num();
+
+ if(DoubleSupport::isNaN(theRHSNumber) == false)
+ {
+ // Compare as number...
+ theResult = doCompareNumber(
+ theLHS.nodeset(),
+ getNumberFromNodeFunction(executionContext),
+ theRHS.num(),
+ theNumberCompareFunction);
+ }
+ else
+ {
+ // Compare as string...
+ theResult = doCompareString(
+ theLHS.nodeset(),
+ getStringFromNodeFunction(executionContext),
+ theRHS,
+ theStringCompareFunction,
+ executionContext);
+ }
+ }
+ else if(theRHSType == XObject::eTypeString)
+ {
+ // From http://www.w3.org/TR/xpath:
+ // If one object to be compared is a node-set and the other is a
+ // string, then the comparison will be true if and only if there
+ // is a node in the node-set such that the result of performing
+ // the comparison on the string-value of the node and the other
+ // string is true.
+ theResult = doCompareString(
+ theLHS.nodeset(),
+ getStringFromNodeFunction(executionContext),
+ theRHS,
+ theStringCompareFunction,
+ executionContext);
+ }
+ else if (theRHSType != XObject::eTypeUnknown)
+ {
+ assert(false);
+ }
- return theResult;
+ return theResult;
}
inline bool
equalNodeSet(
- const XObject& theLHS,
- const XObject& theRHS,
- XObject::eObjectType theRHSType,
- XPathExecutionContext& executionContext)
-{
- return compareNodeSets(
- theLHS,
- theRHS,
- theRHSType,
- equalsDOMString(),
- DoubleSupport::equalFunction(),
- executionContext);
+ const XObject& theLHS,
+ const XObject& theRHS,
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
+{
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ equalsDOMString(),
+ DoubleSupport::equalFunction(),
+ executionContext);
}
inline bool
notEqualNodeSet(
- const XObject& theLHS,
- const XObject& theRHS,
- XObject::eObjectType theRHSType,
- XPathExecutionContext& executionContext)
-{
- return compareNodeSets(
- theLHS,
- theRHS,
- theRHSType,
- notEqualsDOMString(),
- DoubleSupport::notEqualFunction(),
- executionContext);
+ const XObject& theLHS,
+ const XObject& theRHS,
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
+{
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ notEqualsDOMString(),
+ DoubleSupport::notEqualFunction(),
+ executionContext);
}
inline bool
lessThanNodeSet(
- const XObject& theLHS,
- const XObject& theRHS,
- XObject::eObjectType theRHSType,
- XPathExecutionContext& executionContext)
-{
- return compareNodeSets(
- theLHS,
- theRHS,
- theRHSType,
- lessThanDOMString(),
- DoubleSupport::lessThanFunction(),
- executionContext);
+ const XObject& theLHS,
+ const XObject& theRHS,
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
+{
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ lessThanDOMString(),
+ DoubleSupport::lessThanFunction(),
+ executionContext);
}
inline bool
lessThanOrEqualNodeSet(
- const XObject& theLHS,
- const XObject& theRHS,
- XObject::eObjectType theRHSType,
- XPathExecutionContext& executionContext)
-{
- return compareNodeSets(
- theLHS,
- theRHS,
- theRHSType,
- lessThanOrEqualDOMString(),
- DoubleSupport::lessThanOrEqualFunction(),
- executionContext);
+ const XObject& theLHS,
+ const XObject& theRHS,
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
+{
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ lessThanOrEqualDOMString(),
+ DoubleSupport::lessThanOrEqualFunction(),
+ executionContext);
}
inline bool
greaterThanNodeSet(
- const XObject& theLHS,
- const XObject& theRHS,
- XObject::eObjectType theRHSType,
- XPathExecutionContext& executionContext)
-{
- return compareNodeSets(
- theLHS,
- theRHS,
- theRHSType,
- greaterThanDOMString(),
- DoubleSupport::greaterThanFunction(),
- executionContext);
+ const XObject& theLHS,
+ const XObject& theRHS,
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
+{
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ greaterThanDOMString(),
+ DoubleSupport::greaterThanFunction(),
+ executionContext);
}
inline bool
greaterThanOrEqualNodeSet(
- const XObject& theLHS,
- const XObject& theRHS,
- XObject::eObjectType theRHSType,
- XPathExecutionContext& executionContext)
-{
- return compareNodeSets(
- theLHS,
- theRHS,
- theRHSType,
- greaterThanOrEqualDOMString(),
- DoubleSupport::greaterThanOrEqualFunction(),
- executionContext);
+ const XObject& theLHS,
+ const XObject& theRHS,
+ XObject::eObjectType theRHSType,
+ XPathExecutionContext& executionContext)
+{
+ return compareNodeSets(
+ theLHS,
+ theRHS,
+ theRHSType,
+ greaterThanOrEqualDOMString(),
+ DoubleSupport::greaterThanOrEqualFunction(),
+ executionContext);
}
bool
XObject::equals(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
- if (this == &theRHS)
- {
- return true;
- }
- else
- {
- const eObjectType theLHSType = getType();
-
- if (theLHSType == eTypeUnknown)
- {
- return this == &theRHS ? true : false;
- }
- else if (theLHSType == eTypeNull)
- {
- return theRHS.getType() == eTypeNull ? true : false;
- }
- else if (theLHSType == eTypeNodeSet)
- {
- return equalNodeSet(*this, theRHS, theRHS.getType(),
executionContext);
- }
- else
- {
- const eObjectType theRHSType = theRHS.getType();
-
- if (theRHSType == eTypeNodeSet)
- {
- return equalNodeSet(theRHS, *this, theLHSType,
executionContext);
- }
- else
- {
- if (theLHSType == eTypeBoolean || theRHSType ==
eTypeBoolean)
- {
- return boolean() == theRHS.boolean();
- }
- else if (theLHSType == eTypeNumber ||
theRHSType == eTypeNumber)
- {
- return DoubleSupport::equal(num(),
theRHS.num());
- }
- else
- {
- return str() == theRHS.str();
- }
- }
- }
- }
+ if (this == &theRHS)
+ {
+ return true;
+ }
+ else
+ {
+ const eObjectType theLHSType = getType();
+
+ if (theLHSType == eTypeUnknown)
+ {
+ return this == &theRHS ? true : false;
+ }
+ else if (theLHSType == eTypeNull)
+ {
+ return theRHS.getType() == eTypeNull ? true : false;
+ }
+ else if (theLHSType == eTypeNodeSet)
+ {
+ return equalNodeSet(*this, theRHS, theRHS.getType(),
executionContext);
+ }
+ else
+ {
+ const eObjectType theRHSType = theRHS.getType();
+
+ if (theRHSType == eTypeNodeSet)
+ {
+ return equalNodeSet(theRHS, *this, theLHSType,
executionContext);
+ }
+ else
+ {
+ if (theLHSType == eTypeBoolean || theRHSType == eTypeBoolean)
+ {
+ return boolean() == theRHS.boolean();
+ }
+ else if (theLHSType == eTypeNumber || theRHSType ==
eTypeNumber)
+ {
+ return DoubleSupport::equal(num(), theRHS.num());
+ }
+ else
+ {
+ return str() == theRHS.str();
+ }
+ }
+ }
+ }
}
bool
XObject::notEquals(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
- if (this == &theRHS)
- {
- return false;
- }
- else
- {
- const eObjectType theLHSType = getType();
-
- if (theLHSType == eTypeUnknown)
- {
- return this == &theRHS ? false : true;
- }
- else if (theLHSType == eTypeNull)
- {
- return theRHS.getType() == eTypeNull ? false : true;
- }
- else if (theLHSType == eTypeNodeSet)
- {
- return notEqualNodeSet(*this, theRHS, theRHS.getType(),
executionContext);
- }
- else
- {
- const eObjectType theRHSType = theRHS.getType();
-
- if (theRHSType == eTypeNodeSet)
- {
- return notEqualNodeSet(theRHS, *this,
theLHSType, executionContext);
- }
- else
- {
- if (theLHSType == eTypeBoolean || theRHSType ==
eTypeBoolean)
- {
- return boolean() != theRHS.boolean();
- }
- else if (theLHSType == eTypeNumber ||
theRHSType == eTypeNumber)
- {
- return DoubleSupport::notEqual(num(),
theRHS.num());
- }
- else
- {
- return str() != theRHS.str();
- }
- }
- }
- }
+ if (this == &theRHS)
+ {
+ return false;
+ }
+ else
+ {
+ const eObjectType theLHSType = getType();
+
+ if (theLHSType == eTypeUnknown)
+ {
+ return this == &theRHS ? false : true;
+ }
+ else if (theLHSType == eTypeNull)
+ {
+ return theRHS.getType() == eTypeNull ? false : true;
+ }
+ else if (theLHSType == eTypeNodeSet)
+ {
+ return notEqualNodeSet(*this, theRHS, theRHS.getType(),
executionContext);
+ }
+ else
+ {
+ const eObjectType theRHSType = theRHS.getType();
+
+ if (theRHSType == eTypeNodeSet)
+ {
+ return notEqualNodeSet(theRHS, *this, theLHSType,
executionContext);
+ }
+ else
+ {
+ if (theLHSType == eTypeBoolean || theRHSType == eTypeBoolean)
+ {
+ return boolean() != theRHS.boolean();
+ }
+ else if (theLHSType == eTypeNumber || theRHSType ==
eTypeNumber)
+ {
+ return DoubleSupport::notEqual(num(), theRHS.num());
+ }
+ else
+ {
+ return str() != theRHS.str();
+ }
+ }
+ }
+ }
}
bool
XObject::lessThan(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
- if (this == &theRHS)
- {
- return false;
- }
- else
- {
- const eObjectType theLHSType = getType();
-
- if (theLHSType == eTypeNull || theLHSType == eTypeUnknown)
- {
- return false;
- }
- else if (theLHSType == eTypeNodeSet)
- {
- return lessThanNodeSet(*this, theRHS, theRHS.getType(),
executionContext);
- }
- else if (theRHS.getType() == eTypeNodeSet)
- {
- return greaterThanNodeSet(theRHS, *this, theLHSType,
executionContext);
- }
- else
- {
- return DoubleSupport::lessThan(num(), theRHS.num());
- }
- }
+ if (this == &theRHS)
+ {
+ return false;
+ }
+ else
+ {
+ const eObjectType theLHSType = getType();
+
+ if (theLHSType == eTypeNull || theLHSType == eTypeUnknown)
+ {
+ return false;
+ }
+ else if (theLHSType == eTypeNodeSet)
+ {
+ return lessThanNodeSet(*this, theRHS, theRHS.getType(),
executionContext);
+ }
+ else if (theRHS.getType() == eTypeNodeSet)
+ {
+ return greaterThanNodeSet(theRHS, *this, theLHSType,
executionContext);
+ }
+ else
+ {
+ return DoubleSupport::lessThan(num(), theRHS.num());
+ }
+ }
}
bool
XObject::lessThanOrEquals(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
- if (this == &theRHS)
- {
- return false;
- }
- else
- {
- const eObjectType theLHSType = getType();
-
- if (theLHSType == eTypeNull || theLHSType == eTypeUnknown)
- {
- return false;
- }
- else if (theLHSType == eTypeNodeSet)
- {
- return lessThanOrEqualNodeSet(*this, theRHS,
theRHS.getType(), executionContext);
- }
- else if (theRHS.getType() == eTypeNodeSet)
- {
- return greaterThanOrEqualNodeSet(theRHS, *this,
theLHSType, executionContext);
- }
- else
- {
- return DoubleSupport::lessThanOrEqual(num(),
theRHS.num());
- }
- }
+ if (this == &theRHS)
+ {
+ return false;
+ }
+ else
+ {
+ const eObjectType theLHSType = getType();
+
+ if (theLHSType == eTypeNull || theLHSType == eTypeUnknown)
+ {
+ return false;
+ }
+ else if (theLHSType == eTypeNodeSet)
+ {
+ return lessThanOrEqualNodeSet(*this, theRHS, theRHS.getType(),
executionContext);
+ }
+ else if (theRHS.getType() == eTypeNodeSet)
+ {
+ return greaterThanOrEqualNodeSet(theRHS, *this, theLHSType,
executionContext);
+ }
+ else
+ {
+ return DoubleSupport::lessThanOrEqual(num(), theRHS.num());
+ }
+ }
}
bool
XObject::greaterThan(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
- if (this == &theRHS)
- {
- return false;
- }
- else
- {
- const eObjectType theLHSType = getType();
-
- if (theLHSType == eTypeNull || theLHSType == eTypeUnknown)
- {
- return false;
- }
- else if (theLHSType == eTypeNodeSet)
- {
- return greaterThanNodeSet(*this, theRHS,
theRHS.getType(), executionContext);
- }
- else if (theRHS.getType() == eTypeNodeSet)
- {
- return lessThanNodeSet(theRHS, *this, theLHSType,
executionContext);
- }
- else
- {
- return DoubleSupport::greaterThan(num(), theRHS.num());
- }
- }
+ if (this == &theRHS)
+ {
+ return false;
+ }
+ else
+ {
+ const eObjectType theLHSType = getType();
+
+ if (theLHSType == eTypeNull || theLHSType == eTypeUnknown)
+ {
+ return false;
+ }
+ else if (theLHSType == eTypeNodeSet)
+ {
+ return greaterThanNodeSet(*this, theRHS, theRHS.getType(),
executionContext);
+ }
+ else if (theRHS.getType() == eTypeNodeSet)
+ {
+ return lessThanNodeSet(theRHS, *this, theLHSType,
executionContext);
+ }
+ else
+ {
+ return DoubleSupport::greaterThan(num(), theRHS.num());
+ }
+ }
}
bool
XObject::greaterThanOrEquals(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const
{
- if (this == &theRHS)
- {
- return false;
- }
- else
- {
- const eObjectType theLHSType = getType();
-
- if (theLHSType == eTypeNull || theLHSType == eTypeUnknown)
- {
- return false;
- }
- else if (theLHSType == eTypeNodeSet)
- {
- return greaterThanOrEqualNodeSet(*this, theRHS,
theRHS.getType(), executionContext);
- }
- else if (theRHS.getType() == eTypeNodeSet)
- {
- return lessThanOrEqualNodeSet(theRHS, *this,
theLHSType, executionContext);
- }
- else
- {
- return DoubleSupport::greaterThanOrEqual(num(),
theRHS.num());
- }
- }
+ if (this == &theRHS)
+ {
+ return false;
+ }
+ else
+ {
+ const eObjectType theLHSType = getType();
+
+ if (theLHSType == eTypeNull || theLHSType == eTypeUnknown)
+ {
+ return false;
+ }
+ else if (theLHSType == eTypeNodeSet)
+ {
+ return greaterThanOrEqualNodeSet(*this, theRHS,
theRHS.getType(), executionContext);
+ }
+ else if (theRHS.getType() == eTypeNodeSet)
+ {
+ return lessThanOrEqualNodeSet(theRHS, *this, theLHSType,
executionContext);
+ }
+ else
+ {
+ return DoubleSupport::greaterThanOrEqual(num(), theRHS.num());
+ }
+ }
}
-const XalanDOMChar XObject::XObjectException::m_type[] =
-{
- XalanUnicode::charLetter_X,
- XalanUnicode::charLetter_O,
- XalanUnicode::charLetter_b,
- XalanUnicode::charLetter_j,
- XalanUnicode::charLetter_e,
- XalanUnicode::charLetter_c,
- XalanUnicode::charLetter_t,
- XalanUnicode::charLetter_E,
- XalanUnicode::charLetter_x,
- XalanUnicode::charLetter_c,
- XalanUnicode::charLetter_e,
- XalanUnicode::charLetter_p,
- XalanUnicode::charLetter_t,
- XalanUnicode::charLetter_i,
- XalanUnicode::charLetter_o,
- XalanUnicode::charLetter_n,
- 0
+const XalanDOMChar XObject::XObjectException::m_type[] =
+{
+ XalanUnicode::charLetter_X,
+ XalanUnicode::charLetter_O,
+ XalanUnicode::charLetter_b,
+ XalanUnicode::charLetter_j,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_E,
+ XalanUnicode::charLetter_x,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_n,
+ 0
};
XObject::XObjectException::XObjectException(
- const XalanDOMString& message) :
- XalanXPathException(message)
+ const XalanDOMString& message) :
+ XalanXPathException(message)
{
}
@@ -1150,53 +1276,53 @@
{
}
-const XalanDOMChar XObject::XObjectInvalidConversionException::m_type[] =
-{
- XalanUnicode::charLetter_X,
- XalanUnicode::charLetter_O,
- XalanUnicode::charLetter_b,
- XalanUnicode::charLetter_j,
- XalanUnicode::charLetter_e,
- XalanUnicode::charLetter_c,
- XalanUnicode::charLetter_t,
- XalanUnicode::charLetter_I,
- XalanUnicode::charLetter_n,
- XalanUnicode::charLetter_v,
- XalanUnicode::charLetter_a,
- XalanUnicode::charLetter_l,
- XalanUnicode::charLetter_i,
- XalanUnicode::charLetter_d,
- XalanUnicode::charLetter_C,
- XalanUnicode::charLetter_o,
- XalanUnicode::charLetter_n,
- XalanUnicode::charLetter_v,
- XalanUnicode::charLetter_e,
- XalanUnicode::charLetter_r,
- XalanUnicode::charLetter_s,
- XalanUnicode::charLetter_a,
- XalanUnicode::charLetter_t,
- XalanUnicode::charLetter_i,
- XalanUnicode::charLetter_o,
- XalanUnicode::charLetter_n,
- XalanUnicode::charLetter_E,
- XalanUnicode::charLetter_x,
- XalanUnicode::charLetter_c,
- XalanUnicode::charLetter_e,
- XalanUnicode::charLetter_p,
- XalanUnicode::charLetter_t,
- XalanUnicode::charLetter_i,
- XalanUnicode::charLetter_o,
- XalanUnicode::charLetter_n,
- 0
+const XalanDOMChar XObject::XObjectInvalidConversionException::m_type[] =
+{
+ XalanUnicode::charLetter_X,
+ XalanUnicode::charLetter_O,
+ XalanUnicode::charLetter_b,
+ XalanUnicode::charLetter_j,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_I,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_v,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_l,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_d,
+ XalanUnicode::charLetter_C,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_v,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_r,
+ XalanUnicode::charLetter_s,
+ XalanUnicode::charLetter_a,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_E,
+ XalanUnicode::charLetter_x,
+ XalanUnicode::charLetter_c,
+ XalanUnicode::charLetter_e,
+ XalanUnicode::charLetter_p,
+ XalanUnicode::charLetter_t,
+ XalanUnicode::charLetter_i,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_n,
+ 0
};
XObject::XObjectInvalidConversionException::XObjectInvalidConversionException(
- const XalanDOMString& fromType,
- const XalanDOMString& toType) :
- XObjectException(
- formatErrorString(fromType, toType)),
- m_fromType(fromType),
- m_toType(toType)
+ const XalanDOMString& fromType,
+ const XalanDOMString& toType) :
+ XObjectException(
+ formatErrorString(fromType, toType)),
+ m_fromType(fromType),
+ m_toType(toType)
{
}
@@ -1210,11 +1336,11 @@
const XalanDOMString
XObject::XObjectInvalidConversionException::formatErrorString(
- const XalanDOMString& fromType,
- const XalanDOMString& toType)
+ const XalanDOMString& fromType,
+ const XalanDOMString& toType)
{
- return
XalanMessageLoader::getMessage(XalanMessages::CannotConvertTypetoType_2Param,
fromType, toType);
+ return
XalanMessageLoader::getMessage(XalanMessages::CannotConvertTypetoType_2Param,
fromType, toType);
}
1.8 +605 -597 xml-xalan/c/src/xalanc/XPath/XObject.hpp
Index: XObject.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XObject.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- XObject.hpp 24 Aug 2004 14:03:15 -0000 1.7
+++ XObject.hpp 28 Oct 2004 22:30:59 -0000 1.8
@@ -62,520 +62,528 @@
{
public:
- friend class XObjectPtr;
+ friend class XObjectPtr;
- /**
- * Enumeration of possible object types
- */
- enum eObjectType { eTypeNull = 0,
- eTypeUnknown = 1,
- eTypeBoolean = 2,
- eTypeNumber = 3,
- eTypeString = 4,
- eTypeNodeSet = 5,
- eTypeResultTreeFrag = 6,
- eTypeUserDefined = 7,
- // These next types are
implementation-specific, and
- // are never returned by
getType().
- eTypeStringReference = 8,
- eTypeStringAdapter = 9,
- eTypeStringCached = 10,
- eTypeXTokenNumberAdapter = 11,
- eTypeXTokenStringAdapter = 12,
- eTypeNodeSetNodeProxy = 13,
- eUnknown
- };
-
- /**
- * Perform static initialization. See class XPathInit.
- */
- static void
- initialize();
-
- /**
- * Perform static shut down. See class XPathInit.
- */
- static void
- terminate();
-
- /**
- * Create an XObject.
- *
- * @param theObjectType The enum for the type of the object.
- */
- XObject(eObjectType theObjectType);
-
- XObject(const XObject& source);
-
- /**
- * Clone the instance
- *
- * @param If theAddress is not null, the XObject will clone itself into
that address.
- * @return a clone of the instance.
- */
- virtual XObject*
- clone(void* theAddress = 0) const = 0;
-
- /**
- * Given a request type, return the equivalent string.
- * For diagnostic purposes.
- *
- * @return string for type
- */
- virtual XalanDOMString
- getTypeString() const = 0;
-
- /**
- * Cast result object to a number.
- *
- * @return numeric value
- */
- virtual double
- num() const;
-
- /**
- * Cast result object to a boolean.
- *
- * @return boolean value
- */
- virtual bool
- boolean() const;
-
- /**
- * Cast result object to a string.
- *
- * @return string value
- */
- virtual const XalanDOMString&
- str() const;
-
- typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh*
const, const unsigned int);
-
- /**
- * Send the string value to a FormatterListener instance.
- *
- * @param formatterListener The FormatterListener instance
- * @param function A pointer to the member function of
FormatterListener to call
- *
- */
- virtual void
- str(
- FormatterListener& formatterListener,
- MemberFunctionPtr function) const = 0;
-
- /**
- * Get the length of the string value of the instance..
- *
- * @return The length of the string value
- */
- virtual double
- stringLength() const = 0;
-
- /**
- * Append the string value directly a string
- *
- * @param theBuffer The buffer for the data
- */
- virtual void
- str(XalanDOMString& theBuffer) const;
-
- /**
- * Cast result object to a result tree fragment.
- *
- * @return result tree fragment
- */
- virtual const XalanDocumentFragment&
- rtree() const;
-
- /**
- * Cast result object to a nodelist.
- *
- * @return node list
- */
- virtual const NodeRefListBase&
- nodeset() const;
-
- /**
- * Process a callback request for preferred type information.
- *
- * @param theCallbackObject object to call back
- */
- virtual void
- ProcessXObjectTypeCallback(XObjectTypeCallback&
theCallbackObject) = 0;
-
- /**
- * Process a callback request for preferred type information.
- *
- * @param theCallbackObject object to call back
- */
- virtual void
- ProcessXObjectTypeCallback(XObjectTypeCallback&
theCallbackObject) const = 0;
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param theRHS object to compare
- * @param executionContext the current execution context
- * @return true if they are equal
- */
- bool
- equals(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const;
-
- /**
- * Tell if two objects are functionally not equal.
- *
- * @param theRHS object to compare
- * @param executionContext the current execution context
- * @return true if they are equal
- */
- bool
- notEquals(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const;
-
- /**
- * Tell if one object is less than the other.
- *
- * @param theRHS object to compare
- * @return true if they are equal
- */
- bool
- lessThan(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const;
-
- /**
- * Tell if one object is less than or equal
- * the other.
- *
- * @param theRHS object to compare
- * @return true if they are equal
- */
- bool
- lessThanOrEquals(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const;
-
- /**
- * Tell if one object is greater than the other.
- *
- * @param theRHS object to compare
- * @return true if they are equal
- */
- bool
- greaterThan(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const;
-
- /**
- * Tell if one object is greater than or equal
- * the other.
- *
- * @param theRHS object to compare
- * @return true if they are equal
- */
- bool
- greaterThanOrEquals(
- const XObject& theRHS,
- XPathExecutionContext& executionContext) const;
-
- /**
- * Tell what kind of class this is.
- *
- * @return numeric type value
- */
- eObjectType
- getType() const
- {
- return m_objectType;
- }
-
- /**
- * Static conversion function.
- *
- * @return bool value
- */
- static bool
- boolean(double theNumber)
- {
- return !DoubleSupport::isNaN(theNumber) &&
!DoubleSupport::equal(theNumber, 0.0);
- }
-
- /**
- * Static conversion function.
- *
- * @return bool value
- */
- static bool
- boolean(const XalanDOMString& theString)
- {
- return theString.length() == 0 ? false : true;
- }
-
- /**
- * Static conversion function.
- *
- * @return bool value
- */
- static bool
- boolean(const NodeRefListBase& theNodeList)
- {
- return theNodeList.getLength() == 0 ? false : true;
- }
-
- /**
- * Static conversion function.
- *
- * @return The string value of the number
- */
- static const XalanDOMString&
- string(bool theBool)
- {
- return theBool == true ? s_trueString : s_falseString;
- }
-
- static void
- string(
- bool theBool,
- FormatterListener& formatterListener,
- MemberFunctionPtr function)
- {
- if(theBool == true)
- {
- (formatterListener.*function)(s_trueString.c_str(),
s_trueString.length());
- }
- else
- {
- (formatterListener.*function)(s_falseString.c_str(),
s_falseString.length());
- }
- }
-
- /**
- * Static conversion function.
- *
- * @return The string value of the number
- */
- static void
- string(
- double theNumber,
- XalanDOMString& theString)
- {
- DoubleToDOMString(theNumber, theString);
- }
-
- static void
- string(
- double theNumber,
- FormatterListener& formatterListener,
- MemberFunctionPtr function)
- {
- DOMStringHelper::DoubleToCharacters(theNumber,
formatterListener, function);
- }
-
- /**
- * Static conversion function.
- *
- * @return The string value of the node
- */
- static void
- string(
- const XalanNode& theNode,
- XalanDOMString& theString)
- {
- DOMServices::getNodeData(theNode, theString);
- }
-
- static void
- string(
- const XalanNode& theNode,
- FormatterListener& formatterListener,
- MemberFunctionPtr function)
- {
- DOMServices::getNodeData(theNode, formatterListener, function);
- }
-
- /**
- * Static conversion function.
- *
- * @return The string value of the node list
- */
- static void
- string(
- const NodeRefListBase& theNodeList,
- XalanDOMString& theString)
- {
- if (theNodeList.getLength() > 0)
- {
- assert(theNodeList.item(0) != 0);
-
- string(*theNodeList.item(0), theString);
- }
- }
-
- static void
- string(
- const NodeRefListBase& theNodeList,
- FormatterListener& formatterListener,
- MemberFunctionPtr function)
- {
- if (theNodeList.getLength() > 0)
- {
- assert(theNodeList.item(0) != 0);
-
- DOMServices::getNodeData(*theNodeList.item(0),
formatterListener, function);
- }
- }
-
- /**
- * Static conversion function.
- *
- * @return bool value
- */
- static double
- number(bool theBoolean)
- {
- return theBoolean == true ? 1.0 : 0.0;
- }
-
- static double
- number(const XalanDOMString& theString)
- {
- return DoubleSupport::toDouble(theString);
- }
-
- /**
- * Static conversion function.
- *
- * @return The number value of the node list
- */
- static double
- number(
- XPathExecutionContext& executionContext,
- const NodeRefListBase& theNodeList);
-
- /**
- * Static conversion function.
- *
- * @return The number value of the node
- */
- static double
- number(
- XPathExecutionContext& executionContext,
- const XalanNode& theNode);
-
-
- // All XObject instances are controlled by an instance of an
XObjectFactory.
- friend class XObjectFactory;
-
- void
- setFactory(XObjectFactory* theFactory)
- {
- m_factory = theFactory;
- }
-
- // Base class for all XObject exceptions...
- class XObjectException : public XalanXPathException
- {
- public:
-
- explicit
- XObjectException(
- const XalanDOMString& message);
-
- virtual
- ~XObjectException();
-
- virtual const XalanDOMChar*
- getType() const
- {
- return m_type;
- }
- private:
-
- static const XalanDOMChar m_type[];
- };
-
- class XObjectInvalidConversionException : public XObjectException
- {
- public:
-
- XObjectInvalidConversionException(
- const XalanDOMString& fromType,
- const XalanDOMString& toType);
-
- virtual
- ~XObjectInvalidConversionException();
-
- const XalanDOMString&
- getFromType() const
- {
- return m_fromType;
- }
-
- const XalanDOMString&
- getToType() const
- {
- return m_toType;
- }
-
-
- virtual const XalanDOMChar*
- getType() const
- {
- return m_type;
- }
- private:
-
- static const XalanDOMChar m_type[];
-
- static const XalanDOMString
- formatErrorString(
- const XalanDOMString& fromType,
- const XalanDOMString& toType);
+ /**
+ * Enumeration of possible object types
+ */
+ enum eObjectType { eTypeNull = 0,
+ eTypeUnknown = 1,
+ eTypeBoolean = 2,
+ eTypeNumber = 3,
+ eTypeString = 4,
+ eTypeNodeSet = 5,
+ eTypeResultTreeFrag = 6,
+ eTypeUserDefined = 7,
+ // These next types are implementation-specific,
and
+ // are never returned by getType().
+ eTypeStringReference = 8,
+ eTypeStringAdapter = 9,
+ eTypeStringCached = 10,
+ eTypeXTokenNumberAdapter = 11,
+ eTypeXTokenStringAdapter = 12,
+ eTypeNodeSetNodeProxy = 13,
+ eUnknown
+ };
+
+ /**
+ * Perform static initialization. See class XPathInit.
+ */
+ static void
+ initialize();
+
+ /**
+ * Perform static shut down. See class XPathInit.
+ */
+ static void
+ terminate();
+
+ /**
+ * Create an XObject.
+ *
+ * @param theObjectType The enum for the type of the object.
+ */
+ XObject(eObjectType theObjectType);
+
+ XObject(const XObject& source);
+
+ /**
+ * Clone the instance
+ *
+ * @param If theAddress is not null, the XObject will clone itself into
that address.
+ * @return a clone of the instance.
+ */
+ virtual XObject*
+ clone(void* theAddress = 0) const = 0;
+
+ /**
+ * Given a request type, return the equivalent string.
+ * For diagnostic purposes.
+ *
+ * @return string for type
+ */
+ virtual const XalanDOMString&
+ getTypeString() const = 0;
+
+ /**
+ * Cast result object to a number.
+ *
+ * @return numeric value
+ */
+ virtual double
+ num() const;
+
+ /**
+ * Cast result object to a boolean.
+ *
+ * @return boolean value
+ */
+ virtual bool
+ boolean() const;
+
+ /**
+ * Cast result object to a string.
+ *
+ * @return string value
+ */
+ virtual const XalanDOMString&
+ str() const;
+
+ typedef void (FormatterListener::*MemberFunctionPtr)(const XMLCh* const,
const unsigned int);
+
+ /**
+ * Send the string value to a FormatterListener instance.
+ *
+ * @param formatterListener The FormatterListener instance
+ * @param function A pointer to the member function of FormatterListener
to call
+ *
+ */
+ virtual void
+ str(
+ FormatterListener& formatterListener,
+ MemberFunctionPtr function) const = 0;
+
+ /**
+ * Get the length of the string value of the instance..
+ *
+ * @return The length of the string value
+ */
+ virtual double
+ stringLength() const = 0;
+
+ /**
+ * Append the string value directly a string
+ *
+ * @param theBuffer The buffer for the data
+ */
+ virtual void
+ str(XalanDOMString& theBuffer) const;
+
+ /**
+ * Cast result object to a result tree fragment.
+ *
+ * @return result tree fragment
+ */
+ virtual const XalanDocumentFragment&
+ rtree() const;
+
+ /**
+ * Cast result object to a nodelist.
+ *
+ * @return node list
+ */
+ virtual const NodeRefListBase&
+ nodeset() const;
+
+ /**
+ * Process a callback request for preferred type information.
+ *
+ * @param theCallbackObject object to call back
+ */
+ virtual void
+ ProcessXObjectTypeCallback(XObjectTypeCallback& theCallbackObject) =
0;
+
+ /**
+ * Process a callback request for preferred type information.
+ *
+ * @param theCallbackObject object to call back
+ */
+ virtual void
+ ProcessXObjectTypeCallback(XObjectTypeCallback& theCallbackObject)
const = 0;
+
+ /**
+ * Tell if two objects are functionally equal.
+ *
+ * @param theRHS object to compare
+ * @param executionContext the current execution context
+ * @return true if they are equal
+ */
+ bool
+ equals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
+
+ /**
+ * Tell if two objects are functionally not equal.
+ *
+ * @param theRHS object to compare
+ * @param executionContext the current execution context
+ * @return true if they are equal
+ */
+ bool
+ notEquals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
+
+ /**
+ * Tell if one object is less than the other.
+ *
+ * @param theRHS object to compare
+ * @return true if they are equal
+ */
+ bool
+ lessThan(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
+
+ /**
+ * Tell if one object is less than or equal
+ * the other.
+ *
+ * @param theRHS object to compare
+ * @return true if they are equal
+ */
+ bool
+ lessThanOrEquals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
+
+ /**
+ * Tell if one object is greater than the other.
+ *
+ * @param theRHS object to compare
+ * @return true if they are equal
+ */
+ bool
+ greaterThan(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
+
+ /**
+ * Tell if one object is greater than or equal
+ * the other.
+ *
+ * @param theRHS object to compare
+ * @return true if they are equal
+ */
+ bool
+ greaterThanOrEquals(
+ const XObject& theRHS,
+ XPathExecutionContext& executionContext) const;
+
+ /**
+ * Tell what kind of class this is.
+ *
+ * @return numeric type value
+ */
+ eObjectType
+ getType() const
+ {
+ return m_objectType;
+ }
+
+ /**
+ * Static conversion function.
+ *
+ * @return bool value
+ */
+ static bool
+ boolean(double theNumber)
+ {
+ return !DoubleSupport::isNaN(theNumber) &&
!DoubleSupport::equal(theNumber, 0.0);
+ }
+
+ /**
+ * Static conversion function.
+ *
+ * @return bool value
+ */
+ static bool
+ boolean(const XalanDOMString& theString)
+ {
+ return theString.length() == 0 ? false : true;
+ }
+
+ /**
+ * Static conversion function.
+ *
+ * @return bool value
+ */
+ static bool
+ boolean(const NodeRefListBase& theNodeList)
+ {
+ return theNodeList.getLength() == 0 ? false : true;
+ }
+
+ /**
+ * Static conversion function.
+ *
+ * @return The string value of the number
+ */
+ static const XalanDOMString&
+ string(bool theBool)
+ {
+ return theBool == true ? s_trueString : s_falseString;
+ }
+
+ static void
+ string(
+ bool theBool,
+ FormatterListener& formatterListener,
+ MemberFunctionPtr function)
+ {
+ if(theBool == true)
+ {
+ (formatterListener.*function)(s_trueString.c_str(),
s_trueString.length());
+ }
+ else
+ {
+ (formatterListener.*function)(s_falseString.c_str(),
s_falseString.length());
+ }
+ }
+
+ /**
+ * Static conversion function.
+ *
+ * @return The string value of the number
+ */
+ static void
+ string(
+ double theNumber,
+ XalanDOMString& theString)
+ {
+ DoubleToDOMString(theNumber, theString);
+ }
+
+ static void
+ string(
+ double theNumber,
+ FormatterListener& formatterListener,
+ MemberFunctionPtr function)
+ {
+ DOMStringHelper::DoubleToCharacters(theNumber, formatterListener,
function);
+ }
+
+ /**
+ * Static conversion function.
+ *
+ * @return The string value of the node
+ */
+ static void
+ string(
+ const XalanNode& theNode,
+ XalanDOMString& theString)
+ {
+ DOMServices::getNodeData(theNode, theString);
+ }
+
+ static void
+ string(
+ const XalanNode& theNode,
+ FormatterListener& formatterListener,
+ MemberFunctionPtr function)
+ {
+ DOMServices::getNodeData(theNode, formatterListener, function);
+ }
+
+ /**
+ * Static conversion function.
+ *
+ * @return The string value of the node list
+ */
+ static void
+ string(
+ const NodeRefListBase& theNodeList,
+ XalanDOMString& theString)
+ {
+ if (theNodeList.getLength() > 0)
+ {
+ assert(theNodeList.item(0) != 0);
+
+ string(*theNodeList.item(0), theString);
+ }
+ }
+
+ static void
+ string(
+ const NodeRefListBase& theNodeList,
+ FormatterListener& formatterListener,
+ MemberFunctionPtr function)
+ {
+ if (theNodeList.getLength() > 0)
+ {
+ assert(theNodeList.item(0) != 0);
+
+ DOMServices::getNodeData(*theNodeList.item(0),
formatterListener, function);
+ }
+ }
+
+ /**
+ * Static conversion function.
+ *
+ * @return bool value
+ */
+ static double
+ number(bool theBoolean)
+ {
+ return theBoolean == true ? 1.0 : 0.0;
+ }
+
+ static double
+ number(const XalanDOMString& theString)
+ {
+ return DoubleSupport::toDouble(theString);
+ }
+
+ /**
+ * Static conversion function.
+ *
+ * @return The number value of the node list
+ */
+ static double
+ number(
+ XPathExecutionContext& executionContext,
+ const NodeRefListBase& theNodeList);
+
+ /**
+ * Static conversion function.
+ *
+ * @return The number value of the node
+ */
+ static double
+ number(
+ XPathExecutionContext& executionContext,
+ const XalanNode& theNode);
+
+
+ // All XObject instances are controlled by an instance of an
XObjectFactory.
+ friend class XObjectFactory;
+
+ void
+ setFactory(XObjectFactory* theFactory)
+ {
+ m_factory = theFactory;
+ }
+
+ // Base class for all XObject exceptions...
+ class XObjectException : public XalanXPathException
+ {
+ public:
+
+ explicit
+ XObjectException(
+ const XalanDOMString& message);
+
+ virtual
+ ~XObjectException();
+
+ virtual const XalanDOMChar*
+ getType() const
+ {
+ return m_type;
+ }
+ private:
+
+ static const XalanDOMChar m_type[];
+ };
+
+ class XObjectInvalidConversionException : public XObjectException
+ {
+ public:
+
+ XObjectInvalidConversionException(
+ const XalanDOMString& fromType,
+ const XalanDOMString& toType);
+
+ virtual
+ ~XObjectInvalidConversionException();
+
+ const XalanDOMString&
+ getFromType() const
+ {
+ return m_fromType;
+ }
+
+ const XalanDOMString&
+ getToType() const
+ {
+ return m_toType;
+ }
+
+
+ virtual const XalanDOMChar*
+ getType() const
+ {
+ return m_type;
+ }
+ private:
+
+ static const XalanDOMChar m_type[];
+
+ static const XalanDOMString
+ formatErrorString(
+ const XalanDOMString& fromType,
+ const XalanDOMString& toType);
- const XalanDOMString m_fromType;
+ const XalanDOMString m_fromType;
- const XalanDOMString m_toType;
- };
+ const XalanDOMString m_toType;
+ };
protected:
- /**
- * Tell what kind of class this is.
- *
- * @return numeric type value
- */
- virtual eObjectType
- getRealType() const;
-
- virtual void
- referenced();
+ /**
+ * Tell what kind of class this is.
+ *
+ * @return numeric type value
+ */
+ virtual eObjectType
+ getRealType() const;
- virtual void
- dereferenced();
+ virtual void
+ referenced();
- virtual
- ~XObject();
+ virtual void
+ dereferenced();
- static const XalanDOMString s_nullString;
+ virtual
+ ~XObject();
-protected:
+ static const XalanDOMString s_emptyString;
+
+ static const XalanDOMString& s_booleanString;
+
+ static const XalanDOMString& s_falseString;
+
+ static const XalanDOMString& s_nodesetString;
+
+ static const XalanDOMString& s_numberString;
+
+ static const XalanDOMString& s_resultTreeFragmentString;
- static XalanDOMString s_falseString;
+ static const XalanDOMString& s_stringString;
- static XalanDOMString s_trueString;
+ static const XalanDOMString& s_trueString;
private:
- // Not implemented...
- XObject&
- operator=(const XObject&);
+ // Not implemented...
+ XObject&
+ operator=(const XObject&);
- const eObjectType m_objectType;
+ const eObjectType m_objectType;
- XObjectFactory* m_factory;
+ XObjectFactory* m_factory;
};
@@ -587,130 +595,130 @@
{
public:
- friend bool operator==(const XObjectPtr&, const XObjectPtr&);
- friend bool operator<(const XObjectPtr&, const XObjectPtr&);
+ friend bool operator==(const XObjectPtr&, const XObjectPtr&);
+ friend bool operator<(const XObjectPtr&, const XObjectPtr&);
- /**
- * Create an XObjectPtr.
- */
- explicit
- XObjectPtr(XObject* theXObject = 0) :
- m_xobjectPtr(theXObject)
- {
- XalanReferenceCountedObject::addReference(theXObject);
- }
-
- XObjectPtr(const XObjectPtr& theSource) :
- m_xobjectPtr(theSource.m_xobjectPtr)
- {
- XalanReferenceCountedObject::addReference(m_xobjectPtr);
- };
-
- XObjectPtr&
- operator=(const XObjectPtr& theRHS)
- {
- if (m_xobjectPtr != theRHS.m_xobjectPtr)
- {
-
XalanReferenceCountedObject::removeReference(m_xobjectPtr);
-
- m_xobjectPtr = theRHS.m_xobjectPtr;
-
- XalanReferenceCountedObject::addReference(m_xobjectPtr);
- }
-
- return *this;
- }
-
- ~XObjectPtr()
- {
- XalanReferenceCountedObject::removeReference(m_xobjectPtr);
- };
-
- void
- release()
- {
- XObject* const xobjectPtr = m_xobjectPtr;
-
- m_xobjectPtr = 0;
-
- XalanReferenceCountedObject::removeReference(xobjectPtr);
- }
-
- bool
- null() const
- {
- return m_xobjectPtr == 0 ? true : false;
- }
-
- const XObject&
- operator*() const
- {
- return *m_xobjectPtr;
- };
-
- XObject&
- operator*()
- {
- return *m_xobjectPtr;
- };
-
- const XObject*
- operator->() const
- {
- return m_xobjectPtr;
- };
-
- XObject*
- operator->()
- {
- return m_xobjectPtr;
- };
-
- const XObject*
- get() const
- {
- return m_xobjectPtr;
- };
-
- XObject*
- get()
- {
- return m_xobjectPtr;
- };
+ /**
+ * Create an XObjectPtr.
+ */
+ explicit
+ XObjectPtr(XObject* theXObject = 0) :
+ m_xobjectPtr(theXObject)
+ {
+ XalanReferenceCountedObject::addReference(theXObject);
+ }
+
+ XObjectPtr(const XObjectPtr& theSource) :
+ m_xobjectPtr(theSource.m_xobjectPtr)
+ {
+ XalanReferenceCountedObject::addReference(m_xobjectPtr);
+ };
+
+ XObjectPtr&
+ operator=(const XObjectPtr& theRHS)
+ {
+ if (m_xobjectPtr != theRHS.m_xobjectPtr)
+ {
+ XalanReferenceCountedObject::removeReference(m_xobjectPtr);
+
+ m_xobjectPtr = theRHS.m_xobjectPtr;
+
+ XalanReferenceCountedObject::addReference(m_xobjectPtr);
+ }
+
+ return *this;
+ }
+
+ ~XObjectPtr()
+ {
+ XalanReferenceCountedObject::removeReference(m_xobjectPtr);
+ };
+
+ void
+ release()
+ {
+ XObject* const xobjectPtr = m_xobjectPtr;
+
+ m_xobjectPtr = 0;
+
+ XalanReferenceCountedObject::removeReference(xobjectPtr);
+ }
+
+ bool
+ null() const
+ {
+ return m_xobjectPtr == 0 ? true : false;
+ }
+
+ const XObject&
+ operator*() const
+ {
+ return *m_xobjectPtr;
+ };
+
+ XObject&
+ operator*()
+ {
+ return *m_xobjectPtr;
+ };
+
+ const XObject*
+ operator->() const
+ {
+ return m_xobjectPtr;
+ };
+
+ XObject*
+ operator->()
+ {
+ return m_xobjectPtr;
+ };
+
+ const XObject*
+ get() const
+ {
+ return m_xobjectPtr;
+ };
+
+ XObject*
+ get()
+ {
+ return m_xobjectPtr;
+ };
private:
- XObject* m_xobjectPtr;
+ XObject* m_xobjectPtr;
};
inline bool
operator==(
- const XObjectPtr& theLHS,
- const XObjectPtr& theRHS)
+ const XObjectPtr& theLHS,
+ const XObjectPtr& theRHS)
{
- return theLHS.m_xobjectPtr == theRHS.m_xobjectPtr;
+ return theLHS.m_xobjectPtr == theRHS.m_xobjectPtr;
}
inline bool
operator!=(
- const XObjectPtr& theLHS,
- const XObjectPtr& theRHS)
+ const XObjectPtr& theLHS,
+ const XObjectPtr& theRHS)
{
- return !(theLHS == theRHS);
+ return !(theLHS == theRHS);
}
inline bool
operator<(
- const XObjectPtr& theLHS,
- const XObjectPtr& theRHS)
+ const XObjectPtr& theLHS,
+ const XObjectPtr& theRHS)
{
- return theLHS.m_xobjectPtr < theRHS.m_xobjectPtr;
+ return theLHS.m_xobjectPtr < theRHS.m_xobjectPtr;
}
@@ -719,4 +727,4 @@
-#endif // XOBJECT_HEADER_GUARD_1357924680
+#endif // XOBJECT_HEADER_GUARD_1357924680
1.5 +5 -0 xml-xalan/c/src/xalanc/XPath/XPathInit.cpp
Index: XPathInit.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XPathInit.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XPathInit.cpp 26 Feb 2004 22:40:35 -0000 1.4
+++ XPathInit.cpp 28 Oct 2004 22:30:59 -0000 1.5
@@ -18,6 +18,7 @@
+#include "XNull.hpp"
#include "XObject.hpp"
#include "XUnknown.hpp"
#include "XPath.hpp"
@@ -63,6 +64,8 @@
void
XPathInit::initialize()
{
+ XNull::initialize();
+
XObject::initialize();
XUnknown::initialize();
@@ -84,6 +87,8 @@
XUnknown::terminate();
XObject::terminate();
+
+ XNull::terminate();
}
1.6 +2 -2 xml-xalan/c/src/xalanc/XPath/XStringBase.cpp
Index: XStringBase.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XStringBase.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XStringBase.cpp 26 Feb 2004 22:40:35 -0000 1.5
+++ XStringBase.cpp 28 Oct 2004 22:30:59 -0000 1.6
@@ -61,10 +61,10 @@
-XalanDOMString
+const XalanDOMString&
XStringBase::getTypeString() const
{
- return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("#STRING"));
+ return s_stringString;
}
1.6 +1 -1 xml-xalan/c/src/xalanc/XPath/XStringBase.hpp
Index: XStringBase.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XStringBase.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XStringBase.hpp 26 Feb 2004 22:40:35 -0000 1.5
+++ XStringBase.hpp 28 Oct 2004 22:30:59 -0000 1.6
@@ -64,7 +64,7 @@
#endif
clone(void* theAddress = 0) const = 0;
- virtual XalanDOMString
+ virtual const XalanDOMString&
getTypeString() const;
virtual double
1.4 +2 -2 xml-xalan/c/src/xalanc/XPath/XToken.cpp
Index: XToken.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XToken.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XToken.cpp 26 Feb 2004 22:40:35 -0000 1.3
+++ XToken.cpp 28 Oct 2004 22:30:59 -0000 1.4
@@ -103,12 +103,12 @@
-XalanDOMString
+const XalanDOMString&
XToken::getTypeString() const
{
assert(m_stringValue != 0);
- return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("#TOKEN"));
+ return s_stringString;
}
1.4 +1 -1 xml-xalan/c/src/xalanc/XPath/XToken.hpp
Index: XToken.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XToken.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XToken.hpp 26 Feb 2004 22:40:35 -0000 1.3
+++ XToken.hpp 28 Oct 2004 22:30:59 -0000 1.4
@@ -68,7 +68,7 @@
#endif
clone(void* theAddress = 0) const;
- virtual XalanDOMString
+ virtual const XalanDOMString&
getTypeString() const;
virtual double
1.6 +19 -2 xml-xalan/c/src/xalanc/XPath/XUnknown.cpp
Index: XUnknown.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XUnknown.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XUnknown.cpp 26 Feb 2004 22:40:35 -0000 1.5
+++ XUnknown.cpp 28 Oct 2004 22:30:59 -0000 1.6
@@ -20,6 +20,7 @@
#include <xalanc/PlatformSupport/DOMStringHelper.hpp>
#include <xalanc/PlatformSupport/XalanMessageLoader.hpp>
+#include <xalanc/PlatformSupport/XalanUnicode.hpp>
@@ -34,6 +35,22 @@
XalanDOMString XUnknown::s_unknownString;
+static const XalanDOMChar s_unknown[] =
+{
+ XalanUnicode::charLessThanSign,
+ XalanUnicode::charLetter_u,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_k,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charLetter_o,
+ XalanUnicode::charLetter_w,
+ XalanUnicode::charLetter_n,
+ XalanUnicode::charGreaterThanSign,
+ 0
+};
+
+
+
XUnknown::XUnknown(const XalanDOMString& name) :
XObject(eTypeUnknown),
m_value(XalanMessageLoader::getMessage(XalanMessages::UnknownVariable_1Param,
name))
@@ -75,7 +92,7 @@
-XalanDOMString
+const XalanDOMString&
XUnknown::getTypeString() const
{
return s_unknownString;
@@ -148,7 +165,7 @@
void
XUnknown::initialize()
{
- s_unknownString = XALAN_STATIC_UCODE_STRING("#UNKNOWN");
+ s_unknownString = s_unknown;
}
1.5 +1 -1 xml-xalan/c/src/xalanc/XPath/XUnknown.hpp
Index: XUnknown.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XUnknown.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XUnknown.hpp 26 Feb 2004 22:40:35 -0000 1.4
+++ XUnknown.hpp 28 Oct 2004 22:30:59 -0000 1.5
@@ -75,7 +75,7 @@
#endif
clone(void* theAddress = 0) const;
- virtual XalanDOMString
+ virtual const XalanDOMString&
getTypeString() const;
virtual double
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]