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 2005/11/15 19:28:13 UTC
svn commit: r344407 - in /xerces/c/trunk/src/xercesc/dom: DOMStringList.hpp
impl/DOMStringListImpl.cpp impl/DOMStringListImpl.hpp
Author: amassari
Date: Tue Nov 15 10:28:07 2005
New Revision: 344407
URL: http://svn.apache.org/viewcvs?rev=344407&view=rev
Log:
Checking in missing files
Added:
xerces/c/trunk/src/xercesc/dom/DOMStringList.hpp (with props)
xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.cpp (with props)
xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.hpp (with props)
Added: xerces/c/trunk/src/xercesc/dom/DOMStringList.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMStringList.hpp?rev=344407&view=auto
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOMStringList.hpp (added)
+++ xerces/c/trunk/src/xercesc/dom/DOMStringList.hpp Tue Nov 15 10:28:07 2005
@@ -0,0 +1,132 @@
+#ifndef DOMStringList_HEADER_GUARD_
+#define DOMStringList_HEADER_GUARD_
+
+/*
+ * Copyright 2001-2002,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.
+ */
+
+/*
+ * $Id$
+ */
+
+#include <xercesc/util/XercesDefs.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+
+/**
+ * The <code>DOMStringList</code> interface provides the abstraction of an ordered
+ * collection of strings, without defining or constraining how this collection
+ * is implemented. The items in the <code>DOMStringList</code> are accessible via
+ * an integral index, starting from 0.
+ */
+
+class CDOM_EXPORT DOMStringList {
+protected:
+ // -----------------------------------------------------------------------
+ // Hidden constructors
+ // -----------------------------------------------------------------------
+ /** @name Hidden constructors */
+ //@{
+ DOMStringList() {};
+ //@}
+
+private:
+ // -----------------------------------------------------------------------
+ // Unimplemented constructors and operators
+ // -----------------------------------------------------------------------
+ /** @name Unimplemented constructors and operators */
+ //@{
+ DOMStringList(const DOMStringList &);
+ DOMStringList & operator = (const DOMStringList &);
+ //@}
+
+public:
+ // -----------------------------------------------------------------------
+ // All constructors are hidden, just the destructor is available
+ // -----------------------------------------------------------------------
+ /** @name Destructor */
+ //@{
+ /**
+ * Destructor
+ *
+ */
+ virtual ~DOMStringList() {};
+ //@}
+
+ // -----------------------------------------------------------------------
+ // Virtual DOMStringList interface
+ // -----------------------------------------------------------------------
+ /** @name Functions introduced in DOM Level 3 */
+ //@{
+ // -----------------------------------------------------------------------
+ // Getter methods
+ // -----------------------------------------------------------------------
+ /**
+ * Returns the <code>index</code> item in the collection.
+ *
+ * If <code>index</code> is greater than or equal to the number of strings in
+ * the list, this returns <code>null</code>.
+ *
+ * @param index Index into the collection.
+ * @return The string at the <code>index</code>th position in the
+ * <code>DOMStringList</code>, or <code>null</code> if that is not a valid
+ * index.
+ * @since DOM Level 3
+ */
+ virtual const XMLCh *item(XMLSize_t index) const = 0;
+
+ /**
+ * Returns the number of strings in the list.
+ *
+ * The range of valid child node indices is 0 to <code>length-1</code> inclusive.
+ *
+ * @since DOM Level 3
+ */
+ virtual XMLSize_t getLength() const = 0;
+
+ /**
+ * Test if a string is part of this DOMStringList
+ *
+ * @return <code>true</code> if the string has been found, <code>false</code> otherwise.
+ *
+ * @since DOM Level 3
+ */
+ virtual bool contains(const XMLCh*) const = 0;
+ //@}
+
+ // -----------------------------------------------------------------------
+ // Non-standard Extension
+ // -----------------------------------------------------------------------
+ /** @name Non-standard Extension */
+ //@{
+ /**
+ * Called to indicate that this list is no longer in use
+ * and that the implementation may relinquish any resources associated with it and
+ * its associated children.
+ *
+ * Access to a released object will lead to unexpected result.
+ *
+ */
+ virtual void release() = 0;
+ //@}
+
+};
+
+XERCES_CPP_NAMESPACE_END
+
+#endif
+
+
Propchange: xerces/c/trunk/src/xercesc/dom/DOMStringList.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xerces/c/trunk/src/xercesc/dom/DOMStringList.hpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.cpp?rev=344407&view=auto
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.cpp (added)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.cpp Tue Nov 15 10:28:07 2005
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2001-2002,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.
+ */
+
+/*
+ * $Id$
+ */
+
+#include "DOMStringListImpl.hpp"
+#include <xercesc/util/XMLString.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+DOMStringListImpl::DOMStringListImpl(int nInitialSize, MemoryManager* manager)
+{
+ fList=new (manager) RefVectorOf<XMLCh>(nInitialSize, false, manager);
+}
+
+DOMStringListImpl::~DOMStringListImpl()
+{
+ delete fList;
+}
+
+
+void DOMStringListImpl::add(const XMLCh* str) {
+ fList->addElement((XMLCh*)str);
+}
+
+XMLSize_t DOMStringListImpl::getLength() const{
+ return fList->size();
+}
+
+
+const XMLCh* DOMStringListImpl::item(XMLSize_t index) const{
+ if(index<fList->size())
+ return fList->elementAt(index);
+ return 0;
+}
+
+bool DOMStringListImpl::contains(const XMLCh* str) const{
+ for(XMLSize_t i=0;i<fList->size();i++)
+ if(XMLString::equals(fList->elementAt(i), str))
+ return true;
+ return false;
+}
+
+void DOMStringListImpl::release() {
+ delete this;
+}
+
+XERCES_CPP_NAMESPACE_END
+
+
Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.cpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.hpp?rev=344407&view=auto
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.hpp (added)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.hpp Tue Nov 15 10:28:07 2005
@@ -0,0 +1,55 @@
+#ifndef DOMStringListImpl_HEADER_GUARD_
+#define DOMStringListImpl_HEADER_GUARD_
+/*
+ * Copyright 2001-2002,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.
+ */
+
+/*
+ * $Id$
+ */
+
+#include <xercesc/util/XercesDefs.hpp>
+#include <xercesc/util/RefVectorOf.hpp>
+#include <xercesc/dom/DOMStringList.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+
+class CDOM_EXPORT DOMStringListImpl: public XMemory,
+ public DOMStringList
+{
+private:
+ RefVectorOf<XMLCh> *fList;
+
+ // Unused, and unimplemented constructors, operators, etc.
+ DOMStringListImpl(const DOMStringListImpl & other);
+ DOMStringListImpl & operator = (const DOMStringListImpl & other);
+
+public:
+ DOMStringListImpl(int nInitialSize, MemoryManager* manager);
+ void add(const XMLCh* impl);
+
+ virtual ~DOMStringListImpl();
+ virtual const XMLCh* item(XMLSize_t index) const;
+ virtual XMLSize_t getLength() const;
+ virtual bool contains(const XMLCh* str) const;
+ virtual void release();
+};
+
+XERCES_CPP_NAMESPACE_END
+
+#endif
+
+
Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xerces/c/trunk/src/xercesc/dom/impl/DOMStringListImpl.hpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org