Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.14 KB | None | 0 0
  1. *** handler_emwin.cc    Thu Jun 21 19:44:41 2018
  2. --- handler_emwin.cc    Thu Jun 21 19:44:36 2018
  3. ***************
  4. *** 36,49 ****
  5.     fb.time = time;
  6.  
  7.     // Decompress if this is a ZIP file
  8.     if (nlh.noaaSpecificCompression == 10) {
  9. !     auto zip = Zip(f->getData());
  10. !     fb.filename = zip.fileName();
  11.  
  12. !     // Use filename and extension straight from ZIP file
  13. !     fileWriter_->write(fb.build("{filename}"), zip.read());
  14. !     return;
  15.     }
  16.  
  17.     // Write with TXT extension if this is not a compressed file
  18.     if (nlh.noaaSpecificCompression == 0) {
  19. --- 36,55 ----
  20.     fb.time = time;
  21.  
  22.     // Decompress if this is a ZIP file
  23.     if (nlh.noaaSpecificCompression == 10) {
  24. !     try {
  25. !       auto zip = Zip(f->getData());
  26.  
  27. !       fb.filename = zip.fileName();
  28. !
  29. !       // Use filename and extension straight from ZIP file
  30. !       fileWriter_->write(fb.build("{filename}"), zip.read());
  31. !       return;
  32. !     } catch(const std::exception &e)  {
  33. !       // Zip decompression failed
  34. !       return;
  35. !     }
  36.     }
  37.  
  38.     // Write with TXT extension if this is not a compressed file
  39.     if (nlh.noaaSpecificCompression == 0) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement