Theora Playback Library  1.1.0
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.googlecode.com
4 *************************************************************************************
5 Copyright (c) 2008-2014 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://opensource.org/licenses/BSD-3-Clause
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
Definition: TheoraException.h:15
int mLineNumber
Definition: TheoraException.h:19
virtual const std::string & getErrorText()
Definition: TheoraException.h:28
virtual ~_TheoraGenericException()
Definition: TheoraException.h:22
std::string mType
Definition: TheoraException.h:18
#define exception_cls(name)
Definition: TheoraException.h:36
#define TheoraPlayerExport
Definition: TheoraExport.h:25
const std::string getType()
Definition: TheoraException.h:30