ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: ws-axis/c/src/soap/xsd AnyURI.cpp AnyURI.hpp Base64Binary.cpp Base64Binary.hpp Boolean.cpp Boolean.hpp Date.cpp Date.hpp DateTime.cpp DateTime.hpp Decimal.cpp Decimal.hpp Double.cpp Double.hpp Duration.cpp Duration.hpp Float.cpp Float.hpp HexBinary.cpp HexBinary.hpp IAnySimpleType.cpp IAnySimpleType.hpp Int.cpp Int.hpp Integer.cpp Integer.hpp NOTATION.cpp NOTATION.hpp String.cpp String.hpp Time.cpp Time.hpp XSD_QName.cpp XSD_QName.hpp
Date Wed, 19 Jan 2005 15:22:38 GMT
dicka       2005/01/19 07:22:38

  Modified:    c/src/soap/xsd AnyURI.cpp AnyURI.hpp Base64Binary.cpp
                        Base64Binary.hpp Boolean.cpp Boolean.hpp Date.cpp
                        Date.hpp DateTime.cpp DateTime.hpp Decimal.cpp
                        Decimal.hpp Double.cpp Double.hpp Duration.cpp
                        Duration.hpp Float.cpp Float.hpp HexBinary.cpp
                        HexBinary.hpp IAnySimpleType.cpp IAnySimpleType.hpp
                        Int.cpp Int.hpp Integer.cpp Integer.hpp
                        NOTATION.cpp NOTATION.hpp String.cpp String.hpp
                        Time.cpp Time.hpp XSD_QName.cpp XSD_QName.hpp
  Log:
  Fix memory leaks in XSD objects.
  
  PR: AXISCPP-384
  Submitted by: Adrian Dick
  
  Revision  Changes    Path
  1.2       +21 -6     ws-axis/c/src/soap/xsd/AnyURI.cpp
  
  Index: AnyURI.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/AnyURI.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AnyURI.cpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ AnyURI.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +    AnyURI::AnyURI():m_AnyURI(NULL)
  +    {
  +    }
  +
       AxisChar* AnyURI::serialize(const void* value) throw (AxisSoapException)
       {
       	return serialize((AxisChar*) value);
  @@ -15,18 +19,29 @@
       AxisChar* AnyURI::serialize(const AxisChar* value) throw (AxisSoapException)
       {
   		AxisString valueAsString = value;
  -		AxisChar* returnValue = (AxisChar*) replaceReservedCharacters(valueAsString).c_str();
  +		AxisChar* serializedValue = (AxisChar*) replaceReservedCharacters(valueAsString).c_str();
   		
  -		m_Buf = new char[strlen (returnValue) + 1];
  -		strcpy (m_Buf, returnValue);
  +        if (m_Buf)
  +        {
  +            delete [] m_Buf;
  +            m_Buf = NULL;
  +        }
  +		m_Buf = new char[strlen (serializedValue) + 1];
  +		strcpy (m_Buf, serializedValue);
  +        delete [] serializedValue;
   		return m_Buf;
       }
   	
       AxisChar* AnyURI::deserializeAnyURI(const AxisChar* valueAsChar) throw (AxisSoapException)
       {
  -		m_Buf = new char[strlen (valueAsChar) + 1];
  -		strcpy (m_Buf, valueAsChar);
  -		return m_Buf;
  +        if (m_AnyURI)
  +        {
  +            delete [] m_AnyURI;
  +            m_AnyURI = NULL;
  +        }
  +		m_AnyURI = new char[strlen (valueAsChar) + 1];
  +		strcpy (m_AnyURI, valueAsChar);
  +		return m_AnyURI;
       }
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.2       +7 -2      ws-axis/c/src/soap/xsd/AnyURI.hpp
  
  Index: AnyURI.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/AnyURI.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AnyURI.hpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ AnyURI.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -31,6 +31,11 @@
   class AnyURI : public IAnySimpleType {
   public:
   
  +    /**
  +     * Constructor
  +     */
  +    AnyURI();
  +
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -58,9 +63,9 @@
   	 * @return Deserialized AnyURI value.
   	 */
       AxisChar* deserializeAnyURI(const AxisChar* valueAsChar) throw (AxisSoapException);
  -
  +    
   private:
  -	AxisChar* m_Buf;
  +    AxisChar* m_AnyURI;
   };
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.3       +11 -25    ws-axis/c/src/soap/xsd/Base64Binary.cpp
  
  Index: Base64Binary.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Base64Binary.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Base64Binary.cpp	18 Jan 2005 09:46:03 -0000	1.2
  +++ Base64Binary.cpp	19 Jan 2005 15:22:33 -0000	1.3
  @@ -2,24 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  -    Base64Binary::Base64Binary():m_Buf(NULL), m_base64Binary(NULL)
  +    Base64Binary::Base64Binary():m_Base64Binary(NULL)
       {
       }
       
  -    Base64Binary::~Base64Binary()
  -    {
  -        if (m_Buf)
  -        {
  -            delete [] m_Buf;
  -            m_Buf = NULL;
  -        }
  -        
  -        /**
  -         * Don't release storage for m_base64Binary as this is still needed by
  -         * by customer applications, under current memory model.
  -         */
  -    }
  -
       AxisChar* Base64Binary::serialize(const void* value) throw (AxisSoapException)
       {
       	return serialize((xsd__base64Binary*) value);
  @@ -44,27 +30,27 @@
           }
   	    m_Buf = new char[strlen (serializedValue) + 1];
   		strcpy (m_Buf, serializedValue);
  -        delete serializedValue;        
  +        delete [] serializedValue;        
   		return m_Buf;
       }
   	
       xsd__base64Binary* Base64Binary::deserializeBase64Binary(const AxisChar* valueAsChar)
