16 #include <Poco/Exception.h> 44 : szAnsi_(static_cast<char*>(
System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(s).ToPointer()))
50 System::Runtime::InteropServices::Marshal::FreeHGlobal(System::IntPtr(szAnsi_));
53 operator LPCSTR()
const 67 : szUnicode_(static_cast<wchar_t*>(
System::Runtime::InteropServices::Marshal::StringToHGlobalUni(s).ToPointer()))
73 System::Runtime::InteropServices::Marshal::FreeHGlobal(System::IntPtr(szUnicode_));
76 operator LPCWSTR()
const 86 #define StringConvT StringConvW 88 #define StringConvT StringConvA 97 static array<unsigned char>^
Copy(
const unsigned char* buffer,
int bufferSize)
99 array<unsigned char>^ a =
gcnew array<unsigned char>(bufferSize);
100 for (
int i = 0; i < bufferSize; ++i)
119 : ApplicationException()
125 : ApplicationException(message)
132 : ApplicationException(message, innerException)
137 KdriveException(System::Runtime::Serialization::SerializationInfo^ info, System::Runtime::Serialization::StreamingContext context)
139 : ApplicationException(info, context)
147 static void Rethrow(std::exception& exception)
149 Poco::Exception* e =
dynamic_cast<Poco::Exception*
>(&exception);
150 const std::string strError = e ? e->displayText() : exception.what();
151 const std::wstring wstrError(strError.begin(), strError.end());
152 System::String^
string =
gcnew System::String(wstrError.c_str());
161 #define WZ_KDRIVE_CLR_DEFAULT_CATCH \ 162 catch (std::exception& exception) { kdrive::ExceptionHandler::Rethrow(exception); } \ 163 catch (...) { throw; } 170 #define WZ_KDRIVE_CLR_CATCH_BLACK_HOLE \ 171 catch (std::exception& exception) { kdrive::ExceptionHandler::Rethrow(exception); } \ 172 catch (...) { throw; } \ 173 throw gcnew kdrive::KdriveException("Should Never Reach This Exception!"); Definition: kdriveManagedInterop.h:62
Definition: kdriveManagedInterop.h:39
StringConvW(System::String^s)
Definition: kdriveManagedInterop.h:66
StringConvA(System::String^s)
Definition: kdriveManagedInterop.h:43
Definition: kdriveManagedInterop.h:95
KdriveException(System::String^message, System::Exception^innerException)
Definition: kdriveManagedInterop.h:130
KdriveException()
Definition: kdriveManagedInterop.h:117
KdriveException(System::Runtime::Serialization::SerializationInfo^info, System::Runtime::Serialization::StreamingContext context)
Definition: kdriveManagedInterop.h:137
Definition: BaosConnection.h:31
static array< unsigned char > Copy(const unsigned char *buffer, int bufferSize)
Definition: kdriveManagedInterop.h:97
~StringConvA()
Definition: kdriveManagedInterop.h:48
Definition: kdriveManagedInterop.h:21
KdriveException(System::String^message)
Definition: kdriveManagedInterop.h:123
Definition: kdriveManagedInterop.h:114
Definition: BaosConnection.h:22
void operator()(void const *) const
Definition: kdriveManagedInterop.h:23
static void Rethrow(std::exception &exception)
Definition: kdriveManagedInterop.h:147
Definition: kdriveManagedInterop.h:145
~StringConvW()
Definition: kdriveManagedInterop.h:71