Main.cpp 452 B

1234567891011121314151617181920212223
  1. #include <iostream>
  2. #include <cstring>
  3. #include "RawReader.h"
  4. int main() {
  5. RawReader<10, 5> reader(1);
  6. while(reader.canRead()) {
  7. // simulate work between reads
  8. usleep(50000);
  9. //std::cout << "Work\n";
  10. const char* s = reader.readLine("> ");
  11. if(s != nullptr) {
  12. std::cout << s << "\n";
  13. if(strcmp(s, "q") == 0) {
  14. break;
  15. }
  16. }
  17. }
  18. return 0;
  19. }