throw (AxisSoapException)
       {
  -        if (m_base64Binary)
  +        if (m_Base64Binary)
           {
  -            delete [] m_base64Binary;
  -            m_base64Binary = NULL;
  +            delete [] m_Base64Binary;
  +            m_Base64Binary = NULL;
           }
  -    	m_base64Binary = new xsd__base64Binary();
  -	    m_base64Binary->__size = apr_base64_decode_len (valueAsChar);
  -	    m_base64Binary->__ptr = new unsigned char[m_base64Binary->__size + 1];
  -	    m_base64Binary->__size = apr_base64_decode_binary (m_base64Binary->__ptr, valueAsChar);
  +    	m_Base64Binary = new xsd__base64Binary();
  +	    m_Base64Binary->__size = apr_base64_decode_len (valueAsChar);
  +	    m_Base64Binary->__ptr = new unsigned char[m_Base64Binary->__size + 1];
  +	    m_Base64Binary->__size = apr_base64_decode_binary (m_Base64Binary->__ptr, valueAsChar);
   	    /* put null at the end because it enables the decoded string to be used
   	     * as a string 
   	     */
  -	    m_base64Binary->__ptr[m_base64Binary->__size] = 0;
  +	    m_Base64Binary->__ptr[m_Base64Binary->__size] = 0;
   	
  -	    return m_base64Binary;
  +	    return m_Base64Binary;
       }
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.3       +5 -5      ws-axis/c/src/soap/xsd/Base64Binary.hpp
  
  Index: Base64Binary.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Base64Binary.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Base64Binary.hpp	18 Jan 2005 09:46:03 -0000	1.2
  +++ Base64Binary.hpp	19 Jan 2005 15:22:33 -0000	1.3
  @@ -32,11 +32,12 @@
   
   class Base64Binary : public IAnySimpleType {
   public:
  -    
  +
  +    /**
  +     * Constructor
  +     */    
       Base64Binary();
       
  -    ~Base64Binary();
  -
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -66,8 +67,7 @@
       xsd__base64Binary* deserializeBase64Binary(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar* m_Buf;
  -	xsd__base64Binary* m_base64Binary;
  +	xsd__base64Binary* m_Base64Binary;
   };
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.2       +11 -1     ws-axis/c/src/soap/xsd/Boolean.cpp
  
  Index: Boolean.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Boolean.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Boolean.cpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Boolean.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -29,8 +29,18 @@
    */
   AxisChar* Boolean::serialize(const bool* value) throw (AxisSoapException)
   {
  -	AxisSprintf (m_Buf, 6, "%s",
  +    AxisChar* serializedValue = new char[6];
  +	AxisSprintf (serializedValue, 6, "%s",
               (*((int *) (value)) == false_) ? "false" : "true");
  +    
  +    if (m_Buf)
  +    {
  +        delete [] m_Buf;
  +        m_Buf = NULL;
  +    }
  +    m_Buf = new char[strlen (serializedValue) + 1];
  +    strcpy (m_Buf, serializedValue);
  +    delete [] serializedValue;        
       return m_Buf;
   }
   
  
  
  
  1.2       +0 -5      ws-axis/c/src/soap/xsd/Boolean.hpp
  
  Index: Boolean.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Boolean.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Boolean.hpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Boolean.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -32,7 +32,6 @@
   class Boolean : public IAnySimpleType {
   public:
   
  -	
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -60,10 +59,6 @@
   	 * @return Deserialized boolean value.
   	 */
       xsd__boolean deserializeBoolean(const AxisChar* valueAsChar) throw (AxisSoapException);
  -
  -private:
  -	AxisChar m_Buf[6];
  -
   };
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.2       +15 -0     ws-axis/c/src/soap/xsd/Date.cpp
  
  Index: Date.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Date.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Date.cpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Date.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +    Date::Date():m_Date(NULL)
  +    {
  +    }
  +
       AxisChar* Date::serialize(const void* value) throw (AxisSoapException)
       {
       	return serialize((struct tm*) value);
  @@ -17,8 +21,14 @@
       	AxisChar* serializedValue = new AxisChar[80];
       	strftime (serializedValue, 80, "%Y-%m-%dZ", value);
           
  +        if(m_Buf)
  +        {
  +            delete [] m_Buf;
  +            m_Buf = NULL;
  +        }
           m_Buf = new char[strlen (serializedValue) + 1];
   		strcpy (m_Buf, serializedValue);
  +        delete [] serializedValue;
   		return m_Buf;
       }
   	
  @@ -132,6 +142,11 @@
               pTm = gmtime (&timeInSecs);
           }
           
  +        if(m_Date)
  +        {
  +            delete m_Date;
  +            m_Date = NULL;
  +        }
           m_Date = new struct tm;
           memcpy (m_Date, pTm, sizeof (tm));
           return m_Date;
  
  
  
  1.2       +5 -1      ws-axis/c/src/soap/xsd/Date.hpp
  
  Index: Date.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Date.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Date.hpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Date.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -32,6 +32,11 @@
   class Date : public IAnySimpleType {
   public:
   
  +    /**
  +     * Constructor
  +     */
  +    Date();
  +    
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -61,7 +66,6 @@
       struct tm* deserializeDate(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar* m_Buf;
   	struct tm* m_Date;
   };
   
  
  
  
  1.3       +15 -0     ws-axis/c/src/soap/xsd/DateTime.cpp
  
  Index: DateTime.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/DateTime.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DateTime.cpp	13 Jan 2005 13:54:40 -0000	1.2
  +++ DateTime.cpp	19 Jan 2005 15:22:33 -0000	1.3
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +    DateTime::DateTime():m_DateTime(NULL)
  +    {
  +    }
  +
       AxisChar* DateTime::serialize(const void* value) throw (AxisSoapException)
       {
       	return serialize((struct tm*) value);
  @@ -17,8 +21,14 @@
       	AxisChar* serializedValue = new AxisChar[80];
       	strftime (serializedValue, 80, "%Y-%m-%dT%H:%M:%SZ", value);
           
  +        if(m_Buf)
  +        {
  +            delete [] m_Buf;
  +            m_Buf = NULL;
  +        }
           m_Buf = new char[strlen (serializedValue) + 1];
   		strcpy (m_Buf, serializedValue);
  +        delete [] serializedValue;
   		return m_Buf;
       }
   	
  @@ -142,6 +152,11 @@
               pTm = gmtime (&timeInSecs);
           }
           
  +        if(m_DateTime)
  +        {
  +            delete m_DateTime;
  +            m_DateTime = NULL;
  +        }
           m_DateTime = new struct tm;
           memcpy (m_DateTime, pTm, sizeof (tm));
           
  
  
  
  1.2       +5 -1      ws-axis/c/src/soap/xsd/DateTime.hpp
  
  Index: DateTime.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/DateTime.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DateTime.hpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ DateTime.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -32,6 +32,11 @@
   class DateTime : public IAnySimpleType {
   public:
   
  +    /**
  +     * Constructor
  +     */
  +    DateTime();
  +    
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -61,7 +66,6 @@
       struct tm* deserializeDateTime(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar* m_Buf;
   	struct tm* m_DateTime;
   };
   
  
  
  
  1.2       +21 -2     ws-axis/c/src/soap/xsd/Decimal.cpp
  
  Index: Decimal.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Decimal.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Decimal.cpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Decimal.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +Decimal::Decimal():m_Decimal(NULL)
  +{
  +}
  +
   AxisChar* Decimal::serialize(const void* value) throw (AxisSoapException)
   {
   	return serialize((double*) value);	
  @@ -15,14 +19,29 @@
   
   AxisChar* Decimal::serialize(const double* value) throw (AxisSoapException)
   {
  -	AxisSprintf (m_Buf, 80, "%f", *value);
  +    AxisChar* serializedValue = new char[80];
  +	AxisSprintf (serializedValue, 80, "%f", *value);
   	
  -	return m_Buf;
  +    if (m_Buf)
  +    {
  +        delete [] m_Buf;
  +        m_Buf = NULL;
  +    }
  +    m_Buf = new char[strlen (serializedValue) + 1];
  +    strcpy (m_Buf, serializedValue);
  +    delete serializedValue;        
  +    return m_Buf;
   }
   
   double* Decimal::deserializeDecimal(const AxisChar* valueAsChar) throw (AxisSoapException)
   {
   	AxisChar* end;
  +   
  +    if (m_Decimal)
  +    {
  +        delete m_Decimal;
  +        m_Decimal = NULL;
  +    }
   	m_Decimal = new double;
   	*m_Decimal = strtod (valueAsChar, &end);
   	
  
  
  
  1.2       +5 -1      ws-axis/c/src/soap/xsd/Decimal.hpp
  
  Index: Decimal.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Decimal.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Decimal.hpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Decimal.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -31,6 +31,11 @@
   class Decimal : public IAnySimpleType {
   public:
   
  +    /**
  +     * Constructor
  +     */
  +    Decimal();
  +    
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -60,7 +65,6 @@
       double* deserializeDecimal(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar m_Buf[80];
   	double* m_Decimal;
   };
   
  
  
  
  1.2       +21 -2     ws-axis/c/src/soap/xsd/Double.cpp
  
  Index: Double.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Double.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Double.cpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Double.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +Double::Double():m_Double(NULL)
  +{
  +}
  +
   AxisChar* Double::serialize(const void* value) throw (AxisSoapException)
   {
   	return serialize((double*) value);	
  @@ -15,14 +19,29 @@
   
   AxisChar* Double::serialize(const double* value) throw (AxisSoapException)
   {
  -	AxisSprintf (m_Buf, 80, "%f", *value);
  +    AxisChar* serializedValue = new char[80];
  +    AxisSprintf (serializedValue, 80, "%f", *value);
   	
  -	return m_Buf;
  +	if (m_Buf)
  +    {
  +        delete [] m_Buf;
  +        m_Buf = NULL;
  +    }
  +    m_Buf = new char[strlen (serializedValue) + 1];
  +    strcpy (m_Buf, serializedValue);
  +    delete serializedValue;        
  +    return m_Buf;
   }
   
   double* Double::deserializeDouble(const AxisChar* valueAsChar) throw (AxisSoapException)
   {
   	AxisChar* end;
  +   
  +    if (m_Double)
  +    {
  +        delete m_Double;
  +        m_Double = NULL;
  +    }
   	m_Double = new double;
   	*m_Double = strtod (valueAsChar, &end);
   	
  
  
  
  1.2       +5 -1      ws-axis/c/src/soap/xsd/Double.hpp
  
  Index: Double.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Double.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Double.hpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Double.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -31,6 +31,11 @@
   class Double : public IAnySimpleType {
   public:
   
  +    /**
  +     * Constructor
  +     */
  +    Double();
  +
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -60,7 +65,6 @@
       double* deserializeDouble(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar m_Buf[80];
   	double* m_Double;
   };
   
  
  
  
  1.2       +16 -0     ws-axis/c/src/soap/xsd/Duration.cpp
  
  Index: Duration.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Duration.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Duration.cpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Duration.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +    Duration::Duration():m_Duration(NULL)
  +    {
  +    }
  +
       AxisChar* Duration::serialize(const void* value) throw (AxisSoapException)
       {
       	return serialize((long*) value);
  @@ -72,6 +76,12 @@
   
   		// Convert from String to Char[]	
   		AxisChar* returnValue = (AxisChar*) serializedValue.c_str ();
  +       
  +        if(m_Buf)
  +        {
  +            delete [] m_Buf;
  +            m_Buf = NULL;
  +        }
   		m_Buf = new char[strlen (returnValue) + 1];
   		strcpy (m_Buf, returnValue);
   		return m_Buf;
  @@ -82,6 +92,12 @@
       	AxisString valueAsString = valueAsChar;
       	AxisString buff;
   	    unsigned int intPos1, intPos2, intPos3, intPos4, intPos5, intPos6;
  +
  +        if (m_Duration)
  +        {
  +            delete m_Duration;
  +            m_Duration = NULL;
  +        }
   	
   	    /*XSD_DURATION is of the format PnYnMnDTnHnMnS */
   
  
  
  
  1.2       +5 -1      ws-axis/c/src/soap/xsd/Duration.hpp
  
  Index: Duration.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Duration.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Duration.hpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Duration.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -32,6 +32,11 @@
   class Duration : public IAnySimpleType {
   public:
   
  +    /**
  +     * Constructor
  +     */
  +    Duration();
  +
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -61,7 +66,6 @@
       long* deserializeDuration(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar* m_Buf;
   	long* m_Duration;
   };
   
  
  
  
  1.2       +16 -3     ws-axis/c/src/soap/xsd/Float.cpp
  
  Index: Float.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Float.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Float.cpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Float.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +Float::Float():m_Float(NULL)
  +{
  +}
  +
   AxisChar* Float::serialize(const void* value) throw (AxisSoapException)
   {
   	return serialize((float*) value);	
  @@ -15,9 +19,18 @@
   
   AxisChar* Float::serialize(const float* value) throw (AxisSoapException)
   {
  -	AxisSprintf (m_Buf, 80, "%f", *value);
  -	
  -	return m_Buf;
  +    AxisChar* serializedValue = new char[80];
  +    AxisSprintf (serializedValue, 80, "%f", *value);
  +  
  +    if (m_Buf)
  +    {
  +        delete [] m_Buf;
  +        m_Buf = NULL;
  +    }
  +    m_Buf = new char[strlen (serializedValue) + 1];
  +    strcpy (m_Buf, serializedValue);
  +    delete serializedValue;        
  +    return m_Buf;
   }
   
   float* Float::deserializeFloat(const AxisChar* valueAsChar) throw (AxisSoapException)
  
  
  
  1.2       +5 -1      ws-axis/c/src/soap/xsd/Float.hpp
  
  Index: Float.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Float.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Float.hpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ Float.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -31,6 +31,11 @@
   class Float : public IAnySimpleType {
   public:
   
  +    /**
  +     * Constructor
  +     */
  +    Float();
  +
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -60,7 +65,6 @@
       float* deserializeFloat(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar m_Buf[80];
   	float* m_Float;
   };
   
  
  
  
  1.5       +10 -27    ws-axis/c/src/soap/xsd/HexBinary.cpp
  
  Index: HexBinary.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/HexBinary.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HexBinary.cpp	18 Jan 2005 09:17:11 -0000	1.4
  +++ HexBinary.cpp	19 Jan 2005 15:22:33 -0000	1.5
  @@ -2,27 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  -HexBinary::HexBinary()
  -:m_Buf(NULL), m_hexBinary(NULL)
  -{
  -}
  -
  -HexBinary::~HexBinary()
  -{
  -    if (m_Buf)
  +    HexBinary::HexBinary():m_HexBinary(NULL)
       {
  -        delete [] m_Buf;
  -        m_Buf = NULL;
       }
   
  -    // Samisa: should not release m_hexBinary, as this is used by the deserializer and
  -    // according to our current memory management semantics, this is deallocated at
  -    // user written client code level. If we are to delete it here (which I think is the
better way)
  -    // we have to change the memory management semantics and updated the docs accordingly
  -    
  -}
  -
  -
       AxisChar* HexBinary::serialize(const void* value) throw (AxisSoapException)
       {
       	return serialize((xsd__hexBinary*) value);
  @@ -54,22 +37,22 @@
   	
       xsd__hexBinary* HexBinary::deserializeHexBinary(const AxisChar* valueAsChar) throw
(AxisSoapException)
       {
  -        if (m_hexBinary) // Samisa : memory management BP
  +        if (m_HexBinary) // Samisa : memory management BP
           {
  -            delete [] m_hexBinary;
  -            m_hexBinary = NULL;
  +            delete [] m_HexBinary;
  +            m_HexBinary = NULL;
           }
   
  -    	m_hexBinary = new xsd__hexBinary();    	
  -	    m_hexBinary->__size = strlen (valueAsChar) / 2;
  -	    m_hexBinary->__ptr = new unsigned char[m_hexBinary->__size + 1];
  -	    Hex_Decode (m_hexBinary->__ptr, valueAsChar);
  +    	m_HexBinary = new xsd__hexBinary();    	
  +	    m_HexBinary->__size = strlen (valueAsChar) / 2;
  +	    m_HexBinary->__ptr = new unsigned char[m_HexBinary->__size + 1];
  +	    Hex_Decode (m_HexBinary->__ptr, valueAsChar);
   	    /* put null at the end because it enables the decoded string to be used
   	     * as a string 
   	     */
  -	    m_hexBinary->__ptr[m_hexBinary->__size] = 0;
  +	    m_HexBinary->__ptr[m_HexBinary->__size] = 0;
   
  -	    return m_hexBinary;
  +	    return m_HexBinary;
       }
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.3       +2 -7      ws-axis/c/src/soap/xsd/HexBinary.hpp
  
  Index: HexBinary.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/HexBinary.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HexBinary.hpp	18 Jan 2005 08:38:46 -0000	1.2
  +++ HexBinary.hpp	19 Jan 2005 15:22:33 -0000	1.3
  @@ -32,16 +32,12 @@
   
   class HexBinary : public IAnySimpleType {
   public:
  +
      /**
       * Constructor.
       */
       HexBinary();
   
  -   /**
  -    * Destructor.
  -    */
  -    virtual ~HexBinary();
  -
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -71,8 +67,7 @@
       xsd__hexBinary* deserializeHexBinary(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar* m_Buf;
  -	xsd__hexBinary* m_hexBinary;
  +	xsd__hexBinary* m_HexBinary;
   };
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.2       +13 -0     ws-axis/c/src/soap/xsd/IAnySimpleType.cpp
  
  Index: IAnySimpleType.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/IAnySimpleType.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IAnySimpleType.cpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ IAnySimpleType.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,19 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +IAnySimpleType::IAnySimpleType():m_Buf(NULL)
  +{
  +}
  +
  +IAnySimpleType::~IAnySimpleType()
  +{
  +    if (m_Buf)
  +    {
  +        delete [] m_Buf;
  +        m_Buf = NULL;
  +    }
  +}
  +
   const AxisString& IAnySimpleType::replaceReservedCharacters(AxisString &value)
   {
       m_strReturnVal = "";
  
  
  
  1.2       +34 -7     ws-axis/c/src/soap/xsd/IAnySimpleType.hpp
  
  Index: IAnySimpleType.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/IAnySimpleType.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IAnySimpleType.hpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ IAnySimpleType.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -27,18 +27,24 @@
   
   AXIS_CPP_NAMESPACE_START
   
  -const AxisChar XML_ENTITY_REFERENCE_CHARS[]    = "<>&\"\'";
   /* Entity reference characters */
  -const AxisChar ENCODED_LESSER_STR[]            = "&lt;";    
  +const AxisChar XML_ENTITY_REFERENCE_CHARS[]    = "<>&\"\'";
  +
   /* Encoded string for less than character */
  -const AxisChar ENCODED_GREATER_STR[]        = "&gt;";    
  +const AxisChar ENCODED_LESSER_STR[]            = "&lt;";    
  +
   /* Encoded string for greator than character */
  -const AxisChar ENCODED_AMPERSAND_STR[]        = "&amp;";    
  +const AxisChar ENCODED_GREATER_STR[]        = "&gt;";    
  +
   /* Encoded string for ampersand character */
  -const AxisChar ENCODED_DBL_QUOTE_STR[]        = "&quot;";    
  +const AxisChar ENCODED_AMPERSAND_STR[]        = "&amp;";    
  +
   /* Encoded string for single quote character */
  -const AxisChar ENCODED_SGL_QUOTE_STR[]        = "&apos;";    
  +const AxisChar ENCODED_DBL_QUOTE_STR[]        = "&quot;";    
  +
   /* Encoded string for double quote character */
  +const AxisChar ENCODED_SGL_QUOTE_STR[]        = "&apos;";    
  +
   
   
   /**
  @@ -51,7 +57,16 @@
   class IAnySimpleType {
   public:
   
  -	virtual ~IAnySimpleType() {};
  +    /**
  +     * Constructor
  +     */
  +    IAnySimpleType();
  +    
  +    /**
  +     * Destructor
  +     */
  +    virtual ~IAnySimpleType();
  +
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -67,7 +82,17 @@
       virtual void* deserialize(const AxisChar* valueAsChar) throw (AxisSoapException) =
0;
       
   protected:
  +
  +    /**
  +     * Replace all XML reserved characters in string
  +     * @param value Original string
  +     * @return String with all reserved characters replaced
  +     */
       const AxisString& replaceReservedCharacters(AxisString& value);
  +
  +    /**
  +     * Reserved Characters
  +     */
       enum
       {
           GREATER_THAN_CHAR    =    L'>',    /* Greater than character */
  @@ -76,6 +101,8 @@
           DOUBLE_QUOTE_CHAR    =    L'\"',    /* Double quotation character */
           AMPERSAND_CHAR        =    L'&'    /* Ampersand character */
       };
  +
  +    AxisChar* m_Buf;
       
   private:
       AxisString m_strReturnVal;
  
  
  
  1.3       +13 -3     ws-axis/c/src/soap/xsd/Int.cpp
  
  Index: Int.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Int.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Int.cpp	18 Jan 2005 15:42:54 -0000	1.2
  +++ Int.cpp	19 Jan 2005 15:22:33 -0000	1.3
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +Int::Int():m_Int(NULL)
  +{
  +}
  +
   AxisChar* Int::serialize(const void* value) throw (AxisSoapException)
   {
       return serialize((int*) value);
  @@ -21,9 +25,15 @@
   int* Int::deserializeInt(const AxisChar* valueAsChar) throw (AxisSoapException)
   {
       LONGLONG* returnValue = Long::deserializeLong(valueAsChar);
  -    m_int = new int;
  -    *m_int = static_cast<int> (*returnValue);
  -    return m_int;
  + 
  +    if(m_Int)
  +    {
  +        delete m_Int;
  +        m_Int = NULL;
  +    }
  +    m_Int = new int;
  +    *m_Int = static_cast<int> (*returnValue);
  +    return m_Int;
   }
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.3       +33 -13    ws-axis/c/src/soap/xsd/Int.hpp
  
  Index: Int.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Int.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Int.hpp	18 Jan 2005 15:42:54 -0000	1.2
  +++ Int.hpp	19 Jan 2005 15:22:33 -0000	1.3
  @@ -30,22 +30,42 @@
   
   class Int : public Long {
   public:
  +
  +    /**
  +     * Constructor
  +     */
  +    Int();
  +
  +    /**
  +     * 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 Int value to it's on-the-wire string form.
  +     * @param value The Int value to be serialized.
  +     * @return Serialized form of Int value.
  +     */  
  +    AxisChar* serialize(const int* value) throw (AxisSoapException);
     
  -  AxisChar* serialize(const void* value) throw (AxisSoapException);
  -  
  -  void* deserializer(const AxisChar* valueAsChar) throw (AxisSoapException);
  -  
  -  AxisChar* serialize(const int* value) throw (AxisSoapException);
  -  
  -  /**
  -   * Deserialized Int value from it's on-the-wire string form.
  -   * @param valueAsChar Serialized form of Int value.
  -   * @return Deserialized Int value.
  -   */
  -  int* deserializeInt(const AxisChar* valueAsChar) throw (AxisSoapException);
  +    /**
  +     * Deserialized Int value from it's on-the-wire string form.
  +     * @param valueAsChar Serialized form of Int value.
  +     * @return Deserialized Int value.
  +     */
  +    int* deserializeInt(const AxisChar* valueAsChar) throw (AxisSoapException);
       
   private:
  -    int* m_int;
  +    int* m_Int;
   };
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.2       +21 -1     ws-axis/c/src/soap/xsd/Integer.cpp
  
  Index: Integer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Integer.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Integer.cpp	14 Jan 2005 13:42:20 -0000	1.1
  +++ Integer.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +Integer::Integer():m_Integer(NULL)
  +{
  +}
  +
   AxisChar* Integer::serialize(const void* value) throw (AxisSoapException)
   {
       return serialize((LONGLONG*) value);  
  @@ -15,13 +19,29 @@
   
   AxisChar* Integer::serialize(const LONGLONG* value) throw (AxisSoapException)
   {
  -    AxisSprintf (m_Buf, 80, "%lld", *value);
  +    AxisChar* serializedValue = new char[80];
  +    AxisSprintf (serializedValue, 80, "%lld", *value);
  +  
  +    if (m_Buf)
  +    {
  +        delete [] m_Buf;
  +        m_Buf = NULL;
  +    }
  +    m_Buf = new char[strlen (serializedValue) + 1];
  +    strcpy (m_Buf, serializedValue);
  +    delete serializedValue;        
       return m_Buf;
   }
   
   LONGLONG* Integer::deserializeInteger(const AxisChar* valueAsChar) throw (AxisSoapException)
   {
       AxisChar* end;
  +    
  +    if(m_Integer)
  +    {
  +        delete m_Integer;
  +        m_Integer = NULL;
  +    }
       m_Integer = new LONGLONG;
       *m_Integer = strtol (valueAsChar, &end, 10);
     
  
  
  
  1.2       +22 -18    ws-axis/c/src/soap/xsd/Integer.hpp
  
  Index: Integer.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Integer.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Integer.hpp	14 Jan 2005 13:42:20 -0000	1.1
  +++ Integer.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -33,35 +33,39 @@
   public:
   
       /**
  -    * Serialize value to it's on-the-wire string form.
  -    * @param value The value to be serialized.
  -    * @return Serialized form of value.
  -   */
  +     * Constructor
  +     */
  +    Integer();
  +
  +    /**
  +     * 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.
  +    /**
  +     * Deserialize value from it's on-the-wire string form.
  +     * @param valueAsChar Serialized form of value.
  +     * @return Deserialized value.
        */
       void* deserialize(const AxisChar* valueAsChar) throw (AxisSoapException);
       
  -  /**
  -    * Serialize Integer value to it's on-the-wire string form.
  -    * @param value The Integer value to be serialized.
  -    * @return Serialized form of Integer value.
  -   */
  +    /**
  +     * Serialize Integer value to it's on-the-wire string form.
  +     * @param value The Integer value to be serialized.
  +     * @return Serialized form of Integer value.
  +     */
       AxisChar* serialize(const LONGLONG* value) throw (AxisSoapException);
     
  -  /**
  -    * Deserialized Integer value from it's on-the-wire string form.
  -   * @param valueAsChar Serialized form of Integer value.
  -    * @return Deserialized Integer value.
  +    /**
  +     * Deserialized Integer value from it's on-the-wire string form.
  +     * @param valueAsChar Serialized form of Integer value.
  +     * @return Deserialized Integer value.
        */
       LONGLONG* deserializeInteger(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -   AxisChar m_Buf[80];
      LONGLONG* m_Integer;
   };
   
  
  
  
  1.2       +18 -4     ws-axis/c/src/soap/xsd/NOTATION.cpp
  
  Index: NOTATION.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/NOTATION.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NOTATION.cpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ NOTATION.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +NOTATION::NOTATION():m_NOTATION(NULL)
  +{
  +}
  +
   AxisChar* NOTATION::serialize(const void* value) throw (AxisSoapException)
   {
   	return serialize((AxisChar*) value);
  @@ -16,7 +20,12 @@
   {
   	AxisString valueAsString = value;
   	AxisChar* returnValue = (AxisChar*) replaceReservedCharacters(valueAsString).c_str();
  -	
  +
  +    if(m_Buf)
  +    {
  +        delete [] m_Buf;
  +        m_Buf = NULL;
  +    }	
   	m_Buf = new char[strlen (returnValue) + 1];
   	strcpy (m_Buf, returnValue);
   	return m_Buf;
  @@ -24,9 +33,14 @@
   
   AxisChar* NOTATION::deserializeNOTATION(const AxisChar* valueAsChar) throw (AxisSoapException)
   {
  -	m_Buf = new char[strlen (valueAsChar) + 1];
  -	strcpy (m_Buf, valueAsChar);
  -	return m_Buf;
  +    if (m_NOTATION)
  +    {
  +        delete [] m_NOTATION;
  +        m_NOTATION = NULL;
  +    }
  +	m_NOTATION = new char[strlen (valueAsChar) + 1];
  +	strcpy (m_NOTATION, valueAsChar);
  +	return m_NOTATION;
   }
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.2       +29 -2     ws-axis/c/src/soap/xsd/NOTATION.hpp
  
  Index: NOTATION.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/NOTATION.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NOTATION.hpp	10 Jan 2005 17:18:33 -0000	1.1
  +++ NOTATION.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -31,14 +31,41 @@
   class NOTATION : public IAnySimpleType {
   public:
   
  +    /**
  +     * Constructor
  +     */
  +    NOTATION();
  +
  +    /**
  +     * 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* deserialize(const AxisChar* valueAsChar) throw (AxisSoapException);
  -	
  +
  +    /**
  +     * Serialize NOTATION value to it's on-the-wire string form.
  +     * @param value The NOTATION value to be serialized.
  +     * @return Serialized form of NOTATION value.
  +     */	
   	AxisChar* serialize(const AxisChar* value) throw (AxisSoapException);
  +
  +    /**
  +     * Deserialized NOTATION value from it's on-the-wire string form.
  +     * @param valueAsChar Serialized form of NOTATION value.
  +     * @return Deserialized NOTATION value.
  +     */
   	AxisChar* deserializeNOTATION(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar* m_Buf;
  +    AxisChar* m_NOTATION;
   };
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.2       +18 -4     ws-axis/c/src/soap/xsd/String.cpp
  
  Index: String.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/String.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- String.cpp	10 Jan 2005 17:18:34 -0000	1.1
  +++ String.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +String::String():m_String(NULL)
  +{
  +}
  +
   AxisChar* String::serialize(const void* value) throw (AxisSoapException)
   {
   	return serialize((AxisChar*) value);
  @@ -16,7 +20,12 @@
   {
   	AxisString valueAsString = value;
   	AxisChar* returnValue = (AxisChar*) replaceReservedCharacters(valueAsString).c_str();
  -	
  +
  +    if (m_Buf)
  +    {
  +        delete [] m_Buf;
  +        m_Buf = NULL;
  +    }	
   	m_Buf = new char[strlen (returnValue) + 1];
   	strcpy (m_Buf, returnValue);
   	return m_Buf;
  @@ -24,9 +33,14 @@
   
   AxisChar* String::deserializeString(const AxisChar* valueAsChar) throw (AxisSoapException)
   {
  -	m_Buf = new char[strlen (valueAsChar) + 1];
  -	strcpy (m_Buf, valueAsChar);
  -	return m_Buf;
  +    if (m_String)
  +    {
  +        delete [] m_String;
  +        m_String = NULL;
  +    }
  +	m_String = new char[strlen (valueAsChar) + 1];
  +	strcpy (m_String, valueAsChar);
  +	return m_String;
   }
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.2       +29 -3     ws-axis/c/src/soap/xsd/String.hpp
  
  Index: String.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/String.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- String.hpp	10 Jan 2005 17:18:34 -0000	1.1
  +++ String.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -31,15 +31,41 @@
   class String : public IAnySimpleType {
   public:
   
  +    /**
  +     * Constructor
  +     */
  +    String();
   	
  +    /**
  +     * 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* deserialize(const AxisChar* valueAsChar) throw (AxisSoapException);
  -	
  +
  +    /**
  +     * Serialize String value to it's on-the-wire string form.
  +     * @param value The String value to be serialized.
  +     * @return Serialized form of String value.
  +     */	
   	AxisChar* serialize(const AxisChar* value) throw (AxisSoapException);
  -	AxisChar* deserializeString(const AxisChar* valueAsChar) throw (AxisSoapException);
   
  +    /**
  +     * Deserialized String value from it's on-the-wire string form.
  +     * @param valueAsChar Serialized form of String value.
  +     * @return Deserialized String value.
  +     */
  +	AxisChar* deserializeString(const AxisChar* valueAsChar) throw (AxisSoapException);
  +  
   private:
  -	AxisChar* m_Buf;
  +    AxisChar* m_String;
   };
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.2       +16 -1     ws-axis/c/src/soap/xsd/Time.cpp
  
  Index: Time.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Time.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Time.cpp	10 Jan 2005 17:18:34 -0000	1.1
  +++ Time.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +    Time::Time():m_Time(NULL)
  +    {
  +    }
  +
       AxisChar* Time::serialize(const void* value) throw (AxisSoapException)
       {
       	return serialize((struct tm*) value);
  @@ -16,7 +20,12 @@
       {
       	AxisChar* serializedValue = new AxisChar[80];
       	strftime (serializedValue, 80, "%H:%M:%SZ", value);
  -        
  +     
  +        if (m_Buf)
  +        {   
  +            delete [] m_Buf;
  +            m_Buf = NULL;
  +        }
           m_Buf = new char[strlen (serializedValue) + 1];
   		strcpy (m_Buf, serializedValue);
   		return m_Buf;
  @@ -141,6 +150,12 @@
   
                   pTm = gmtime (&timeInSecs);
               }
  +
  +        if(m_Time)
  +        {
  +            delete m_Time;
  +            m_Time = NULL;
  +        }
       	
       	m_Time = new struct tm;
   		memcpy (m_Time, pTm, sizeof (tm));
  
  
  
  1.2       +5 -1      ws-axis/c/src/soap/xsd/Time.hpp
  
  Index: Time.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Time.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Time.hpp	10 Jan 2005 17:18:34 -0000	1.1
  +++ Time.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -32,6 +32,11 @@
   class Time : public IAnySimpleType {
   public:
   
  +    /**
  +     * Constructor
  +     */
  +    Time();
  +
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -61,7 +66,6 @@
       struct tm* deserializeTime(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar* m_Buf;
   	struct tm* m_Time;
   };
   
  
  
  
  1.2       +7 -3      ws-axis/c/src/soap/xsd/XSD_QName.cpp
  
  Index: XSD_QName.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/XSD_QName.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XSD_QName.cpp	10 Jan 2005 17:18:34 -0000	1.1
  +++ XSD_QName.cpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -2,6 +2,10 @@
   
   AXIS_CPP_NAMESPACE_START
   
  +    XSD_QName::XSD_QName():m_QName(NULL)
  +    {
  +    }
  +
       AxisChar* XSD_QName::serialize(const void* value) throw (AxisSoapException)
       {
       	return serialize((AxisChar*) value);
  @@ -24,9 +28,9 @@
   	
       AxisChar* XSD_QName::deserializeQName(const AxisChar* valueAsChar) throw (AxisSoapException)
       {
  -		m_Buf = new char[strlen (valueAsChar) + 1];
  -		strcpy (m_Buf, valueAsChar);
  -		return m_Buf;
  +		m_QName = new char[strlen (valueAsChar) + 1];
  +		strcpy (m_QName, valueAsChar);
  +		return m_QName;
       }
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.2       +8 -1      ws-axis/c/src/soap/xsd/XSD_QName.hpp
  
  Index: XSD_QName.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/XSD_QName.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XSD_QName.hpp	10 Jan 2005 17:18:34 -0000	1.1
  +++ XSD_QName.hpp	19 Jan 2005 15:22:33 -0000	1.2
  @@ -30,6 +30,12 @@
   
   class XSD_QName : public IAnySimpleType {
   public:
  +
  +    /**
  +     * Constructor
  +     */
  +    XSD_QName();
  +
   	/**
   	 * Serialize value to it's on-the-wire string form.
   	 * @param value The value to be serialized.
  @@ -59,7 +65,8 @@
       AxisChar* deserializeQName(const AxisChar* valueAsChar) throw (AxisSoapException);
   
   private:
  -	AxisChar* m_Buf;
  +    AxisChar* m_QName;
  +
   };
   
   AXIS_CPP_NAMESPACE_END
  
  
  

Mime
View raw message