KHTML
XPathNamespaceImpl.cpp
Go to the documentation of this file.
00001 /* 00002 * XPathNamespaceImpl.cpp - Copyright 2005 Frerich Raabe <raabe@kde.org> 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions 00006 * are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 00015 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00016 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00017 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 00018 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00019 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00020 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00021 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00022 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00023 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 */ 00025 #include "XPathNamespaceImpl.h" 00026 #include "DocumentImpl.h" 00027 00028 #include "kdomxpath.h" 00029 00030 using namespace DOM; 00031 00032 XPathNamespaceImpl::XPathNamespaceImpl( DocumentImpl *ptr, DOMStringImpl *prefix, DOMStringImpl *uri ) 00033 : NodeImpl( ptr ), 00034 m_ownerDocument( ptr ), 00035 m_prefix( prefix ), 00036 m_uri( uri ) 00037 { 00038 } 00039 00040 XPathNamespaceImpl::XPathNamespaceImpl( const XPathNamespaceImpl &other ) 00041 : NodeImpl( other ) 00042 { 00043 NodeImpl::operator=( other ); 00044 *this = other; 00045 } 00046 00047 XPathNamespaceImpl::~XPathNamespaceImpl() 00048 { 00049 } 00050 00051 XPathNamespaceImpl &XPathNamespaceImpl::operator=( const XPathNamespaceImpl &other ) 00052 { 00053 m_prefix = other.m_prefix; 00054 m_uri = other.m_uri; 00055 return *this; 00056 } 00057 00058 DocumentImpl *XPathNamespaceImpl::ownerDocument() const 00059 { 00060 return m_ownerDocument; 00061 } 00062 00063 ElementImpl *XPathNamespaceImpl::ownerElement() const 00064 { 00065 // XXX 00066 return 0; 00067 } 00068 00069 const AtomicString &XPathNamespaceImpl::prefix() const 00070 { 00071 return m_prefix; 00072 } 00073 00074 DOMString XPathNamespaceImpl::nodeName() const 00075 { 00076 return DOMString(m_prefix); 00077 } 00078 00079 const AtomicString &XPathNamespaceImpl::namespaceURI() const 00080 { 00081 return m_uri; 00082 } 00083 00084 unsigned short XPathNamespaceImpl::nodeType() const 00085 { 00086 return XPATH_NAMESPACE_NODE; 00087 } 00088
KDE 4.6 API Reference