-
Notifications
You must be signed in to change notification settings - Fork 0
/
utilities.cc
57 lines (46 loc) · 1.5 KB
/
utilities.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <iostream>
#include <xms.hpp>
#include <utilities.h>
using namespace std;
namespace xmsbridge {
xms::String& getValue(xms::String* ref)
{
return *ref;
}
xmsVOID displayException(xms::Exception & exception)
{
xms::Exception *linkedException;
cout << "Error Block: \n";
cout << " -> Error Code : " << exception.getErrorCode() << "\n";;
cout << " -> Error String : " << exception.getErrorString().c_str() << "\n";
cout << " -> Error Data : \n" << exception.getErrorData().c_str() << "\n";;
/*
* Get the next linked error, and act recursively
*/
linkedException = exception.getLinkedException();
if(linkedException != NULL)
{
displayException(*linkedException);
delete linkedException;
}
}
char* displayMessage(xms::TextMessage * message)
{
if (message != NULL)
{
cout << " Message Type: "; try { cout << message->getTypeId(); } catch(xms::Exception) {} ; cout << "\n";
cout << " Delivery Mode: "; try { cout << message->getJMSDeliveryMode(); } catch(xms::Exception) {} ; cout << "\n";
cout << " Expiration: "; try { cout << message->getJMSExpiration(); } catch(xms::Exception) {}; cout << "\n";
cout << " Priority: "; try { cout << message->getJMSPriority(); } catch(xms::Exception) {}; cout << "\n";
xms::String messageData = message->getText();
if(messageData != NULL)
{
cout << " Message Data: " << messageData.c_str();
return messageData.c_str();
}
else
return NULL;
}
return NULL;
}
}