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

Method parse

LASlib/src/laswriter.cpp:238–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238BOOL LASwriteOpener::parse(int argc, char* argv[])
239{
240 int i;
241 for (i = 1; i < argc; i++)
242 {
243 if (argv[i][0] == '\0')
244 {
245 continue;
246 }
247 else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-help") == 0)
248 {
249 return TRUE;
250 }
251 else if (strcmp(argv[i], "-hh") == 0)
252 {
253 usage();
254 return TRUE;
255 }
256 else if (strcmp(argv[i],"-o") == 0)
257 {
258 if ((i+1) >= argc)
259 {
260 laserror("'%s' needs 1 argument: file_name", argv[i]);
261 return FALSE;
262 }
263 set_file_name(argv[i+1]);
264 *argv[i]='\0'; *argv[i+1]='\0'; i+=1;
265 }
266 else if (strcmp(argv[i],"-odir") == 0)
267 {
268 if ((i+1) >= argc)
269 {
270 laserror("'%s' needs 1 argument: directory", argv[i]);
271 return FALSE;
272 }
273 if (!set_directory(argv[i+1]))
274 {
275 laserror("'%s' is not a valid directory", argv[i+1]);
276 return FALSE;
277 }
278 *argv[i]='\0'; *argv[i+1]='\0'; i+=1;
279 }
280 else if (strcmp(argv[i],"-odix") == 0)
281 {
282 if ((i+1) >= argc)
283 {
284 laserror("'%s' needs 1 argument: appendix", argv[i]);
285 return FALSE;
286 }
287 set_appendix(argv[i+1]);
288 *argv[i]='\0'; *argv[i+1]='\0'; i+=1;
289 }
290 else if (strcmp(argv[i],"-ocut") == 0)
291 {
292 if ((i+1) >= argc)
293 {
294 laserror("'%s' needs 1 argument: number of characters to cut", argv[i]);
295 return FALSE;

Callers

nothing calls this directly

Calls 2

laserrorFunction · 0.85
usageFunction · 0.50

Tested by

no test coverage detected