tbx  0.7.3
tbxexcept.h
1 /*
2  * tbx RISC OS toolbox library
3  *
4  * Copyright (C) 2010 Alan Buckley All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 
25 #ifndef TBXEXCEPT_H_
26 #define TBXEXCEPT_H_
27 
28 #include <stdexcept>
29 
30 
35 class ObjectClassError : public std::invalid_argument
36 {
37 public:
38  ObjectClassError() : std::invalid_argument("C++ object/toolbox object class mismatch") {}
39 };
40 
45 class GadgetClassError : public std::invalid_argument
46 {
47 public:
48  GadgetClassError() : std::invalid_argument("C++ gadget/toolbox gadget class mismatch") {}
49 };
50 
55 class ObjectNullError : public std::invalid_argument
56 {
57 public:
58  ObjectNullError() : std::invalid_argument("NULL toolbox object handle") {};
59 };
60 
65 class ComponentNullError : public std::invalid_argument
66 {
67 public:
68  ComponentNullError() : std::invalid_argument("NULL gagdet id") {};
69 };
70 
75 class ResMenuItemError : public std::invalid_argument
76 {
77 public:
78  ResMenuItemError() : std::invalid_argument("Component ID isn't in menu resource") {};
79 };
80 
81 #endif /* TBXEXCEPT_H_ */
Exception thrown is a component id does not refer to an item in a menu resource.
Definition: tbxexcept.h:75
Exception thrown when a C++ object representing a toolbox object uses a method that requires a non-nu...
Definition: tbxexcept.h:55
Exception thrown when a C++ object representing a toolbox gadget uses a method that requires a non-nu...
Definition: tbxexcept.h:65
Exception thrown when an underlying toolbox gadget id doesn't match the C++ class used to represent t...
Definition: tbxexcept.h:45
Exception thrown when the underlying toolbox object class doesn't match the C++ class used to represe...
Definition: tbxexcept.h:35