~ubuntu-branches/ubuntu/maverick/amarok/maverick-backports

« back to all changes in this revision

Viewing changes to src/context/engines/songkick/JsonQt/lib/ParseException.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2011-03-03 10:20:39 UTC
  • mfrom: (126.1.8 natty)
  • Revision ID: james.westby@ubuntu.com-20110303102039-a408rug513n4qbin
Tags: 2:2.4.0-0ubuntu4~maverick1
* Source backprt to maverick (LP: #728447)
  - Drop version requirement on libindicate-qt-dev build-dep

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************************
2
 
 * Copyright (c) 2008 Frederick Emmott <mail@fredemmott.co.uk>                          *
3
 
 *                                                                                      *
4
 
 * This program is free software; you can redistribute it and/or modify it under        *
5
 
 * the terms of the GNU General Public License as published by the Free Software        *
6
 
 * Foundation; either version 2 of the License, or (at your option) any later           *
7
 
 * version.                                                                             *
8
 
 *                                                                                      *
9
 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
10
 
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
11
 
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
12
 
 *                                                                                      *
13
 
 * You should have received a copy of the GNU General Public License along with         *
14
 
 * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
15
 
 ****************************************************************************************/
16
 
 
17
 
#ifndef JSONQT_PARSE_EXCEPTION_H
18
 
#define JSONQT_PARSE_EXCEPTION_H
19
 
 
20
 
#include "JsonQtExport.h"
21
 
 
22
 
#include <exception>
23
 
#include <QChar>
24
 
#include <QString>
25
 
 
26
 
namespace JsonQt
27
 
{
28
 
        /** Parsing exception class.
29
 
         * Raised whenever JsonQt can't pass something it's been given, for
30
 
         * whatever reason.
31
 
         */
32
 
        class JSONQT_EXPORT ParseException : public std::exception
33
 
        {
34
 
                public:
35
 
                        /** Create a ParseException.
36
 
                         * @param got is what was found in the string.
37
 
                         * @param expected is what the parser was expecting.
38
 
                         * @param remaining is what was left of the input.
39
 
                         */
40
 
                        ParseException(
41
 
                                const QString& got,
42
 
                                const QString& expected,
43
 
                                const QString& remaining
44
 
                        ) throw();
45
 
                        ~ParseException() throw();
46
 
 
47
 
                        /// A single string providing information on the
48
 
                        /// exception.
49
 
                        virtual const char* what() const throw();
50
 
 
51
 
                        /// What the parser found.
52
 
                        QString got();
53
 
                        /// What the parser was expecting.
54
 
                        QString expected();
55
 
                        /// The remaining unparsed input.
56
 
                        QString remaining();
57
 
                private:
58
 
                        QString m_got;
59
 
                        QString m_expected;
60
 
                        QString m_remaining;
61
 
        };
62
 
};
63
 
 
64
 
#endif