ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ros...@apache.org
Subject cvs commit: ws-axis/c/src/soap CharacterElement.h ComplexElement.h ComplexElement.cpp
Date Fri, 06 Aug 2004 05:29:48 GMT
roshan      2004/08/05 22:29:48

  Modified:    c/include/axis/server BasicNode.h
               c/src/soap CharacterElement.h ComplexElement.h
                        ComplexElement.cpp
  Log:
  added functionality to getAttributes by providing the localname, namespaceURI and the prefix
  
  Revision  Changes    Path
  1.19      +25 -0     ws-axis/c/include/axis/server/BasicNode.h
  
  Index: BasicNode.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/server/BasicNode.h,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- BasicNode.h	3 Aug 2004 10:23:26 -0000	1.18
  +++ BasicNode.h	6 Aug 2004 05:29:48 -0000	1.19
  @@ -77,6 +77,19 @@
   public:
   
       /**
  +      * Returns the Attribute of this node, corresponding to the given 
  +      * prefix/localname pair or the given namespace URI/localname pair. 
  +      * The users could get the attributes with the 
  +      * following combinations of pairs.
  +      *  1. by prefix and localname pair (here the namespace URI(i.e pachURI
  +      *      has to be a empty string)) or
  +      *  2. by namespace URI and localname pair (here the prefix
  +      *      (i.e pachPrefix has to be a empty string)).
  +      * The operation behavior depends on the TYPE of the node.
  +      */
  +    virtual IAttribute* getAttribute(AxisChar* pachPrefix, AxisChar* pachLocalname, AxisChar*
pachLocalname) = 0;
  +
  +    /**
         * Returns the first Attribute of this node. The operation
         * behavior depends on the TYPE of the node.
         */
  @@ -228,6 +241,18 @@
         * @return AXIS_SUCCESS to indicate successfull operation.
         */
       virtual int setPrefix(const AxisChar* sPrefix) =0;
  +
  +    /**
  +      * Returns the namespace URI of this node.  The operation behavior
  +      * depends on the TYPE of the node.
  +      */
  +    virtual const AxisChar* getURI() = 0;
  +
  +    /**
  +      * Returns the prefix  of this node.  The operation behavior
  +      * depends on the TYPE of the node.
  +      */
  +    virtual const AxisChar* getPrefix() = 0;
   
       virtual int serialize(SoapSerializer& pSZ) =0;
       virtual int serialize(SoapSerializer& pSZ, 
  
  
  
  1.11      +29 -4     ws-axis/c/src/soap/CharacterElement.h
  
  Index: CharacterElement.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/CharacterElement.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CharacterElement.h	3 Aug 2004 10:23:26 -0000	1.10
  +++ CharacterElement.h	6 Aug 2004 05:29:48 -0000	1.11
  @@ -51,31 +51,40 @@
   public:
   
       /**
  +      * This method is overridden to always return NULL because this is a 
  +      * CharacterElement. A user of a CharacterElement should not use this 
  +      * method.
  +      */
  +    IAttribute* getAttribute(AxisChar* pachPrefix, AxisChar* pachURI,
  +	    AxisChar* pachLocalname)
  +	{return NULL;}
  +
  +    /**
         * This method is overridden to always return NULL because this is a CharacterElement.
         * A user of a CharacterElement should not use this method
         */
  -    virtual IAttribute* getFirstAttribute()
  +    IAttribute* getFirstAttribute()
       { return NULL; }
                                                                                         
                                                                                     
       /**
         * This method is overridden to always return NULL because this is a CharacterElement.
         * A user of a CharacterElement should not use this method
         */    
  -    virtual IAttribute* getLastAttribute()
  +    IAttribute* getLastAttribute()
       { return NULL; }
                                                                                         
                                                                                     
       /**
         * This method is overridden to always return NULL because this is a CharacterElement.
         * A user of a CharacterElement should not use this method
         */    
  -    virtual IAttribute* getNextAttribute()
  +    IAttribute* getNextAttribute()
       { return NULL; }
   
       /**
         * This method is overridden to always return NULL because this is a CharacterElement.
         * A user of a CharacterElement should not use this method
         */
  -    virtual IAttribute* getCurrentAttribute()
  +    IAttribute* getCurrentAttribute()
       { return NULL; }
   
       /** 
  @@ -229,6 +238,22 @@
         * @return Returns NULL.
         */
       const AxisChar* getLocalName() {return NULL;}
  +
  +    /**
  +      * This method is overridden to return NULL always. A user of a
  +      *  CharacterElement should not use this method.
  +      *
  +      * @return Returns NULL.
  +      */
  +    const AxisChar* getURI() {return NULL;}
  +
  +    /**
  +      * This method is overridden to return NULL always. A user of a
  +      *  CharacterElement should not use this method.
  +      *
  +      * @return Returns NULL.
  +      */
  +    const AxisChar* getPrefix() {return NULL;}
   
       /**
         * The Constructor.
  
  
  
  1.16      +29 -0     ws-axis/c/src/soap/ComplexElement.h
  
  Index: ComplexElement.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/ComplexElement.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ComplexElement.h	3 Aug 2004 10:23:26 -0000	1.15
  +++ ComplexElement.h	6 Aug 2004 05:29:48 -0000	1.16
  @@ -68,6 +68,21 @@
       ComplexElement(AxisChar* pachLocalName, AxisChar* pachPrefix, AxisChar* pachUri);
   
       /**
  +      * Returns the Attribute of this node, corresponding to the given
  +      * prefix/localname pair or the given namespace URI/localname pair.
  +      * The users could get the attributes with the
  +      * following combinations of pairs.
  +      *  1. by prefix and localname pair (here the namespace URI(i.e pachURI
  +      *      has to be a empty string)) or
  +      *  2. by namespace URI and localname pair (here the prefix
  +      *      (i.e pachPrefix has to be a empty string)).
  +      * 
  +      * If not found returns NULL.
  +      */
  +    IAttribute* getAttribute(AxisChar* pachPrefix, AxisChar* pachURI,
  +	    AxisChar* pachLocalname);
  +                                                                                      
                                                                                     
  +    /**
         * Returns the first Attribute of this node. NOTE: When traversing the 
         *  attributes this has to be called first, before calling the 
         *  getNextAttribute() mthod.
  @@ -232,6 +247,20 @@
         * @return The localname of this element.
         */
       const AxisChar* getLocalName();
  +
  +    /**
  +      * Returns the namespace URI of this node.
  +      *
  +      * @return The namespace URI of this element.
  +      */
  +    const AxisChar* getURI();
  +                                                                                      
                                                                                     
  +    /**
  +      * Returns the prefix  of this node.
  +      *
  +      * @return The prefix of this element.
  +      */
  +    const AxisChar* getPrefix();
   
   private:
       int iNoOfChildren;
  
  
  
  1.22      +36 -0     ws-axis/c/src/soap/ComplexElement.cpp
  
  Index: ComplexElement.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/ComplexElement.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- ComplexElement.cpp	3 Aug 2004 10:23:26 -0000	1.21
  +++ ComplexElement.cpp	6 Aug 2004 05:29:48 -0000	1.22
  @@ -449,6 +449,14 @@
       return m_pachLocalName; 
   }
   
  +const AxisChar* ComplexElement::getURI() {
  +    return m_pachURI;
  +}
  +
  +const AxisChar* ComplexElement::getPrefix() {
  +    return m_pachPrefix;
  +}
  +
   IAttribute* ComplexElement::getFirstAttribute()
   {
       m_viCurrentAttribute = m_attributes.begin();
  @@ -501,3 +509,31 @@
           return ((IAttribute*)*m_viCurrentAttribute);
   }
   
  +IAttribute* ComplexElement::getAttribute(AxisChar* pachPrefix,
  +	AxisChar* pachURI, AxisChar* pachLocalname)
  +{
  +    list<Attribute*>::iterator it_m_attributes = m_attributes.begin();
  +
  +    if ( (pachPrefix != NULL) && (strlen(pachPrefix) > 0)) {
  +	/* Here user has requested to traverse using prefix and localname*/
  +    	while (it_m_attributes != m_attributes.end()) {
  +	    if ( (strcmp((*it_m_attributes)->getPrefix(), pachPrefix) == 0) &&
  +		    (strcmp((*it_m_attributes)->getLocalName(), pachLocalname) == 0))
  +	    	return (IAttribute*)(*it_m_attributes);
  +	    else
  +	    	it_m_attributes++;
  +    	}
  +    } else {
  + 	/* Here user has requested to traverse using namespace URI and 
  +	localname*/
  +	while (it_m_attributes != m_attributes.end()) {
  +            if ( (strcmp((*it_m_attributes)->getUri(), pachURI) == 0) &&
  +                    (strcmp((*it_m_attributes)->getLocalName(), pachLocalname) == 0))
  +            	return (IAttribute*)(*it_m_attributes);
  +            else
  +            	it_m_attributes++;
  +    	}	
  +    }
  +
  +    return NULL;
  +}
  
  
  

Mime
View raw message