blob: ea10f9d7b8d36d3677c153b89118b6e95e86a4f5 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
Adam Tkac35e6d4c2010-04-23 14:12:18 +00002 * Copyright (C) 2004 Red Hat Inc.
3 * Copyright (C) 2010 TigerVNC Team
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00004 *
5 * This 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 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18 * USA.
19 */
20
21#ifndef __RDR_EXCEPTION_H__
22#define __RDR_EXCEPTION_H__
23
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000024namespace rdr {
25
26 struct Exception {
27 enum { len = 256 };
28 char str_[len];
Adam Tkac20e0d712008-11-14 14:48:21 +000029 Exception(const char *format = 0, ...);
Constantin Kaplinskya1958b72007-09-05 09:31:08 +000030 virtual ~Exception() {}
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000031 virtual const char* str() const { return str_; }
32 };
33
34 struct SystemException : public Exception {
35 int err;
36 SystemException(const char* s, int err_);
37 };
38
39 struct TimedOut : public Exception {
40 TimedOut(const char* s="Timed out") : Exception(s) {}
41 };
42
43 struct EndOfStream : public Exception {
44 EndOfStream(const char* s="End of stream") : Exception(s) {}
45 };
46
47 struct FrameException : public Exception {
48 FrameException(const char* s="Frame exception") : Exception(s) {}
49 };
Adam Tkac35e6d4c2010-04-23 14:12:18 +000050
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000051}
52
53#endif