Dataquay 0.8
RDFException.h
Go to the documentation of this file.
1/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3/*
4 Dataquay
5
6 A C++/Qt library for simple RDF datastore management.
7 Copyright 2009-2012 Chris Cannam.
8
9 Permission is hereby granted, free of charge, to any person
10 obtaining a copy of this software and associated documentation
11 files (the "Software"), to deal in the Software without
12 restriction, including without limitation the rights to use, copy,
13 modify, merge, publish, distribute, sublicense, and/or sell copies
14 of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be
18 included in all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
24 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
25 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
28 Except as contained in this notice, the name of Chris Cannam
29 shall not be used in advertising or otherwise to promote the sale,
30 use or other dealings in this Software without prior written
31 authorization.
32*/
33
34#ifndef DATAQUAY_EXCEPTION_H
35#define DATAQUAY_EXCEPTION_H
36
37#include <QString>
38#include <exception>
39
40namespace Dataquay
41{
42
43class Uri;
44class Node;
45class Triple;
46
55class RDFException : virtual public std::exception
56{
57public:
58 RDFException(QString message) throw();
59 RDFException(QString message, QString data) throw();
60 RDFException(QString message, const Uri &uri) throw();
61 RDFException(QString message, const Node &node) throw();
62 RDFException(QString message, const Triple &triple) throw();
63 RDFException(const RDFException &e) throw();
65 virtual ~RDFException() throw();
66 virtual const char *what() const throw() { return m_message; }
67
68protected:
69 char *m_message;
70 void setMessage(QString m);
71};
72
82class RDFIncompleteURI : virtual public RDFException
83{
84public:
85 RDFIncompleteURI(QString message, QString data) throw() :
86 RDFException(message, data) { }
87 virtual ~RDFIncompleteURI() throw() { }
88};
89
96class RDFInternalError : virtual public RDFException
97{
98public:
99 RDFInternalError(QString message, QString data = "") throw() :
100 RDFException(message, data) { }
101 RDFInternalError(QString message, const Uri &data) throw() :
102 RDFException(message, data) { }
103 virtual ~RDFInternalError() throw() { }
104};
105
113class RDFUnsupportedError : virtual public RDFException
114{
115public:
116 RDFUnsupportedError(QString message, QString data = "") throw() :
117 RDFException(message, data) { }
118 RDFUnsupportedError(QString message, const Uri &data) throw() :
119 RDFException(message, data) { }
120 virtual ~RDFUnsupportedError() throw() { }
121};
122
130class RDFTransactionError : virtual public RDFException
131{
132public:
133 RDFTransactionError(QString message, QString data = "") throw() :
134 RDFException(message, data) { }
135 virtual ~RDFTransactionError() throw() { }
136};
137
147{
148public:
149 RDFDuplicateImportException(QString message, QString data = "") throw() :
150 RDFException(message, data) { }
151 RDFDuplicateImportException(QString message, const Triple &t) throw() :
152 RDFException(message, t) { }
153 virtual ~RDFDuplicateImportException() throw() { }
154};
155
156}
157
158#endif
159
Node represents a single RDF node, with conversions to and from variant types.
Definition Node.h:65
RDFDuplicateImportException is an exception that results from an import into a store from an RDF docu...
RDFDuplicateImportException(QString message, const Triple &t)
RDFDuplicateImportException(QString message, QString data="")
RDFException is an exception that results from incorrect usage of the RDF store interface or unsuitab...
RDFException(QString message)
RDFException(QString message, const Triple &triple)
RDFException(QString message, QString data)
RDFException(const RDFException &e)
virtual const char * what() const
void setMessage(QString m)
RDFException(QString message, const Uri &uri)
RDFException(QString message, const Node &node)
RDFException & operator=(const RDFException &e)
RDFIncompleteURI is thrown when an attempt is made to construct a Uri from an incomplete URI string,...
RDFIncompleteURI(QString message, QString data)
RDFInternalError is an exception that results from an internal error in the RDF store.
RDFInternalError(QString message, const Uri &data)
RDFInternalError(QString message, QString data="")
RDFTransactionError is an exception that results from incorrect use of a Transaction,...
RDFTransactionError(QString message, QString data="")
RDFUnsupportedError is an exception that results from an attempt to use a feature that is not support...
RDFUnsupportedError(QString message, QString data="")
RDFUnsupportedError(QString message, const Uri &data)
Triple represents an RDF statement made up of three Node objects.
Definition Triple.h:48
Uri represents a single URI.
Definition Uri.h:77