📄 dom2_traversal.cpp
字号:
/** * This file is part of the DOM implementation for KDE. * * (C) 1999 Lars Knoll (knoll@kde.org) * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * $Id: dom2_traversal.cpp,v 1.1.1.1 2002/01/16 10:39:55 ymwei Exp $ */#include "dom2_traversal.h"#include "dom_node.h"#include "dom_exception.h"#include "dom2_traversalimpl.h"using namespace DOM;NodeIterator::NodeIterator(){ impl = 0;}NodeIterator::NodeIterator(const NodeIterator &other){ impl = other.impl; if (impl) impl->ref();}NodeIterator::NodeIterator(NodeIteratorImpl *i){ impl = i; if (impl) impl->ref();}NodeIterator &NodeIterator::operator = (const NodeIterator &other){ if (impl) impl->deref(); impl = other.impl; if (impl) impl->ref(); return *this;}NodeIterator::~NodeIterator(){ if (impl) impl->deref();}Node NodeIterator::root(){ if (impl) return impl->getRoot(); return 0;}unsigned long NodeIterator::whatToShow(){ if (impl) return impl->getWhatToShow(); return 0;}NodeFilter NodeIterator::filter(){ if (impl) return impl->getFilter(); return 0;}bool NodeIterator::expandEntityReferences(){ if (impl) return impl->getExpandEntityReferences(); return 0;}Node NodeIterator::nextNode( ){ if (impl) return impl->nextNode(); return 0;}Node NodeIterator::previousNode( ){ if (impl) return impl->previousNode(); return 0;}void NodeIterator::detach(){ if (impl) impl->detach();}NodeIteratorImpl *NodeIterator::handle() const{ return impl;}bool NodeIterator::isNull() const{ return (impl == 0);}// -----------------------------------------------------------NodeFilter::NodeFilter(){ impl = 0;}NodeFilter::NodeFilter(const NodeFilter &other){ impl = other.impl; if (impl) impl->ref();}NodeFilter::NodeFilter(NodeFilterImpl *i){ impl = i; if (impl) impl->ref();}NodeFilter &NodeFilter::operator = (const NodeFilter &other){ if (impl) impl->deref(); impl = other.impl; if (impl) impl->ref(); return *this;}NodeFilter::~NodeFilter(){ if (impl) impl->deref();}short NodeFilter::acceptNode(const Node &n){ if (impl) return impl->acceptNode(n); return 0;}NodeFilterImpl *NodeFilter::handle() const{ return impl;}bool NodeFilter::isNull() const{ return (impl == 0);}// --------------------------------------------------------------TreeWalker::TreeWalker() { impl = 0;}TreeWalker::TreeWalker(const TreeWalker &other) { impl = other.impl; if (impl) impl->ref();}TreeWalker::TreeWalker(TreeWalkerImpl *i){ impl = i; if (impl) impl->ref();}TreeWalker & TreeWalker::operator = (const TreeWalker &other){ if (impl) impl->deref(); impl = other.impl; if (impl) impl->ref(); return *this;}TreeWalker::~TreeWalker(){ if (impl) impl->deref();}Node TreeWalker::root(){ if (impl) return impl->getRoot(); return 0;}unsigned long TreeWalker::whatToShow(){ if (impl) return impl->getWhatToShow(); return 0;}NodeFilter TreeWalker::filter(){ if (impl) return impl->getFilter(); return 0;}bool TreeWalker::expandEntityReferences(){ if (impl) return impl->getExpandEntityReferences(); return false;}Node TreeWalker::currentNode(){ if (impl) return impl->getCurrentNode(); return 0;}void TreeWalker::setCurrentNode(const Node _currentNode){ if (impl) impl->setCurrentNode(_currentNode);}Node TreeWalker::parentNode(){ if (impl) return impl->parentNode(); return 0;}Node TreeWalker::firstChild(){ if (impl) return impl->firstChild(); return 0;}Node TreeWalker::lastChild(){ if (impl) return impl->lastChild(); return 0;}Node TreeWalker::previousSibling(){ if (impl) return impl->previousSibling(); return 0;}Node TreeWalker::nextSibling(){ if (impl) return impl->nextSibling(); return 0;}Node TreeWalker::previousNode(){ if (impl) return impl->previousNode(); return 0;}Node TreeWalker::nextNode(){ if (impl) return impl->nextNode(); return 0;}TreeWalkerImpl *TreeWalker::handle() const{ return impl;}bool TreeWalker::isNull() const{ return (impl == 0);}// -----------------------------------------------------------------------/*DocumentTraversal::DocumentTraversal(){}DocumentTraversal::DocumentTraversal(const DocumentTraversal &other){}DocumentTraversal &DocumentTraversal::operator = (const DocumentTraversal &other){ DocumentTraversal::operator = (other); return *this;}DocumentTraversal::~DocumentTraversal(){}NodeIterator DocumentTraversal::createNodeIterator( const Node &root, long whatToShow, const NodeFilter &filter, bool entityReferenceExpansion ){ return NodeIterator();}TreeWalker DocumentTraversal::createTreeWalker( const Node &root, long whatToShow, const NodeFilter &filter, bool entityReferenceExpansion ){ return TreeWalker();}*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -