|
|
|
@ -17,27 +17,28 @@ |
|
|
|
|
#ifndef MAX_ATR_SIZE |
|
|
|
|
#define MAX_ATR_SIZE 33 |
|
|
|
|
#endif |
|
|
|
|
namespace pcsc { |
|
|
|
|
//! stupid windows needs std::wstring
|
|
|
|
|
std::wstring strconv(std::string s) { |
|
|
|
|
return std::wstring(s.begin(), s.end()); |
|
|
|
|
} |
|
|
|
|
std::string strconv(std::wstring s) { |
|
|
|
|
return std::string(s.begin(), s.end()); |
|
|
|
|
namespace pcsc { |
|
|
|
|
//! stupid windows needs std::wstring
|
|
|
|
|
std::wstring strconv(std::string s) { |
|
|
|
|
return std::wstring(s.begin(), s.end()); |
|
|
|
|
} |
|
|
|
|
std::string strconv(std::wstring s) { |
|
|
|
|
return std::string(s.begin(), s.end()); |
|
|
|
|
} |
|
|
|
|
typedef wchar_t char_t; |
|
|
|
|
typedef std::wstring string; |
|
|
|
|
} |
|
|
|
|
typedef wchar_t char_t; |
|
|
|
|
typedef std::wstring string; |
|
|
|
|
} |
|
|
|
|
#else |
|
|
|
|
#include <PCSC/pcsclite.h> |
|
|
|
|
#include <PCSC/wintypes.h> |
|
|
|
|
namespace pcsc { |
|
|
|
|
const std::string& strconv(const std::string& s) { |
|
|
|
|
return s; |
|
|
|
|
#include <PCSC/winscard.h> |
|
|
|
|
namespace pcsc { |
|
|
|
|
const std::string& strconv(const std::string& s) { |
|
|
|
|
return s; |
|
|
|
|
} |
|
|
|
|
typedef char char_t; |
|
|
|
|
typedef std::string string; |
|
|
|
|
} |
|
|
|
|
typedef char char_t; |
|
|
|
|
typedef std::string string; |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp> |
|
|
|
@ -403,6 +404,7 @@ namespace pcsc { |
|
|
|
|
|
|
|
|
|
//! Get the describing text of the last error
|
|
|
|
|
std::string error() const { |
|
|
|
|
#ifdef WIN32 |
|
|
|
|
std::stringstream ss; |
|
|
|
|
switch (_state) { |
|
|
|
|
case ERROR_BROKEN_PIPE: |
|
|
|
@ -634,6 +636,9 @@ namespace pcsc { |
|
|
|
|
<<(_state&0xffff); |
|
|
|
|
} |
|
|
|
|
return ss.str(); |
|
|
|
|
#else |
|
|
|
|
return pcsc_stringify_error(_state);
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//................................................................methods
|
|
|
|
|