| 100 | } |
| 101 | |
| 102 | static void open_report_output(const LASwriteOpener& laswriteopener, FILE*& file_out, ValidateWriter*& writer, BOOL is_csv, BOOL consol_out) { |
| 103 | if (consol_out == FALSE) { |
| 104 | // open the text output file |
| 105 | file_out = LASfopen(laswriteopener.get_file_name(), "w"); |
| 106 | |
| 107 | if (file_out == nullptr) { |
| 108 | LASMessage(LAS_WARNING, "could not open output text file '%s'", laswriteopener.get_file_name()); |
| 109 | file_out = stderr; |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | // output logging |
| 114 | |
| 115 | writer = FormatWriterFactory::createWriter(laswriteopener.get_format(), file_out); |
| 116 | |
| 117 | if (writer == nullptr) { |
| 118 | LASMessage(LAS_ERROR, "could not create writer to create validation report"); |
| 119 | return; |
| 120 | } |
| 121 | |
| 122 | if (file_out != nullptr && !is_csv) writer->open("LASvalidator"); |
| 123 | } |
| 124 | |
| 125 | static double taketime() { |
| 126 | return (double)(clock())/CLOCKS_PER_SEC; |
no test coverage detected