diff --git a/client/src/core/session.cc b/client/src/core/session.cc index 6c45976..5ab8aca 100644 --- a/client/src/core/session.cc +++ b/client/src/core/session.cc @@ -370,16 +370,25 @@ /// @brief Search size_t Session::find(const char * str, size_t pos) const { - throw std::system_error(ENOTSUP, std::system_category()); + return toString(0,-1,0).find(str,pos); } /// @brief Compare contents. - int Session::compare(size_t baddr, const char* s, size_t len) const { - throw std::system_error(ENOTSUP, std::system_category()); + int Session::compare(size_t baddr, const char* s, int len) const { + + if(len < 0) + len = strlen(s); + + toString(baddr,len,0).compare(0,len,s); } - int Session::compare(int row, int col, const char* s, size_t len) const { - throw std::system_error(ENOTSUP, std::system_category()); + int Session::compare(int row, int col, const char* s, int len) const { + + if(len < 0) + len = strlen(s); + + return toString(row, col, len, 0).compare(0,len,s); + } diff --git a/client/src/host/actions.cc b/client/src/host/actions.cc index 9a2721f..f85f8ea 100644 --- a/client/src/host/actions.cc +++ b/client/src/host/actions.cc @@ -55,9 +55,5 @@ TN3270::Host & TN3270::Host::waitForReady() { return *this; } -TN3270::Host & TN3270::Host::waitForKeyboardUnlock() { - this->session->waitForKeyboardUnlock(timeout); - return *this; -} diff --git a/common/src/include/lib3270/ipc.h b/common/src/include/lib3270/ipc.h index af61544..c5ff55f 100644 --- a/common/src/include/lib3270/ipc.h +++ b/common/src/include/lib3270/ipc.h @@ -361,8 +361,8 @@ size_t find(const char * str, size_t pos = 0) const; /// @brief Compare contents. - int compare(size_t baddr, const char* s, size_t len) const; - int compare(int row, int col, const char* s, size_t len) const; + int compare(size_t baddr, const char* s, int len = -1) const; + int compare(int row, int col, const char* s, int len = -1) const; }; @@ -444,7 +444,10 @@ Host & connect(const char *url = nullptr); Host & disconnect(); Host & waitForReady(); - Host & waitForKeyboardUnlock(); + + inline LIB3270_KEYBOARD_LOCK_STATE waitForKeyboardUnlock() noexcept { + return this->session->waitForKeyboardUnlock(timeout); + } /// @brief Execute action by name. inline Host & action(const char *action_name) { -- libgit2 0.21.2