You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2006/09/26 03:26:25 UTC

svn commit: r449878 - in /xerces/c/trunk/src/xercesc/framework/psvi: XSNamedMap.c XSNamedMap.hpp XSNamespaceItem.hpp

Author: amassari
Date: Mon Sep 25 18:26:24 2006
New Revision: 449878

URL: http://svn.apache.org/viewvc?view=rev&rev=449878
Log:
Make some methods const (jira#1628)

Modified:
    xerces/c/trunk/src/xercesc/framework/psvi/XSNamedMap.c
    xerces/c/trunk/src/xercesc/framework/psvi/XSNamedMap.hpp
    xerces/c/trunk/src/xercesc/framework/psvi/XSNamespaceItem.hpp

Modified: xerces/c/trunk/src/xercesc/framework/psvi/XSNamedMap.c
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/psvi/XSNamedMap.c?view=diff&rev=449878&r1=449877&r2=449878
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/psvi/XSNamedMap.c (original)
+++ xerces/c/trunk/src/xercesc/framework/psvi/XSNamedMap.c Mon Sep 25 18:26:24 2006
@@ -60,7 +60,7 @@
  * <code>mapLength-1</code> inclusive. 
  */
 template <class TVal> 
-unsigned int XSNamedMap<TVal>::getLength()
+unsigned int XSNamedMap<TVal>::getLength() const
 {
     return fVector->size();
 }
@@ -76,6 +76,16 @@
  */
 template <class TVal> 
 TVal* XSNamedMap<TVal>::item(unsigned int index)
+{
+    if (index >= fVector->size()) 
+    {
+        return 0;
+    }
+    return fVector->elementAt(index);
+}
+
+template <class TVal> 
+const TVal* XSNamedMap<TVal>::item(unsigned int index) const
 {
     if (index >= fVector->size()) 
     {

Modified: xerces/c/trunk/src/xercesc/framework/psvi/XSNamedMap.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/psvi/XSNamedMap.hpp?view=diff&rev=449878&r1=449877&r2=449878
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/psvi/XSNamedMap.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/psvi/XSNamedMap.hpp Mon Sep 25 18:26:24 2006
@@ -71,7 +71,7 @@
      * The range of valid child object indices is 0 to 
      * <code>mapLength-1</code> inclusive. 
      */
-    unsigned int getLength();
+    unsigned int getLength() const;
 
     /**
      *  Returns the <code>index</code>th item in the collection. The index 
@@ -83,6 +83,7 @@
      *   that is not a valid index. 
      */
     TVal *item(unsigned int index);
+    const TVal *item(unsigned int index) const;
 
     /**
      * Retrieves a component specified by local name and namespace URI.

Modified: xerces/c/trunk/src/xercesc/framework/psvi/XSNamespaceItem.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/psvi/XSNamespaceItem.hpp?view=diff&rev=449878&r1=449877&r2=449878
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/psvi/XSNamespaceItem.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/psvi/XSNamespaceItem.hpp Mon Sep 25 18:26:24 2006
@@ -95,7 +95,7 @@
      * [schema namespace]: A namespace name or <code>null</code>
      * corresponding to the target namespace of the schema document.
      */
-    const XMLCh *getSchemaNamespace();
+    const XMLCh *getSchemaNamespace() const;
 
     /**
      * [schema components]: a list of top-level components, i.e. element 
@@ -113,6 +113,7 @@
      *  [annotations]: a set of annotations.
      */
     XSAnnotationList *getAnnotations();
+    const XSAnnotationList *getAnnotations() const;
 
     /**
      * Convenience method. Returns a top-level element declaration. 
@@ -226,7 +227,12 @@
     return fXSAnnotationList;
 }
 
-inline const XMLCh *XSNamespaceItem::getSchemaNamespace()
+inline const XSAnnotationList* XSNamespaceItem::getAnnotations() const
+{
+    return fXSAnnotationList;
+}
+
+inline const XMLCh *XSNamespaceItem::getSchemaNamespace() const
 {
     return fSchemaNamespace;
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org