]> cygwin.com Git - cygwin-apps/setup.git/blob - Exception.h
2003-02-16 Pavel Tsekov <ptsekov@gmx.net>
[cygwin-apps/setup.git] / Exception.h
1 /*
2 * Copyright (c) 2001, Robert Collins.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
11 *
12 * Written by Robert Collins <rbtcollins@hotmail.com>
13 *
14 */
15
16 /* this is the parent class for all package source (not source code - installation
17 * source as in http/ftp/disk file) operations.
18 */
19
20 #ifndef _EXCEPTION_H_
21 #define _EXCEPTION_H_
22
23 #include <exception>
24 #include "String++.h"
25
26 /* Generic excpetion class for throwing exceptions */
27 class Exception : public std::exception {
28 public:
29 Exception (char const *where, char const *message, int appErrNo = 0);
30 Exception (char const *where, const String &message, int appErrNo = 0);
31 ~Exception () throw () {}
32 char const *what() const throw();
33 int errNo() const;
34 private:
35 String _message;
36 int appErrNo;
37 };
38
39 // Where should these live?
40 #define APPERR_CORRUPT_PACKAGE 1
41 #define APPERR_IO_ERROR 2
42
43 #endif /* _EXCEPTION_H_ */
This page took 0.03891 seconds and 6 git commands to generate.