Commit 89300dc0aba4d6ebcb5db00e99f0a2702aee3d6c
1 parent
8472a37b
Exists in
master
and in
1 other branch
Adding compare & find methods to the convenience object.
Showing
2 changed files
with
28 additions
and
3 deletions
Show diff stats
client/src/host/string.cc
| ... | ... | @@ -59,3 +59,26 @@ std::string TN3270::Host::toString(unsigned int row, unsigned int col, int len, |
| 59 | 59 | return this->session->toString(row,col,len,lf); |
| 60 | 60 | |
| 61 | 61 | } |
| 62 | + | |
| 63 | +/// @brief Search | |
| 64 | +size_t TN3270::Host::find(const char * str, size_t pos) const { | |
| 65 | + | |
| 66 | + this->session->waitForReady(this->timeout); | |
| 67 | + this->session->find(str,pos); | |
| 68 | + | |
| 69 | +} | |
| 70 | + | |
| 71 | +/// @brief Compare contents. | |
| 72 | +int TN3270::Host::compare(int baddr, const char* s, int len) const { | |
| 73 | + | |
| 74 | + this->session->waitForReady(this->timeout); | |
| 75 | + return this->session->compare(baddr, s, len); | |
| 76 | + | |
| 77 | +} | |
| 78 | + | |
| 79 | +int TN3270::Host::compare(unsigned int row, unsigned int col, const char* s, int len) const { | |
| 80 | + | |
| 81 | + this->session->waitForReady(this->timeout); | |
| 82 | + return this->session->compare(row,col,s,len); | |
| 83 | + | |
| 84 | +} | ... | ... |
client/src/include/lib3270/ipc.h
| ... | ... | @@ -642,9 +642,11 @@ |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | /// @brief Search |
| 645 | - inline size_t find(const char * str, size_t pos = 0) const { | |
| 646 | - return session->find(str,pos); | |
| 647 | - } | |
| 645 | + size_t find(const char * str, size_t pos = 0) const; | |
| 646 | + | |
| 647 | + /// @brief Compare contents. | |
| 648 | + int compare(int baddr, const char* s, int len = -1) const; | |
| 649 | + int compare(unsigned int row, unsigned int col, const char* s, int len = -1) const; | |
| 648 | 650 | |
| 649 | 651 | // Set contents. |
| 650 | 652 | ... | ... |