Commit 5e054e6e9073ff78e6fdba52a8fb305e5919223c
1 parent
750a9193
Exists in
master
and in
1 other branch
Adding product name when session id begins with ":" to simplify usage.
One just need to instantiate a Host object with ":a" to get the first session without needing of the name of the product.
Showing
1 changed file
with
10 additions
and
0 deletions
Show diff stats
client/src/core/session.cc
@@ -37,6 +37,7 @@ | @@ -37,6 +37,7 @@ | ||
37 | */ | 37 | */ |
38 | 38 | ||
39 | #include <ipc-client-internals.h> | 39 | #include <ipc-client-internals.h> |
40 | + #include <string> | ||
40 | #include <cstring> | 41 | #include <cstring> |
41 | 42 | ||
42 | /*---[ Implement ]----------------------------------------------------------------------------------*/ | 43 | /*---[ Implement ]----------------------------------------------------------------------------------*/ |
@@ -49,6 +50,15 @@ | @@ -49,6 +50,15 @@ | ||
49 | return Local::getSessionInstance(); | 50 | return Local::getSessionInstance(); |
50 | } | 51 | } |
51 | 52 | ||
53 | + if(*id == ':') { | ||
54 | + | ||
55 | + std::string name{LIB3270_STRINGIZE_VALUE_OF(PRODUCT_NAME)}; | ||
56 | + name += id; | ||
57 | + | ||
58 | + return IPC::getSessionInstance(name.c_str()); | ||
59 | + | ||
60 | + } | ||
61 | + | ||
52 | return IPC::getSessionInstance(id); | 62 | return IPC::getSessionInstance(id); |
53 | 63 | ||
54 | } | 64 | } |