mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-06-08 16:36:25 +02:00
C++ exceptions now propagate through python
This commit is contained in:
parent
a8149abeec
commit
821f394602
3 changed files with 34 additions and 31 deletions
|
@ -7,18 +7,34 @@
|
|||
#include <nfc/nfc.h>
|
||||
#include <nfc/nfc-types.h>
|
||||
|
||||
class NFCError: public std::exception
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
NFCError(const std::string& msg);
|
||||
|
||||
const char *what() const throw() {return _msg.c_str();}
|
||||
|
||||
~NFCError() throw() {}
|
||||
|
||||
protected:
|
||||
|
||||
std::string _msg;
|
||||
};
|
||||
|
||||
class NFCDevice
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
NFCDevice();
|
||||
NFCDevice() throw(NFCError);
|
||||
|
||||
virtual ~NFCDevice();
|
||||
|
||||
std::string scanUID();
|
||||
std::string scanUID() throw(NFCError);
|
||||
|
||||
void open();
|
||||
void open() throw(NFCError);
|
||||
|
||||
bool opened() const {return _opened;}
|
||||
|
||||
|
@ -43,19 +59,3 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
class NFCError: public std::exception
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
NFCError(const std::string& msg);
|
||||
|
||||
const char *what() const throw() {return _msg.c_str();}
|
||||
|
||||
~NFCError() throw() {}
|
||||
|
||||
protected:
|
||||
|
||||
std::string _msg;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue