LibPkg
exception.h
Go to the documentation of this file.
1 // This file is part of the LibPkg.
2 //
3 // Copyright 2003-2020 Graham Shaw
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 // Cut down version to use with LibPkg created by Alan Buckley
18 // to remove the RTK dependency.
19 // Modified from RTK exception to add extra information
20 // by Theo Markettos
21 
22 #ifndef _LIBPKG_OS_EXCEPTION
23 #define _LIBPKG_OS_EXCEPTION
24 
25 #include <exception>
26 #include "kernel.h"
27 
28 namespace pkg {
29 namespace os {
30 
33 class exception:
34  public std::exception
35 {
36 private:
38  _kernel_oserror _err;
39 public:
47  exception(_kernel_oserror* err);
48  exception(_kernel_oserror* err, unsigned int number, unsigned int r0);
49 
52  virtual ~exception() throw() {}
53 
60  virtual const char* what() const throw();
61 };
62 
63 } /* namespace os */
64 } /* namespace pkg */
65 
66 #endif
An exception class to represent a RISC OS error block.
Definition: exception.h:33
The namespace used to hold the package management library.
Definition: auto_dir.cc:23
virtual const char * what() const
Get message.
Definition: exception.cc:47
exception(_kernel_oserror *err)
Construct exception from RISC OS error block.
Definition: exception.cc:32
virtual ~exception()
Destroy exception.
Definition: exception.h:52

Reference Manual LibPkg Version 0.9.0 (4 Sep 2020)