axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sanj...@apache.org
Subject cvs commit: ws-axis/c/src/soap URIMapping.h XercesHandler.cpp XercesHandler.h
Date Thu, 08 Apr 2004 12:47:11 GMT
sanjaya     2004/04/08 05:47:11

  Modified:    c/src/soap URIMapping.h XercesHandler.cpp XercesHandler.h
  Log:
  Applied coding conventions
  
  Revision  Changes    Path
  1.11      +28 -72    ws-axis/c/src/soap/URIMapping.h
  
  Index: URIMapping.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/URIMapping.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- URIMapping.h	24 Mar 2004 06:57:33 -0000	1.10
  +++ URIMapping.h	8 Apr 2004 12:47:11 -0000	1.11
  @@ -1,70 +1,25 @@
  -/* -*- C++ -*- */
  -
   /*
  - * The Apache Software License, Version 1.1
  - *
  - *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "SOAP" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written
  - *    permission, please contact apache@apache.org.
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - *
  + *   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.
    */
  -// URIMapping.h:
  -//
  -//////////////////////////////////////////////////////////////////////
  +
   #ifdef WIN32
   #pragma warning (disable : 4786)
   #endif
   
  -#if !defined(AFX_URIMAPPING_H__D5B347DD_E7B0_4C76_BCB2_A7C73CFE367D__INCLUDED_)
  -#define AFX_URIMAPPING_H__D5B347DD_E7B0_4C76_BCB2_A7C73CFE367D__INCLUDED_
  +#if !defined(AXIS_URIMAPPING_H__INCLUDED_)
  +#define AXIS_URIMAPPING_H__INCLUDED_
   
   enum URITYPE { URI_XSI, URI_XSD, URI_ENC, URI_ENVELOPE, URI_UNKNOWN};
   #include <map>
  @@ -72,22 +27,23 @@
   #include <axis/server/GDefine.h>
   
   using namespace std;
  -/**
  -    @class URIMapping
  -    @brief interface for the URIMapping class.
   
  +/*
  + * @class URIMapping
  + * @brief interface for the URIMapping class.
  + *
  + * @author Susantha Kumara (skumara@virtusa.com)
  + */
   
  -    @author Susantha Kumara (skumara@virtusa.com)
  -*/
   class URIMapping  
   {
   public:
  -	static void Initialize();
  -	static map<AxisXMLString, URITYPE> m_sURIMap;
  -	static volatile bool m_bInit;
  -	URIMapping();
  -	virtual ~URIMapping();
  -	static URITYPE Map(const AxisXMLCh* uri);
  +    static void Initialize();
  +    static map<AxisXMLString, URITYPE> m_sURIMap;
  +    static volatile bool m_bInit;
  +    URIMapping();
  +    virtual ~URIMapping();
  +    static URITYPE Map(const AxisXMLCh* uri);
   };
   
  -#endif // !defined(AFX_URIMAPPING_H__D5B347DD_E7B0_4C76_BCB2_A7C73CFE367D__INCLUDED_)
  +#endif
  
  
  
  1.4       +61 -52    ws-axis/c/src/soap/XercesHandler.cpp
  
  Index: XercesHandler.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/XercesHandler.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XercesHandler.cpp	5 Apr 2004 14:07:19 -0000	1.3
  +++ XercesHandler.cpp	8 Apr 2004 12:47:11 -0000	1.4
  @@ -1,4 +1,3 @@
  -/* -*- C++ -*- */
   /*
    *   Copyright 2003-2004 The Apache Software Foundation.
    *
  @@ -16,7 +15,7 @@
    */
   
   /*
  - *	@author sanjaya singharage (sanjayas@opensource.lk)
  + *    @author sanjaya singharage (sanjayas@opensource.lk)
    */
   #ifdef WIN32
   #pragma warning (disable : 4786)
  @@ -29,48 +28,55 @@
   
   XercesHandler::XercesHandler()
   {
  -	m_nStatus = AXIS_SUCCESS;
  -	Nelement = (AnyElement*)malloc(sizeof (AnyElement));
  +    m_nStatus = AXIS_SUCCESS;
  +    Nelement = (AnyElement*)malloc(sizeof (AnyElement));
   }
   
   XercesHandler::~XercesHandler()
   {
   }
   
  -void XercesHandler::startElement(const XMLCh *const uri,const XMLCh *const localname,const
XMLCh *const qname,const Attributes &attrs)
  -{
  -	m_pCurrElement = Nelement;
  -	Nelement->m_type = START_ELEMENT;
  -	Nelement->m_pchNameOrValue = XMLString::transcode(localname);
  -	Nelement->m_pchNamespace = XMLString::transcode(uri);
  +void XercesHandler::startElement(const XMLCh *const uri,const XMLCh *const 
  +                                 localname,const XMLCh *const qname,
  +                                 const Attributes &attrs)
  +{
  +    m_pCurrElement = Nelement;
  +    Nelement->m_type = START_ELEMENT;
  +    Nelement->m_pchNameOrValue = XMLString::transcode(localname);
  +    Nelement->m_pchNamespace = XMLString::transcode(uri);
       
  -	unsigned int len = attrs.getLength();
  -	unsigned int index;
  +    unsigned int len = attrs.getLength();
  +    unsigned int index;
       for (index = 0; index < len*3; index+=3)
  -    {	
  -		Nelement->m_pchAttributes[index] = XMLString::transcode(attrs.getLocalName(index));
  -		Nelement->m_pchAttributes[index+1] = XMLString::transcode(attrs.getURI(index));
  -		Nelement->m_pchAttributes[index+2] = XMLString::transcode(attrs.getValue(index));
  -	}
  -	Nelement->m_pchAttributes[len*3]=NULL;
  +    {    
  +        Nelement->m_pchAttributes[index] = 
  +            XMLString::transcode(attrs.getLocalName(index));
  +        Nelement->m_pchAttributes[index+1] = 
  +            XMLString::transcode(attrs.getURI(index));
  +        Nelement->m_pchAttributes[index+2] = 
  +            XMLString::transcode(attrs.getValue(index));
  +    }
  +    Nelement->m_pchAttributes[len*3]=NULL;
   }
   
   const XML_Ch* XercesHandler::NS4Prefix(const XML_Ch* prefix)
   {
  -	if (m_NsStack.find(prefix) != m_NsStack.end())
  -	{
  -		return m_NsStack[prefix].c_str();
  -	}
  -	return NULL;
  -}
  -
  -void XercesHandler::characters(const XMLCh* const chars, const unsigned int length)
  -{
  -	m_pCurrElement = Nelement;
  -	Nelement->m_type = CHARACTER_ELEMENT;
  -	Nelement->m_pchNameOrValue = XMLString::transcode(chars);
  +    if (m_NsStack.find(prefix) != m_NsStack.end())
  +    {
  +        return m_NsStack[prefix].c_str();
  +    }
  +    return NULL;
  +}
  +
  +void XercesHandler::characters(const XMLCh* const chars, 
  +                               const unsigned int length)
  +{
  +    m_pCurrElement = Nelement;
  +    Nelement->m_type = CHARACTER_ELEMENT;
  +    Nelement->m_pchNameOrValue = XMLString::transcode(chars);
   }
  -void XercesHandler::ignorableWhitespace(const XMLCh* const chars, const unsigned int length)
  +void XercesHandler::ignorableWhitespace(const XMLCh* const chars, 
  +                                        const unsigned int length)
   {}
   void XercesHandler::resetDocument()
   {}
  @@ -80,42 +86,45 @@
   {}
   void XercesHandler::error(const SAXParseException& exception)
   {
  -	m_nStatus = AXIS_FAIL;
  +    m_nStatus = AXIS_FAIL;
   }
   void XercesHandler::fatalError(const SAXParseException& exception)
   {
  -	m_nStatus = AXIS_FAIL;
  +    m_nStatus = AXIS_FAIL;
   }
   
  -void XercesHandler::endElement (const XMLCh *const uri,const XMLCh *const localname,const
XMLCh *const qname)
  +void XercesHandler::endElement (const XMLCh *const uri,
  +                                const XMLCh *const localname,
  +                                const XMLCh *const qname)
   {
  -	m_pCurrElement = Nelement;
  -	Nelement->m_type = END_ELEMENT;
  -	Nelement->m_pchNameOrValue = XMLString::transcode(localname);
  -	Nelement->m_pchNamespace = XMLString::transcode(uri);
  -	Nelement->m_pchAttributes[0] = NULL;
  +    m_pCurrElement = Nelement;
  +    Nelement->m_type = END_ELEMENT;
  +    Nelement->m_pchNameOrValue = XMLString::transcode(localname);
  +    Nelement->m_pchNamespace = XMLString::transcode(uri);
  +    Nelement->m_pchAttributes[0] = NULL;
   }
   
  -void XercesHandler::startPrefixMapping(const XMLCh* const prefix, const XMLCh* const uri)
  +void XercesHandler::startPrefixMapping(const XMLCh* const prefix, 
  +                                       const XMLCh* const uri)
   {
  -	Nelement->m_type = START_PREFIX;
  -	Nelement->m_pchNameOrValue = XMLString::transcode(prefix);
  -	Nelement->m_pchNamespace = XMLString::transcode(uri);
  -	m_NsStack[XMLString::transcode(prefix)] = XMLString::transcode(uri);
  +    Nelement->m_type = START_PREFIX;
  +    Nelement->m_pchNameOrValue = XMLString::transcode(prefix);
  +    Nelement->m_pchNamespace = XMLString::transcode(uri);
  +    m_NsStack[XMLString::transcode(prefix)] = XMLString::transcode(uri);
   }
   
   void XercesHandler::endPrefixMapping(const XMLCh* const prefix)
   {
  -	Nelement->m_type = END_PREFIX;
  -	Nelement->m_pchNameOrValue = XMLString::transcode(prefix);
  -	m_NsStack.erase(XMLString::transcode(prefix));
  +    Nelement->m_type = END_PREFIX;
  +    Nelement->m_pchNameOrValue = XMLString::transcode(prefix);
  +    m_NsStack.erase(XMLString::transcode(prefix));
   }
   
   void XercesHandler::freeElement()
   {
  -	if (m_pCurrElement)
  -	{
  -		//free inner variables
  -		m_pCurrElement = 0;
  -	}
  +    if (m_pCurrElement)
  +    {
  +        /* free inner variables */
  +        m_pCurrElement = 0;
  +    }
   }
  
  
  
  1.3       +38 -33    ws-axis/c/src/soap/XercesHandler.h
  
  Index: XercesHandler.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/XercesHandler.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XercesHandler.h	1 Apr 2004 13:56:42 -0000	1.2
  +++ XercesHandler.h	8 Apr 2004 12:47:11 -0000	1.3
  @@ -1,4 +1,3 @@
  -/* -*- C++ -*- */
   /*
    *   Copyright 2003-2004 The Apache Software Foundation.
    *
  @@ -16,7 +15,7 @@
    */
   
   /*
  - *	@author sanjaya singharage (sanjayas@opensource.lk)
  + *    @author sanjaya singharage (sanjayas@opensource.lk)
    */
   
   #include    <xercesc/sax/HandlerBase.hpp>
  @@ -34,52 +33,58 @@
   class XercesHandler : public XERCES_CPP_NAMESPACE::DefaultHandler
   {
   public :
  -	void freeElement();
  -	int GetStatus(){return m_nStatus;};
  -    // -----------------------------------------------------------------------
  -    //  Constructors
  -    // -----------------------------------------------------------------------
  +    void freeElement();
  +    int GetStatus(){return m_nStatus;};
  +    /* -----------------------------------------------------------------------
  +     *  Constructors
  +     * -----------------------------------------------------------------------
  +     */
       XercesHandler();
       ~XercesHandler();
   
   
   
  -	const XML_Ch* XercesHandler::NS4Prefix(const XML_Ch* prefix);
  +    const XML_Ch* XercesHandler::NS4Prefix(const XML_Ch* prefix);
   
  -	AnyElement* getAnyElement()
  -	{
  -		return m_pCurrElement;
  -	}
  +    AnyElement* getAnyElement()
  +    {
  +        return m_pCurrElement;
  +    }
   
   private:
  -    // -----------------------------------------------------------------------
  -    //  Handlers for the SAX DocumentHandler interface
  -    // -----------------------------------------------------------------------
  -	void startElement(const XMLCh *const uri,const XMLCh *const localname,const XMLCh *const
qname,const Attributes &attrs);
  -	void endElement (const XMLCh *const uri,const XMLCh *const localname,const XMLCh *const
qname);
  +    /* -----------------------------------------------------------------------
  +     *  Handlers for the SAX DocumentHandler interface
  +     * -----------------------------------------------------------------------
  +     */
  +    void startElement(const XMLCh *const uri,const XMLCh *const localname,
  +        const XMLCh *const qname,const Attributes &attrs);
  +    void endElement (const XMLCh *const uri,const XMLCh *const localname,
  +        const XMLCh *const qname);
       void characters(const XMLCh* const chars, const unsigned int length);
  -	void startPrefixMapping(const XMLCh* const prefix, const XMLCh* const uri);
  -	void endPrefixMapping(const XMLCh* const prefix);
  -    void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
  +    void startPrefixMapping(const XMLCh* const prefix, const XMLCh* const uri);
  +    void endPrefixMapping(const XMLCh* const prefix);
  +    void ignorableWhitespace(const XMLCh* const chars, 
  +        const unsigned int length);
       void resetDocument();
   
   
  -    // -----------------------------------------------------------------------
  -    //  Implementations of the SAX ErrorHandler interface
  -    // -----------------------------------------------------------------------
  +    /* -----------------------------------------------------------------------
  +     *  Implementations of the SAX ErrorHandler interface
  +     * -----------------------------------------------------------------------
  +     */
       void warning(const SAXParseException& exception);
       void error(const SAXParseException& exception);
       void fatalError(const SAXParseException& exception);
   
  -	int m_nStatus;
  -	AnyElement * Nelement;
  -	AnyElement * m_pCurrElement;
  -
  -	map<AxisXMLString, AxisXMLString> m_NsStack;
  -	void initAnyElement()
  -	{
  -		Nelement->m_pchNameOrValue = NULL;
  -		Nelement->m_pchNamespace = NULL;
  -	}
  +    int m_nStatus;
  +    AnyElement * Nelement;
  +    AnyElement * m_pCurrElement;
  +
  +    map<AxisXMLString, AxisXMLString> m_NsStack;
  +    void initAnyElement()
  +    {
  +        Nelement->m_pchNameOrValue = NULL;
  +        Nelement->m_pchNamespace = NULL;
  +    }
   
   };
  
  
  

Mime
View raw message