Commit 274aff52bb0b1801a83c1afb71d4dd543ad6d0eb

Authored by Perry Werneck
1 parent 85048500

Incluindo método para pegar a tela toda (a pedido).

src/include/pw3270cpp.h
... ... @@ -204,6 +204,7 @@
204 204 int cmp_string_at(int row, int col, const char *text);
205 205 int wait_for_string_at(int row, int col, const char *key, int timeout);
206 206 int input_string(const char *str);
  207 + string get_contents();
207 208  
208 209 inline operator string() {
209 210 return get_string();
... ...
src/libpw3270cpp/session.cc
... ... @@ -686,6 +686,20 @@
686 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 70 cout << "\tIsReady: " << session->is_ready() << endl;
71 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 75 session->disconnect();
74 76 delete session;
75 77 }
... ...