Commit 90c3cc6b37b4cb9062e14379a3e72edda51ca510
1 parent
3f3862ca
Exists in
master
and in
1 other branch
Implementing IPC methods.
Showing
3 changed files
with
20 additions
and
12 deletions
Show diff stats
client/src/core/session.cc
... | ... | @@ -370,16 +370,25 @@ |
370 | 370 | |
371 | 371 | /// @brief Search |
372 | 372 | size_t Session::find(const char * str, size_t pos) const { |
373 | - throw std::system_error(ENOTSUP, std::system_category()); | |
373 | + return toString(0,-1,0).find(str,pos); | |
374 | 374 | } |
375 | 375 | |
376 | 376 | /// @brief Compare contents. |
377 | - int Session::compare(size_t baddr, const char* s, size_t len) const { | |
378 | - throw std::system_error(ENOTSUP, std::system_category()); | |
377 | + int Session::compare(size_t baddr, const char* s, int len) const { | |
378 | + | |
379 | + if(len < 0) | |
380 | + len = strlen(s); | |
381 | + | |
382 | + toString(baddr,len,0).compare(0,len,s); | |
379 | 383 | } |
380 | 384 | |
381 | - int Session::compare(int row, int col, const char* s, size_t len) const { | |
382 | - throw std::system_error(ENOTSUP, std::system_category()); | |
385 | + int Session::compare(int row, int col, const char* s, int len) const { | |
386 | + | |
387 | + if(len < 0) | |
388 | + len = strlen(s); | |
389 | + | |
390 | + return toString(row, col, len, 0).compare(0,len,s); | |
391 | + | |
383 | 392 | } |
384 | 393 | |
385 | 394 | ... | ... |
client/src/host/actions.cc
common/src/include/lib3270/ipc.h
... | ... | @@ -361,8 +361,8 @@ |
361 | 361 | size_t find(const char * str, size_t pos = 0) const; |
362 | 362 | |
363 | 363 | /// @brief Compare contents. |
364 | - int compare(size_t baddr, const char* s, size_t len) const; | |
365 | - int compare(int row, int col, const char* s, size_t len) const; | |
364 | + int compare(size_t baddr, const char* s, int len = -1) const; | |
365 | + int compare(int row, int col, const char* s, int len = -1) const; | |
366 | 366 | |
367 | 367 | }; |
368 | 368 | |
... | ... | @@ -444,7 +444,10 @@ |
444 | 444 | Host & connect(const char *url = nullptr); |
445 | 445 | Host & disconnect(); |
446 | 446 | Host & waitForReady(); |
447 | - Host & waitForKeyboardUnlock(); | |
447 | + | |
448 | + inline LIB3270_KEYBOARD_LOCK_STATE waitForKeyboardUnlock() noexcept { | |
449 | + return this->session->waitForKeyboardUnlock(timeout); | |
450 | + } | |
448 | 451 | |
449 | 452 | /// @brief Execute action by name. |
450 | 453 | inline Host & action(const char *action_name) { | ... | ... |