MCPcopy Create free account
hub / github.com/LAStools/LAStools / main

Function main

src/lasvalidate.cpp:135–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133#endif
134
135int main(int argc, char *argv[]) {
136 LasTool_lasvalidate lastool;
137 lastool.init(argc, argv, "lasvalidate");
138 double start_time = 0.0;
139 double full_start_time = 0.0;
140 FILE* file_out = stderr;
141 BOOL no_CRS_fail = FALSE;
142 BOOL is_csv = FALSE;
143 BOOL is_text = FALSE;
144 BOOL is_xml = FALSE;
145 F64 tile_size = 0.0;
146 BOOL one_report_per_file = FALSE;
147 U32 num_pass = 0;
148 U32 num_fail = 0;
149 U32 num_warning = 0;
150
151 LASreadOpener lasreadopener;
152 GeoProjectionConverter geoprojectionconverter;
153 LASwriteOpener laswriteopener;
154
155 std::string command_line = get_command_line(argc, argv);
156
157 if (argc == 1) {
158#ifdef COMPILE_WITH_GUI
159 lasvalidate_gui(argc, argv, 0);
160#else
161 wait_on_exit();
162 fprintf(stderr, "%s is better run in the command line\n", argv[0]);
163 std::string file_name;
164 fprintf(stderr, "enter input file: ");
165 std::getline(std::cin, file_name);
166 if (!file_name.empty() && (file_name.back() == '\n' || file_name.back() == '\r')) {
167 file_name.pop_back();
168 }
169 lasreadopener.set_file_name(file_name.c_str());
170#endif
171 } else {
172 for (int i = 1; i < argc; i++) {
173 if ((unsigned char)argv[i][0] == 0x96) argv[i][0] = '-';
174 }
175 lasreadopener.parse(argc, argv);
176 geoprojectionconverter.parse(argc, argv);
177 laswriteopener.parse(argc, argv);
178 }
179
180 if (laswriteopener.is_piped()) {
181 file_out = stdout;
182 }
183
184 U32 num_files = lasreadopener.get_file_name_number();
185
186 if (num_files > 1) {
187 halt_on_error(false);
188 LASMessage(LAS_INFO, "more than 1 input files to check. '-errors_ignore' will be used by default for %s", lastool.name.c_str());
189 }
190
191 auto arg_local = [&](int& i) -> bool {
192 if (strcmp(argv[i], "-quiet") == 0) {

Callers

nothing calls this directly

Calls 15

get_command_lineFunction · 0.85
LASMessageFunction · 0.85
laserrorFunction · 0.85
open_report_outputFunction · 0.85
write_versionFunction · 0.85
to_stringFunction · 0.85
emptyMethod · 0.80
get_file_name_numberMethod · 0.80
get_directoryMethod · 0.80
make_file_nameMethod · 0.80
set_formatMethod · 0.80
set_directoryMethod · 0.80

Tested by

no test coverage detected