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 2001/09/26 22:51:40 UTC

cvs commit: xml-xalan/c/src/PlatformSupport DOMStringHelper.cpp DOMStringHelper.hpp

dbertoni    01/09/26 13:51:40

  Modified:    c/src/PlatformSupport DOMStringHelper.cpp
                        DOMStringHelper.hpp
  Log:
  Added funtions to convert pointers to XalanDOMStrings.
  
  Revision  Changes    Path
  1.63      +22 -0     xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp
  
  Index: DOMStringHelper.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- DOMStringHelper.cpp	2001/09/25 21:12:51	1.62
  +++ DOMStringHelper.cpp	2001/09/26 20:51:39	1.63
  @@ -1453,6 +1453,28 @@
   
   
   XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)&
  +PointerToDOMString(
  +			const void*			theValue,
  +			XalanDOMString&		theResult)
  +{
  +	char			theBuffer[MAX_PRINTF_DIGITS + 1];
  +
  +	unsigned int	theCharsWritten = sprintf(theBuffer, "%p", theValue);
  +	assert(theCharsWritten != 0);
  +
  +	reserve(theResult, length(theResult) + theCharsWritten);
  +
  +	TranscodeNumber(
  +			theBuffer,
  +			theBuffer + theCharsWritten,
  +			back_inserter(theResult));
  +
  +	return theResult;
  +}
  +
  +
  +
  +XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)&
   DoubleToDOMString(
   			double				theDouble,
   			XalanDOMString&		theResult)
  
  
  
  1.52      +32 -0     xml-xalan/c/src/PlatformSupport/DOMStringHelper.hpp
  
  Index: DOMStringHelper.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.hpp,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- DOMStringHelper.hpp	2001/09/25 21:12:51	1.51
  +++ DOMStringHelper.hpp	2001/09/26 20:51:39	1.52
  @@ -600,6 +600,38 @@
   
   
   /**
  + * Converts a pointer into a XalanDOMString
  + * 
  + * @param theValue pointer to be converted
  + * @param theResult the string to append with the result
  + * @return a reference to the passed string result.
  + */
  +XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)&
  +PointerToDOMString(
  +			const void*			theValue,
  +			XalanDOMString&		theResult);
  +
  +
  +
  +/**
  + * Converts a pointer into a XalanDOMString
  + * 
  + * @param theValue pointer to be converted
  + * @return string representation of the pointer
  + */
  +inline const XalanDOMString
  +PointerToDOMString(const void*	theValue)
  +{
  +	XalanDOMString	theResult;
  +
  +	PointerToDOMString(theValue, theResult);
  +
  +	return theResult;
  +}
  +
  +
  +
  +/**
    * Converts a double value into a XalanDOMString
    * 
    * @param theValue number to be converted
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org