You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ro...@apache.org on 2005/01/18 11:48:16 UTC

cvs commit: ws-axis/c/src/common AxisUtils.h AxisUtils.cpp

roshan      2005/01/18 02:48:16

  Modified:    c/src/common AxisUtils.h AxisUtils.cpp
  Log:
  added the decodeFromBase64Binary method
  
  Revision  Changes    Path
  1.18      +2 -0      ws-axis/c/src/common/AxisUtils.h
  
  Index: AxisUtils.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisUtils.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- AxisUtils.h	23 Nov 2004 17:21:02 -0000	1.17
  +++ AxisUtils.h	18 Jan 2005 10:48:15 -0000	1.18
  @@ -20,6 +20,7 @@
   #define AXIS_AXISUTILS_H__OF_AXIS_INCLUDED_
   
   #include <axis/GDefine.hpp>
  +#include <axis/AxisUserAPI.hpp>
   #include <string>
   
   using namespace std;
  @@ -40,6 +41,7 @@
       friend class TypeMapping;
       friend class URIMapping;
       public:
  +	    xsd__base64Binary decodeFromBase64Binary(const AxisChar* pValue);
           /*
   	 * Converts the given character pointer value to lowercase.
   	 * @param pchWord The character pointer to be converted.
  
  
  
  1.21      +16 -1     ws-axis/c/src/common/AxisUtils.cpp
  
  Index: AxisUtils.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisUtils.cpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- AxisUtils.cpp	23 Nov 2004 17:21:02 -0000	1.20
  +++ AxisUtils.cpp	18 Jan 2005 10:48:16 -0000	1.21
  @@ -23,6 +23,7 @@
   
   #include "AxisUtils.h"
   #include <axis/GDefine.hpp>
  +#include "../soap/apr_base64.h"
   
   AXIS_CPP_NAMESPACE_START
   
  @@ -129,4 +130,18 @@
       return NULL;
   }
   
  -AXIS_CPP_NAMESPACE_END
  +xsd__base64Binary AxisUtils::decodeFromBase64Binary(const AxisChar *pValue)
  +{
  +    xsd__base64Binary value;
  +    value.__size = apr_base64_decode_len (pValue);
  +    value.__ptr = new unsigned char[value.__size + 1];
  +    value.__size = apr_base64_decode_binary (value.__ptr, pValue);
  +    /* put null at the end because it enables the decoded string to be used
  +     * as a string 
  +     */
  +    value.__ptr[value.__size] = 0;
  +
  +    return value;
  +}
  +
  +AXIS_CPP_NAMESPACE_END
  \ No newline at end of file
  
  
  

Re: cvs commit: ws-axis/c/src/common AxisUtils.h AxisUtils.cpp

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
hi All,

The function "decodeFromBase64Binary" is currently available at the
SoapDeSerializer as a private method. But this method will be needed at
other place than the DeSerializer. For ex: A person who writes the
Attachement coding might need this.

So this method was added to the "AxisUtils.h" which has all the common
utility functions used by Axis C++. And I also propose to remove this
private method from the SoapDeSerializer and also that the DeSerializer
will also use this from this "AxisUtils.h".

Any issues?

Roshan

On Tue, 2005-01-18 at 16:48, roshan@apache.org wrote:
> roshan      2005/01/18 02:48:16
> 
>   Modified:    c/src/common AxisUtils.h AxisUtils.cpp
>   Log:
>   added the decodeFromBase64Binary method
>   
>   Revision  Changes    Path
>   1.18      +2 -0      ws-axis/c/src/common/AxisUtils.h
>   
>   Index: AxisUtils.h
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/c/src/common/AxisUtils.h,v
>   retrieving revision 1.17
>   retrieving revision 1.18
>   diff -u -r1.17 -r1.18
>   --- AxisUtils.h	23 Nov 2004 17:21:02 -0000	1.17
>   +++ AxisUtils.h	18 Jan 2005 10:48:15 -0000	1.18
>   @@ -20,6 +20,7 @@
>    #define AXIS_AXISUTILS_H__OF_AXIS_INCLUDED_
>    
>    #include <axis/GDefine.hpp>
>   +#include <axis/AxisUserAPI.hpp>
>    #include <string>
>    
>    using namespace std;
>   @@ -40,6 +41,7 @@
>        friend class TypeMapping;
>        friend class URIMapping;
>        public:
>   +	    xsd__base64Binary decodeFromBase64Binary(const AxisChar* pValue);
>            /*
>    	 * Converts the given character pointer value to lowercase.
>    	 * @param pchWord The character pointer to be converted.
>   
>   
>   
>   1.21      +16 -1     ws-axis/c/src/common/AxisUtils.cpp
>   
>   Index: AxisUtils.cpp
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/c/src/common/AxisUtils.cpp,v
>   retrieving revision 1.20
>   retrieving revision 1.21
>   diff -u -r1.20 -r1.21
>   --- AxisUtils.cpp	23 Nov 2004 17:21:02 -0000	1.20
>   +++ AxisUtils.cpp	18 Jan 2005 10:48:16 -0000	1.21
>   @@ -23,6 +23,7 @@
>    
>    #include "AxisUtils.h"
>    #include <axis/GDefine.hpp>
>   +#include "../soap/apr_base64.h"
>    
>    AXIS_CPP_NAMESPACE_START
>    
>   @@ -129,4 +130,18 @@
>        return NULL;
>    }
>    
>   -AXIS_CPP_NAMESPACE_END
>   +xsd__base64Binary AxisUtils::decodeFromBase64Binary(const AxisChar *pValue)
>   +{
>   +    xsd__base64Binary value;
>   +    value.__size = apr_base64_decode_len (pValue);
>   +    value.__ptr = new unsigned char[value.__size + 1];
>   +    value.__size = apr_base64_decode_binary (value.__ptr, pValue);
>   +    /* put null at the end because it enables the decoded string to be used
>   +     * as a string 
>   +     */
>   +    value.__ptr[value.__size] = 0;
>   +
>   +    return value;
>   +}
>   +
>   +AXIS_CPP_NAMESPACE_END
>   \ No newline at end of file
>   
>   
>   
>