summaryrefslogtreecommitdiff
path: root/common/JackException.h
diff options
context:
space:
mode:
authorsletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224>2008-05-26 09:49:27 +0000
committersletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224>2008-05-26 09:49:27 +0000
commitc0f0fd7cc9931627e3c096bc9468b5b00875da31 (patch)
tree049d88f395071611192f46fc3b6e4c4b4caa7781 /common/JackException.h
parent408f1b181bd8121b6ffc2afc56d36ca1991eee12 (diff)
downloadjack2-c0f0fd7cc9931627e3c096bc9468b5b00875da31.tar.gz
Merge control branch.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2339 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'common/JackException.h')
-rw-r--r--common/JackException.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/common/JackException.h b/common/JackException.h
index 603c5003..c044f439 100644
--- a/common/JackException.h
+++ b/common/JackException.h
@@ -58,6 +58,71 @@ namespace Jack
JackDriverException(const char* msg) : JackException(msg)
{}
};
+
+}
+
+#endif
+/*
+Copyright (C) 2008 Grame
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __JackException__
+#define __JackException__
+
+#include <stdexcept>
+#include <iostream>
+#include <string>
+#include "JackError.h"
+
+namespace Jack
+{
+
+ class JackException : public std::runtime_error {
+
+ public:
+
+ JackException(const std::string& msg) : runtime_error(msg)
+ {}
+ JackException(const char* msg) : runtime_error(msg)
+ {}
+
+ std::string Message()
+ {
+ return what();
+ }
+
+ void PrintMessage()
+ {
+ std::string str = what();
+ jack_error(str.c_str());
+ }
+ };
+
+ class JackDriverException : public JackException {
+
+ public:
+
+ JackDriverException(const std::string& msg) : JackException(msg)
+ {}
+ JackDriverException(const char* msg) : JackException(msg)
+ {}
+ };
+
}
#endif