Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
Exception.h File Reference
#include "utils/StringUtils.h"
#include <stdarg.h>

Classes

class  XbmcCommons::Exception
 

Namespaces

namespace  XbmcCommons
 

Macros

#define XBMCCOMMONS_ATTRIB_EXCEPTION_FORMAT
 
#define XBMCCOMMONS_COPYVARARGS(fmt)
 
#define XBMCCOMMONS_STANDARD_EXCEPTION(E)
 
#define XBMCCOMMONS_HANDLE_UNCHECKED
 

Functions

 XbmcCommons::XBMCCOMMONS_STANDARD_EXCEPTION (UncheckedException)
 

Macro Definition Documentation

◆ XBMCCOMMONS_ATTRIB_EXCEPTION_FORMAT

#define XBMCCOMMONS_ATTRIB_EXCEPTION_FORMAT

◆ XBMCCOMMONS_COPYVARARGS

#define XBMCCOMMONS_COPYVARARGS ( fmt)
Value:
va_list argList; va_start(argList, fmt); Set(fmt, argList); va_end(argList)

◆ XBMCCOMMONS_HANDLE_UNCHECKED

#define XBMCCOMMONS_HANDLE_UNCHECKED
Value:
catch (const XbmcCommons::UncheckedException& ) { throw; } \
catch (const XbmcCommons::UncheckedException* ) { throw; }

In cases where you catch(...){} you will (may) inadvertently be catching UncheckedException's. Therefore this macro will allow you to do something equivalent to: catch (anything except UncheckedException) {}

In order to avoid catching UncheckedException, use the macro as follows:

try { ... } XBMCCOMMONS_HANDLE_UNCHECKED catch(...){ ... }

◆ XBMCCOMMONS_STANDARD_EXCEPTION

#define XBMCCOMMONS_STANDARD_EXCEPTION ( E)
Value:
class E : public XbmcCommons::Exception \
{ \
public: \
inline E(const char* message,...) XBMCCOMMONS_ATTRIB_EXCEPTION_FORMAT : Exception(#E) { XBMCCOMMONS_COPYVARARGS(message); } \
\
inline E(const E& other) : Exception(other) {} \
}
Definition commons/Exception.h:45
#define XBMCCOMMONS_ATTRIB_EXCEPTION_FORMAT
Definition commons/Exception.h:24