The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
exception.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2016 by Mark de Wever <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * @file
17  * Contains the exceptions throw by the @ref gui2::iterator::titerator classes.
18  */
19 
20 #ifndef GUI_WIDGETS_AUXILIARY_ITERATOR_EXCEPTION_HPP_INCLUDED
21 #define GUI_WIDGETS_AUXILIARY_ITERATOR_EXCEPTION_HPP_INCLUDED
22 
24 
25 #include <stdexcept>
26 #include <string>
27 
28 namespace gui2
29 {
30 
31 namespace iterator
32 {
33 
34 /**
35  * Thrown when deferring an invalid iterator.
36  *
37  * Invalid means the initial state at_end() == true.
38  */
39 class tlogic_error : public std::logic_error, public tlua_jailbreak_exception
40 {
41 public:
42  explicit tlogic_error(const std::string& message)
43  : std::logic_error("GUI2 ITERATOR: " + message)
45  {
46  }
47 
48 private:
50 };
51 
52 /**
53  * Thrown when moving an invalid iterator.
54  *
55  * Invalid means the initial state at_end() == true.
56  */
57 class trange_error : public std::range_error, public tlua_jailbreak_exception
58 {
59 public:
60  explicit trange_error(const std::string& message)
61  : std::range_error("GUI2 ITERATOR: " + message)
63  {
64  }
65 
66 private:
68 };
69 
70 } // namespace iterator
71 
72 } // namespace gui2
73 
74 #endif
Thrown when deferring an invalid iterator.
Definition: exception.hpp:39
#define IMPLEMENT_LUA_JAILBREAK_EXCEPTION(type)
Helper macro for classes deriving from tlua_jailbreak_exception.
Thrown when moving an invalid iterator.
Definition: exception.hpp:57
STL namespace.
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
tlogic_error(const std::string &message)
Definition: exception.hpp:42
Base class for exceptions that want to be thrown 'through' lua.
trange_error(const std::string &message)
Definition: exception.hpp:60
GLsizei GLenum GLuint GLuint GLsizei char * message
Definition: glew.h:2499
std::string::const_iterator iterator
Definition: tokenizer.hpp:21
GLsizei const GLcharARB ** string
Definition: glew.h:4503