You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by au...@locus.apache.org on 2000/11/27 16:23:18 UTC

cvs commit: xml-xalan/c/samples/ExternalFunction ExternalFunction.cpp

auriemma    00/11/27 07:23:17

  Modified:    c/samples/ExternalFunction ExternalFunction.cpp
  Log:
  Update to use XObjectPtr instead of XObject* and fixed a string error.
  
  Revision  Changes    Path
  1.10      +8 -8      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ExternalFunction.cpp	2000/09/27 16:46:39	1.9
  +++ ExternalFunction.cpp	2000/11/27 15:23:16	1.10
  @@ -60,7 +60,7 @@
   	 * @param args             vector of pointers to XObject arguments
   	 * @return                 pointer to the result XObject
   	 */
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,
  @@ -72,7 +72,7 @@
   			executionContext.error("The square-root() function takes one argument!", context);
   		}
   
  -		assert(args[0] != 0);
  +		assert(args[0].null() == true);
   
   		return executionContext.getXObjectFactory().createNumber(sqrt(args[0]->num()));
   	}
  @@ -120,7 +120,7 @@
   	 * @param args             vector of pointers to XObject arguments
   	 * @return                 pointer to the result XObject
   	 */
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,
  @@ -132,7 +132,7 @@
   			executionContext.error("The cube() function takes one argument!", context);
   		}
   
  -		assert(args[0] != 0);
  +		assert(args[0].null() == true);
   
   		return executionContext.getXObjectFactory().createNumber(pow(args[0]->num(), 3));
   	}
  @@ -180,7 +180,7 @@
   	 * @param args             vector of pointers to XObject arguments
   	 * @return                 pointer to the result XObject
   	 */
  -	virtual XObject*
  +	virtual XObjectPtr
   	execute(
   			XPathExecutionContext&			executionContext,
   			XalanNode*						context,
  @@ -317,7 +317,7 @@
   				// processor in the executable's process, since there
   				// is one static XPath function table.
   				XPath::installFunction(
  -					"asctime",
  +					XalanDOMString("asctime"),
   					FunctionAsctime());
   
   				// The namespace for our functions...
  @@ -330,7 +330,7 @@
   				// use the function.
   				XSLTProcessorEnvSupportDefault::installExternalFunctionGlobal(
   					theNamespace,
  -					"square-root",
  +					XalanDOMString("square-root"),
   					FunctionSquareRoot());
   
   				// Install the function in the local space.  It will only
  @@ -338,7 +338,7 @@
   				// will know about the function...
   				theXSLTProcessorEnvSupport.installExternalFunctionLocal(
   					theNamespace,
  -					"cube",
  +					XalanDOMString("cube"),
   					FunctionCube());
   
   				theProcessor.process(