KHTML
dom3_xpath.h
Go to the documentation of this file.
00001 /* 00002 * dom3_xpath.h - Copyright 2005 Frerich Raabe <raabe@kde.org> 00003 * Copyright 2010 Maksim Orlovich <maksim@kde.org> 00004 * Copyright 1999 Lars Knoll (knoll@kde.org) 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 * Based on kdomxpath.h, which was licensed as follows: 00022 * Redistribution and use in source and binary forms, with or without 00023 * modification, are permitted provided that the following conditions 00024 * are met: 00025 * 00026 * 1. Redistributions of source code must retain the above copyright 00027 * notice, this list of conditions and the following disclaimer. 00028 * 2. Redistributions in binary form must reproduce the above copyright 00029 * notice, this list of conditions and the following disclaimer in the 00030 * documentation and/or other materials provided with the distribution. 00031 * 00032 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 00033 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00034 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00035 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 00036 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00037 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00038 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00039 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00040 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00041 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00042 * 00043 */ 00044 #ifndef DOM3_XPATH_H 00045 #define DOM3_XPATH_H 00046 00047 #include <dom_string.h> 00048 00049 namespace DOM { 00050 00051 enum XPathExceptionCode { 00052 INVALID_EXPRESSION_ERR = 51, 00053 TYPE_ERR = 52 00054 }; 00055 00056 namespace XPath { 00057 enum XPathResultType { 00058 ANY_TYPE = 0, 00059 NUMBER_TYPE = 1, 00060 STRING_TYPE = 2, 00061 BOOLEAN_TYPE = 3, 00062 UNORDERED_NODE_ITERATOR_TYPE = 4, 00063 ORDERED_NODE_ITERATOR_TYPE = 5, 00064 UNORDERED_NODE_SNAPSHOT_TYPE = 6, 00065 ORDERED_NODE_SNAPSHOT_TYPE = 7, 00066 ANY_UNORDERED_NODE_TYPE = 8, 00067 FIRST_ORDERED_NODE_TYPE = 9 00068 }; 00069 } 00070 00071 class KHTML_EXPORT XPathException 00072 { 00073 public: 00074 XPathException(unsigned short _code) { code = _code; } 00075 XPathException(const XPathException &other) { code = other.code; } 00076 00077 XPathException & operator = (const XPathException &other) 00078 { code = other.code; return *this; } 00079 00080 virtual ~XPathException() {} 00081 00086 unsigned short code; 00087 00088 enum XPathExceptionCode 00089 { 00090 INVALID_EXPRESSION_ERR = 51, 00091 TYPE_ERR = 52, 00092 00093 _EXCEPTION_OFFSET = 4000, 00094 _EXCEPTION_MAX = 4999 00095 }; 00096 00097 DOMString codeAsString() const; 00098 static DOMString codeAsString(int xpathCode); 00099 00101 static int toCode(int xpathCode); 00102 00104 static bool isXPathExceptionCode(int exceptioncode); 00105 }; 00106 00107 00108 } 00109 00110 #endif // DOM3_XPATH_H 00111
KDE 4.6 API Reference