dmitryh 2004/11/10 11:09:39
Modified: c/samples/ExternalFunction ExternalFunction.cpp
c/samples/ParsedSourceWrappers ParsedSourceWrappers.cpp
c/samples/SerializeNodeSet SerializeNodeSet.cpp
Log:
Fix for building samples
Revision Changes Path
1.38 +31 -19 xml-xalan/c/samples/ExternalFunction/ExternalFunction.cpp
Index: ExternalFunction.cpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/samples/ExternalFunction/ExternalFunction.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- ExternalFunction.cpp 26 Feb 2004 22:27:24 -0000 1.37
+++ ExternalFunction.cpp 10 Nov 2004 19:09:39 -0000 1.38
@@ -47,7 +47,7 @@
XALAN_USING_XALAN(XalanNode)
XALAN_USING_XALAN(StaticStringToDOMString)
XALAN_USING_XALAN(XObjectPtr)
-
+XALAN_USING_XALAN(MemoryManagerType)
// This class defines a function that will return the square root
@@ -77,7 +77,9 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString
theGuard(executionContext);
+
+ executionContext.error(getError(theGuard.get()),
context, locator);
}
assert(args[0].null() == false);
@@ -103,9 +105,9 @@
#else
virtual FunctionSquareRoot*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new FunctionSquareRoot(*this);
+ return cloneFunction_1<FunctionSquareRoot>()( *this,
theManager);
}
protected:
@@ -117,10 +119,12 @@
*
* @return function error message
*/
- const XalanDOMString
- getError() const
+ const XalanDOMString&
+ getError(XalanDOMString& theResult) const
{
- return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("The
square-root() function accepts one argument!"));
+ theResult.assign(XALAN_STATIC_UCODE_STRING("The square-root()
function accepts one argument!"));
+
+ return theResult;
}
private:
@@ -162,7 +166,9 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString
theGuard(executionContext);
+
+ executionContext.error(getError(theGuard.get()),
context, locator);
}
assert(args[0].null() == false);
@@ -188,9 +194,9 @@
#else
virtual FunctionCube*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new FunctionCube(*this);
+ return cloneFunction_1<FunctionCube>()(*this, theManager);
}
protected:
@@ -202,10 +208,12 @@
*
* @return function error message
*/
- const XalanDOMString
- getError() const
+ const XalanDOMString&
+ getError(XalanDOMString& theResult) const
{
- return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("The
cube() function accepts one argument!"));
+ theResult.assign(XALAN_STATIC_UCODE_STRING("The cube() function
accepts one argument!"));
+
+ return theResult;
}
private:
@@ -247,7 +255,9 @@
{
if (args.empty() == false)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString
theGuard(executionContext);
+
+ executionContext.error(getError(theGuard.get()),
context, locator);
}
#if defined(XALAN_STRICT_ANSI_HEADERS)
@@ -286,9 +296,9 @@
#else
virtual FunctionAsctime*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new FunctionAsctime(*this);
+ return cloneFunction_1<FunctionAsctime>()(*this, theManager);
}
protected:
@@ -300,10 +310,12 @@
*
* @return function error message
*/
- const XalanDOMString
- getError() const
+ const XalanDOMString&
+ getError(XalanDOMString& theResult) const
{
- return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("The
asctime() function accepts one argument!"));
+ theResult.assign(XALAN_STATIC_UCODE_STRING("The asctime() function
accepts one argument!"));
+
+ return theResult;
}
private:
1.14 +2 -1
xml-xalan/c/samples/ParsedSourceWrappers/ParsedSourceWrappers.cpp
Index: ParsedSourceWrappers.cpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/samples/ParsedSourceWrappers/ParsedSourceWrappers.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ParsedSourceWrappers.cpp 26 Feb 2004 22:27:24 -0000 1.13
+++ ParsedSourceWrappers.cpp 10 Nov 2004 19:09:39 -0000 1.14
@@ -171,7 +171,8 @@
const XalanDOMString theInputFile("foo.xml");
- const XalanDOMString
theURI(URISupport::getURLStringFromString(theInputFile));
+ XalanDOMString theURI;
+ URISupport::getURLStringFromString(theInputFile, theURI);
const XSLTResultTarget theResultTarget(cout);
1.12 +3 -2 xml-xalan/c/samples/SerializeNodeSet/SerializeNodeSet.cpp
Index: SerializeNodeSet.cpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/samples/SerializeNodeSet/SerializeNodeSet.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SerializeNodeSet.cpp 26 Feb 2004 22:27:24 -0000 1.11
+++ SerializeNodeSet.cpp 10 Nov 2004 19:09:39 -0000 1.12
@@ -150,8 +150,9 @@
else
{
// OK, let's evaluate the expression...
- const NodeRefList theResult =
- theEvaluator.selectNodeList(
+ NodeRefList theResult;
+ theEvaluator.selectNodeList(
+ theResult,
theDOMSupport,
theContextNode,
XalanDOMString(argv[3]).c_str(),
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]