axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: ws-axis/c/vc AxisClientDLL.dsp AxisServerDLL.dsp
Date Tue, 25 Jan 2005 13:32:40 GMT
dicka       2005/01/25 05:32:40

  Modified:    c/src/common BasicTypeSerializer.cpp BasicTypeSerializer.h
               c/src/soap Makefile.am SoapDeSerializer.cpp
                        SoapDeSerializer.h
               c/src/soap/xsd UnsignedInt.cpp
               c/vc     AxisClientDLL.dsp AxisServerDLL.dsp
  Added:       c/src/soap/xsd UnsignedShort.cpp UnsignedShort.hpp
  Log:
  Add UnsignedShort type to Simple types OO model.
  
  Submitted by: Adrian Dick
  
  Revision  Changes    Path
  1.46      +8 -6      ws-axis/c/src/common/BasicTypeSerializer.cpp
  
  Index: BasicTypeSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/BasicTypeSerializer.cpp,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- BasicTypeSerializer.cpp	25 Jan 2005 13:12:57 -0000	1.45
  +++ BasicTypeSerializer.cpp	25 Jan 2005 13:32:39 -0000	1.46
  @@ -78,9 +78,10 @@
               }
               break;
           case XSD_UNSIGNEDSHORT:
  -            AxisSprintf (m_Buf, BTS_BUFFSIZE, "%u", 
  -                *((unsigned short*)(pValue)));
  -            m_sSZ += m_Buf;
  +            {
  +                UnsignedShort unsignedShortSerializer;
  +                m_sSZ += unsignedShortSerializer.serialize(pValue);
  +            }
               break;
           case XSD_BYTE:
               {
  @@ -304,9 +305,10 @@
               }
               break;
           case XSD_UNSIGNEDSHORT:
  -            AxisSprintf (m_Buf, BTS_BUFFSIZE, "%u", 
  -                *((unsigned short*)(pValue)));
  -            m_sSZ += m_Buf;
  +            {
  +                UnsignedShort unsignedShortSerializer;
  +                m_sSZ += unsignedShortSerializer.serialize(pValue);
  +            }
               break;
           case XSD_BYTE:
               {
  
  
  
  1.30      +1 -0      ws-axis/c/src/common/BasicTypeSerializer.h
  
  Index: BasicTypeSerializer.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/BasicTypeSerializer.h,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- BasicTypeSerializer.h	25 Jan 2005 13:12:57 -0000	1.29
  +++ BasicTypeSerializer.h	25 Jan 2005 13:32:39 -0000	1.30
  @@ -51,6 +51,7 @@
   #include "../soap/xsd/NonNegativeInteger.hpp"
   #include "../soap/xsd/UnsignedLong.hpp"
   #include "../soap/xsd/UnsignedInt.hpp"
  +#include "../soap/xsd/UnsignedShort.hpp"
   
   using namespace std;
   
  
  
  
  1.26      +1 -0      ws-axis/c/src/soap/Makefile.am
  
  Index: Makefile.am
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/Makefile.am,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Makefile.am	25 Jan 2005 13:12:57 -0000	1.25
  +++ Makefile.am	25 Jan 2005 13:32:39 -0000	1.26
  @@ -44,6 +44,7 @@
           xsd/NonNegativeInteger.cpp \
           xsd/UnsignedLong.cpp \
           xsd/UnsignedInt.cpp \
  +        xsd/UnsignedShort.cpp \
           xsd/constraints/IConstrainingFacet.cpp \
           xsd/constraints/WhiteSpace.cpp \
           xsd/constraints/Pattern.cpp \
  
  
  
  1.134     +25 -14    ws-axis/c/src/soap/SoapDeSerializer.cpp
  
  Index: SoapDeSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.cpp,v
  retrieving revision 1.133
  retrieving revision 1.134
  diff -u -r1.133 -r1.134
  --- SoapDeSerializer.cpp	25 Jan 2005 13:12:57 -0000	1.133
  +++ SoapDeSerializer.cpp	25 Jan 2005 13:32:39 -0000	1.134
  @@ -880,6 +880,7 @@
   #define CONV_STRTONONNEGATIVEINTEGER(str) AxisSoapDeSerializerStringToNonNegativeInteger(str)
   #define CONV_STRTOUNSIGNEDLONG(str) AxisSoapDeSerializerStringToUnsignedLong(str)
   #define CONV_STRTOUNSIGNEDINT(str) AxisSoapDeSerializerStringToUnsignedInt(str)
  +#define CONV_STRTOUNSIGNEDSHORT(str) AxisSoapDeSerializerStringToUnsignedShort(str)
   #define CONV_STRTOBYTE(str) AxisSoapDeSerializerStringToByte(str)
   #define CONV_STRTOSHORT(str) AxisSoapDeSerializerStringToShort(str)
   #define CONV_STRTOINT(str) AxisSoapDeSerializerStringToInt(str)
  @@ -901,6 +902,12 @@
   #define CONV_STRTOQNAME(str) AxisSoapDeSerializerStringToQName(str)
   #define CONV_STRTONOTATION(str) AxisSoapDeSerializerStringToNotation(str)
   
  +unsigned short AxisSoapDeSerializerStringToUnsignedShort(const char *valueAsChar)
  +{
  +    UnsignedShort unsignedShortDeserializer;
  +    return *( unsignedShortDeserializer.deserializeUnsignedShort(valueAsChar));
  +}
  +
   unsigned int AxisSoapDeSerializerStringToUnsignedInt(const char *valueAsChar)
   {
       UnsignedInt unsignedIntDeserializer;
  @@ -1184,7 +1191,7 @@
   		    case XSD_SHORT:
   		    	DESERIALIZE_ENCODED_ARRAY_BLOCK (short,CONV_STRTOSHORT)
   		    case XSD_UNSIGNEDSHORT:
  -		    	DESERIALIZE_ENCODED_ARRAY_BLOCK(unsigned short, CONV_STRTOUL)
  +		    	DESERIALIZE_ENCODED_ARRAY_BLOCK(unsigned short, CONV_STRTOUNSIGNEDSHORT)
   		    case XSD_BYTE:
   		    	DESERIALIZE_ENCODED_ARRAY_BLOCK (char, CONV_STRTOBYTE)
   		    case XSD_UNSIGNEDBYTE:
  @@ -1271,7 +1278,7 @@
   		case XSD_SHORT:
   			DESERIALIZE_LITERAL_ARRAY_BLOCK (short, CONV_STRTOSHORT)
   		case XSD_UNSIGNEDSHORT:
  -			DESERIALIZE_LITERAL_ARRAY_BLOCK (unsigned short, CONV_STRTOUL)
  +			DESERIALIZE_LITERAL_ARRAY_BLOCK (unsigned short, CONV_STRTOUNSIGNEDSHORT)
   		case XSD_BYTE:
   			DESERIALIZE_LITERAL_ARRAY_BLOCK (char, CONV_STRTOBYTE)
   		case XSD_UNSIGNEDBYTE:
  @@ -2249,9 +2256,10 @@
   	    m_pNode = m_pParser->next (true);	/* charactor node */
   	    if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
   	    {
  -		ret = strtoul (m_pNode->m_pchNameOrValue, &m_pEndptr, 10);
  -		m_pNode = m_pParser->next ();	/* skip end element node too */
  -		return ret;
  +            UnsignedShort unsignedShortDeserializer;
  +            ret = *( unsignedShortDeserializer.deserializeUnsignedShort(m_pNode->m_pchNameOrValue));
  +    		m_pNode = m_pParser->next ();	/* skip end element node too */
  +    		return ret;
   	    }
   	}
   	else
  @@ -2274,13 +2282,14 @@
   	    m_pNode = m_pParser->next (true);	/* charactor node */
   	    if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
   	    {
  -		ret = strtoul (m_pNode->m_pchNameOrValue, &m_pEndptr, 10);
  -		m_pNode = m_pParser->next ();	/* skip end element node too */
  -		m_pNode = NULL;
  -		/* this is important in doc/lit style when deserializing 
  -		 * arrays
  -		 */
  -		return ret;
  +            UnsignedShort unsignedShortDeserializer;
  +            ret = *( unsignedShortDeserializer.deserializeUnsignedShort(m_pNode->m_pchNameOrValue));
  +    		m_pNode = m_pParser->next ();	/* skip end element node too */
  +    		m_pNode = NULL;
  +    		/* this is important in doc/lit style when deserializing 
  +    		 * arrays
  +    		 */
  +    		return ret;
   	    }
   	    else
   	    {
  @@ -4122,8 +4131,10 @@
           }
   	    break;
   	case XSD_UNSIGNEDSHORT:
  -	    *((unsigned short *) (pValue)) =
  -		strtoul (m_pNode->m_pchNameOrValue, &m_pEndptr, 10);
  +        {
  +            UnsignedShort unsignedShortDeserializer;
  +            pValue = unsignedShortDeserializer.deserialize(m_pNode->m_pchNameOrValue);
  +        }
   	    break;
   	case XSD_BYTE:
           {
  
  
  
  1.33      +1 -0      ws-axis/c/src/soap/SoapDeSerializer.h
  
  Index: SoapDeSerializer.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.h,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- SoapDeSerializer.h	25 Jan 2005 13:12:57 -0000	1.32
  +++ SoapDeSerializer.h	25 Jan 2005 13:32:39 -0000	1.33
  @@ -42,6 +42,7 @@
   #include "xsd/NonNegativeInteger.hpp"
   #include "xsd/UnsignedLong.hpp"
   #include "xsd/UnsignedInt.hpp"
  +#include "xsd/UnsignedShort.hpp"
   #include "../platforms/PlatformAutoSense.hpp"
   
   AXIS_CPP_NAMESPACE_START
  
  
  
  1.2       +1 -1      ws-axis/c/src/soap/xsd/UnsignedInt.cpp
  
  Index: UnsignedInt.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/UnsignedInt.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UnsignedInt.cpp	25 Jan 2005 13:12:58 -0000	1.1
  +++ UnsignedInt.cpp	25 Jan 2005 13:32:39 -0000	1.2
  @@ -24,7 +24,7 @@
   
   AxisChar* UnsignedInt::serialize(const unsigned int* value) throw (AxisSoapException)
   {
  -    unsigned LONGLONG valueAsLong = static_cast<unsigned long>(*value);
  +    unsigned long valueAsLong = static_cast<unsigned long>(*value);
       return UnsignedLong::serialize(&valueAsLong);
   }
   
  
  
  
  1.1                  ws-axis/c/src/soap/xsd/UnsignedShort.cpp
  
  Index: UnsignedShort.cpp
  ===================================================================
  #include "UnsignedShort.hpp"
  
  AXIS_CPP_NAMESPACE_START
  
  UnsignedShort::UnsignedShort():m_UnsignedShort(NULL)
  {
  }
  
  UnsignedShort::~UnsignedShort()
  {
      if (m_UnsignedShort)
          delete m_UnsignedShort;
  }
  
  AxisChar* UnsignedShort::serialize(const void* value) throw (AxisSoapException)
  {
      return serialize((unsigned int*) value);
  }
  
  void* UnsignedShort::deserializer(const AxisChar* valueAsChar) throw (AxisSoapException)
  {
      return (void*) deserializeUnsignedShort(valueAsChar);
  }
  
  AxisChar* UnsignedShort::serialize(const unsigned short* value) throw (AxisSoapException)
  {
      unsigned int valueAsInt = static_cast<unsigned int>(*value);
      return UnsignedInt::serialize(&valueAsInt);
  }
  
  unsigned short* UnsignedShort::deserializeUnsignedShort(const AxisChar* valueAsChar) throw
(AxisSoapException)
  {
      unsigned int* returnValue = UnsignedInt::deserializeUnsignedInt(valueAsChar);
   
      if(m_UnsignedShort)
      {
          delete m_UnsignedShort;
          m_UnsignedShort = NULL;
      }
      m_UnsignedShort = new unsigned short;
      *m_UnsignedShort = static_cast<unsigned short> (*returnValue);
      return m_UnsignedShort;
  }
  
  MaxInclusive* UnsignedShort::getMaxInclusive()
  {
     AxisChar* end;    
     LONGLONG* maxInclusive = new LONGLONG;
     *maxInclusive = strtol ("65535", &end, 10);
      
      MaxInclusive* retVal = new MaxInclusive(*maxInclusive);
      delete maxInclusive;
      return retVal;
  }
  
  AXIS_CPP_NAMESPACE_END
  
  
  
  1.1                  ws-axis/c/src/soap/xsd/UnsignedShort.hpp
  
  Index: UnsignedShort.hpp
  ===================================================================
  /* -*- C++ -*- */
  /*
   *   Copyright 2003-2004 The Apache Software Foundation.
   *
   *   Licensed under the Apache License, Version 2.0 (the "License");
   *   you may not use this file except in compliance with the License.
   *   You may obtain a copy of the License at
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *   limitations under the License.
   *
   *
   * @author Adrian Dick (adrian.dick@uk.ibm.com)
   *
   */
  
  #if !defined(_UNSIGNEDSHORT_HPP____OF_AXIS_INCLUDED_)
  #define _UNSIGNEDSHORT_HPP____OF_AXIS_INCLUDED_
  
  #include "UnsignedInt.hpp"
  
  AXIS_CPP_NAMESPACE_START
  
  using namespace std;
  
  class UnsignedShort : public UnsignedInt {
  public:
      
      /**
       * Constructor
       */
      UnsignedShort();
      
      /**
       * Destructor
       */
      ~UnsignedShort();
  
      /**
       * Serialize value to it's on-the-wire string form.
       * @param value The value to be serialized.
       * @return Serialized form of value.
       */  
      AxisChar* serialize(const void* value) throw (AxisSoapException);
  
      /**
       * Deserialize value from it's on-the-wire string form.
       * @param valueAsChar Serialized form of value.
       * @return Deserialized value.
       */  
      void* deserializer(const AxisChar* valueAsChar) throw (AxisSoapException);
  
      /**
       * Serialize UnsignedShort value to it's on-the-wire string form.
       * @param value The UnsignedShort value to be serialized.
       * @return Serialized form of UnsignedShort value.
       */  
      AxisChar* serialize(const unsigned short* value) throw (AxisSoapException);
    
    /**
     * Deserialized UnsignedShort value from it's on-the-wire string form.
     * @param valueAsChar Serialized form of UnsignedShort value.
     * @return Deserialized UnsignedShort value.
     */
      unsigned short* deserializeUnsignedShort(const AxisChar* valueAsChar) throw (AxisSoapException);
  
  protected:
  
      /**
       * Creates a MaxInclusive object.  For the UnsignedShort type this is
       * defined as 65535.
       * @return MaxInclusive object
       */
      virtual MaxInclusive* getMaxInclusive();
      
  private:
      unsigned short *m_UnsignedShort;
  };
  
  AXIS_CPP_NAMESPACE_END
  
  #endif
  
  
  
  1.36      +4 -0      ws-axis/c/vc/AxisClientDLL.dsp
  
  Index: AxisClientDLL.dsp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/vc/AxisClientDLL.dsp,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- AxisClientDLL.dsp	25 Jan 2005 13:12:58 -0000	1.35
  +++ AxisClientDLL.dsp	25 Jan 2005 13:32:39 -0000	1.36
  @@ -450,6 +450,10 @@
   # End Source File
   # Begin Source File
   
  +SOURCE=..\src\soap\xsd\UnsignedShort.cpp
  +# End Source File
  +# Begin Source File
  +
   SOURCE=..\src\soap\URIMapping.cpp
   # End Source File
   # Begin Source File
  
  
  
  1.35      +4 -0      ws-axis/c/vc/AxisServerDLL.dsp
  
  Index: AxisServerDLL.dsp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/vc/AxisServerDLL.dsp,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- AxisServerDLL.dsp	25 Jan 2005 13:12:58 -0000	1.34
  +++ AxisServerDLL.dsp	25 Jan 2005 13:32:39 -0000	1.35
  @@ -446,6 +446,10 @@
   # End Source File
   # Begin Source File
   
  +SOURCE=..\src\soap\xsd\UnsignedShort.cpp
  +# End Source File
  +# Begin Source File
  +
   SOURCE=..\src\soap\URIMapping.cpp
   # End Source File
   # Begin Source File
  
  
  

Mime
View raw message