Theora Playback Library  1.0.0
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TheoraException.h
Go to the documentation of this file.
1 /************************************************************************************
2 This source file is part of the Theora Video Playback Library
3 For latest info, see http://libtheoraplayer.sourceforge.net/
4 *************************************************************************************
5 Copyright (c) 2008-2013 Kresimir Spes (kspes@cateia.com)
6 This program is free software; you can redistribute it and/or modify it under
7 the terms of the BSD license: http://www.opensource.org/licenses/bsd-license.php
8 *************************************************************************************/
9 #ifndef EXCEPTION_H
10 #define EXCEPTION_H
11 
12 #include <string>
13 #include "TheoraExport.h"
14 
16 {
17 public:
18  std::string mErrText,mFile,mType;
20 
21  _TheoraGenericException(const std::string& errorText,std::string type="",std::string file="",int line=0);
23 
24  virtual std::string repr();
25 
26  void writeOutput();
27 
28  virtual const std::string& getErrorText() { return mErrText; }
29 
30  const std::string getType(){ return mType; }
31 };
32 
33 #define TheoraGenericException(msg) _TheoraGenericException(msg,"TheoraGenericException",__FILE__,__LINE__)
34 
35 
36 #define exception_cls(name) class name : public _TheoraGenericException \
37 { \
38 public: \
39  name(const std::string& errorText,std::string type="",std::string file="",int line=0) : \
40  _TheoraGenericException(errorText,type,file,line){} \
41 }
42 
43 exception_cls(_KeyException);
44 
45 
46 #endif