Commit 274aff52bb0b1801a83c1afb71d4dd543ad6d0eb
1 parent
85048500
Exists in
master
and in
5 other branches
Incluindo método para pegar a tela toda (a pedido).
Showing
3 changed files
with
17 additions
and
0 deletions
Show diff stats
src/include/pw3270cpp.h
| @@ -204,6 +204,7 @@ | @@ -204,6 +204,7 @@ | ||
| 204 | int cmp_string_at(int row, int col, const char *text); | 204 | int cmp_string_at(int row, int col, const char *text); |
| 205 | int wait_for_string_at(int row, int col, const char *key, int timeout); | 205 | int wait_for_string_at(int row, int col, const char *key, int timeout); |
| 206 | int input_string(const char *str); | 206 | int input_string(const char *str); |
| 207 | + string get_contents(); | ||
| 207 | 208 | ||
| 208 | inline operator string() { | 209 | inline operator string() { |
| 209 | return get_string(); | 210 | return get_string(); |
src/libpw3270cpp/session.cc
| @@ -686,6 +686,20 @@ | @@ -686,6 +686,20 @@ | ||
| 686 | return -1; | 686 | return -1; |
| 687 | } | 687 | } |
| 688 | 688 | ||
| 689 | + string session::get_contents() | ||
| 690 | + { | ||
| 691 | + string rc = ""; | ||
| 692 | + int rows = get_height(); | ||
| 693 | + int cols = get_width(); | ||
| 694 | + | ||
| 695 | + for(int r = 0; r < rows; r++) { | ||
| 696 | + rc += get_string_at(r+1,0,cols).c_str(); | ||
| 697 | + rc += "\n"; | ||
| 698 | + } | ||
| 699 | + | ||
| 700 | + return rc; | ||
| 701 | + } | ||
| 702 | + | ||
| 689 | 703 | ||
| 690 | } | 704 | } |
| 691 | 705 |
src/libpw3270cpp/testprogram.cc
| @@ -70,6 +70,8 @@ | @@ -70,6 +70,8 @@ | ||
| 70 | cout << "\tIsReady: " << session->is_ready() << endl; | 70 | cout << "\tIsReady: " << session->is_ready() << endl; |
| 71 | cout << "\tString(1,2,26) " << session->get_string_at(1,2,26) << endl; | 71 | cout << "\tString(1,2,26) " << session->get_string_at(1,2,26) << endl; |
| 72 | 72 | ||
| 73 | + cout << "Conteúdo:" << endl << session->get_contents() << endl; | ||
| 74 | + | ||
| 73 | session->disconnect(); | 75 | session->disconnect(); |
| 74 | delete session; | 76 | delete session; |
| 75 | } | 77 | } |