00001 /*
00002 * (C) Copyright 2002, Schlund+Partner AG
00003 *
00004 * This library is free software; you can redistribute it and/or
00005 * modify it under the terms of the GNU Lesser General Public
00006 * License as published by the Free Software Foundation; either
00007 * version 2.1 of the License, or (at your option) any later version.
00008 *
00009 * This library is distributed in the hope that it will be useful,
00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00012 * Lesser General Public License for more details.
00013 *
00014 * You should have received a copy of the GNU Lesser General Public
00015 * License along with this library; if not, write to the Free Software
00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00017 */
00018
00031 #ifndef SP_GXML_XMLEXCEPTION_HPP
00032 #define SP_GXML_XMLEXCEPTION_HPP
00033
00034 // STDC++
00035 #include <string>
00036
00037 namespace SP
00038 {
00039 namespace GXML
00040 {
00041
00042 class XMLException
00043 {
00044 public:
00045 XMLException( int exception );
00046 int getException();
00047 std::string getMessage();
00048
00049 enum Exceptions {
00050 XMLTREE_PARSE=1, // Error parsing XML tree
00051 XMLTREE_CREATE_CONTEXT, // Could not create XPath context
00052 XMLTREE_CREATE_NODE, // Could not create node
00053 XMLTREE_ADD_NODE, // Could not add node
00054 XMLTREE_TREE_INVALID, // Invalid XML tree
00055 XMLTREE_NO_NODE_FROM_PATH, // Path matches no node
00056 XMLTREE_NO_STRING_FROM_PATH, // Path returns no string
00057 XMLTREE_NO_BOOL_FROM_PATH, // Path returns no boolean
00058 XMLTREE_NO_FLOAT_FROM_PATH, // Path returns no float
00059 XMLNODE_NO_NODE, // Node pointer is NULL
00060 XMLNODE_LAST_NODE, // Node has no following sibling
00061 XMLNODE_FIRST_NODE, // Node has no preceding sibling
00062 XMLNODE_NO_PARENT, // Node has no parent node
00063 XMLNODE_NO_CHILD, // Node has no child node
00064 XMLNODE_NO_CONTENT, // Node contains no text
00065 XMLNODE_NO_ATTRIBUTE, // Node has no attributes
00066 XMLNODE_BUFFER_CREATE, // Could not create XML buffer
00067 XMLNODE_NODE_DUMP, // Could not dump the node
00068 XMLNODESET_EVAL, // Could not evaluate XPath
00069 XMLNODESET_NO_SET, // XPath delivers no node set
00070 XMLNODESET_NO_MATCH // XPath doesn't exist
00071 };
00072
00073 private:
00074 int exception_;
00075 };
00076
00077 }}
00078 #endif
1.2.15