Return-Path: Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 65300 invoked by uid 500); 1 Jul 2003 16:53:54 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@ws.apache.org Delivered-To: moderator for axis-dev@ws.apache.org Received: (qmail 20456 invoked by uid 500); 1 Jul 2003 03:44:40 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 1 Jul 2003 03:44:39 -0000 Message-ID: <20030701034439.64830.qmail@icarus.apache.org> From: susantha@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/c/src/common Param.h Param.cpp BasicTypeSerializer.h BasicTypeSerializer.cpp X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N susantha 2003/06/30 20:44:39 Modified: c/src/common Param.h Param.cpp BasicTypeSerializer.h BasicTypeSerializer.cpp Log: some improvements to handler other basic types Revision Changes Path 1.3 +2 -1 xml-axis/c/src/common/Param.h Index: Param.h =================================================================== RCS file: /home/cvs/xml-axis/c/src/common/Param.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Param.h 30 Jun 2003 03:59:44 -0000 1.2 +++ Param.h 1 Jul 2003 03:44:39 -0000 1.3 @@ -119,13 +119,14 @@ public: //Conversion functions int SetValue(string& sValue); XSDTYPE GetType() const; - const string& ToString(); int serialize(string& sSerialized); //Following functions are used by wrapper class methods making sure of the valid type. int GetInt(); float GetFloat(); const string& GetString(); + const string& GetHexString(); + const string& GetBase64String(); const AccessBean* GetUserType() const; void setPrefix(const string &prefix); void setUri(const string &uri); 1.3 +36 -19 xml-axis/c/src/common/Param.cpp Index: Param.cpp =================================================================== RCS file: /home/cvs/xml-axis/c/src/common/Param.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Param.cpp 30 Jun 2003 03:59:44 -0000 1.2 +++ Param.cpp 1 Jul 2003 03:44:39 -0000 1.3 @@ -165,6 +165,34 @@ return m_sValue; } +const string& Param::GetHexString() +{ + if (m_Type == XSD_HEXBINARY){} + else if (m_Type == XSD_UNKNOWN) //see GetInt() to see why we do this + { + m_Type = XSD_HEXBINARY; + } + else + { + //exception + } + return m_sValue; +} + +const string& Param::GetBase64String() +{ + if (m_Type == XSD_BASE64BINARY){} + else if (m_Type == XSD_UNKNOWN) //see GetInt() to see why we do this + { + m_Type = XSD_BASE64BINARY; + } + else + { + //exception + } + return m_sValue; +} + int Param::GetInt() { if (m_Type == XSD_INT){} @@ -199,25 +227,6 @@ return m_Value.f; } -//This function may be called only for basic types -const string& Param::ToString() -{ - if (m_Type == XSD_STRING) return m_sValue; - switch (m_Type) - { - case XSD_INT: - sprintf(m_Buf,"%d", m_Value.n); - break; - case XSD_FLOAT: - sprintf(m_Buf,"%f", m_Value.f); - break; - //Continue this for all basic types - default:; //this is an unexpected situation - } - m_sValue = m_Buf; - return m_sValue; -} - XSDTYPE Param::GetType() const { return m_Type; @@ -235,6 +244,12 @@ case XSD_STRING: m_sSZ = BasicTypeSerializer::serialize(m_sName, m_sValue); break; + case XSD_HEXBINARY: + m_sSZ = BasicTypeSerializer::serialize(m_sName, m_sValue, XSD_HEXBINARY); + break; + case XSD_BASE64BINARY: + m_sSZ = BasicTypeSerializer::serialize(m_sName, m_sValue, XSD_BASE64BINARY); + break; case XSD_ARRAY: //m_sSZ = ""; - if (m_Type == XSD_STRING) + switch (m_Type) { + case XSD_STRING: m_sSZ = sValue.c_str(); - } - else - { + break; + default: m_sSZ += m_Buf; } m_sSZ += "