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

Method parse

LASlib/src/lasreader.cpp:1679–2324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1677}
1678
1679void LASreadOpener::parse(int argc, char* argv[], BOOL parse_ignore, BOOL suppress_ignore) {
1680 int i;
1681 std::vector<std::string> input_patterns;
1682
1683 for (i = 1; i < argc; i++) {
1684 if (argv[i][0] == '\0') {
1685 continue;
1686 } else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-help") == 0) {
1687 return;
1688 } else if (strcmp(argv[i], "-hh") == 0) {
1689 LASfilter().usage();
1690 LAStransform().usage();
1691 LASignore().usage();
1692 usage();
1693 return;
1694 } else if (strncmp(argv[i], "-i", 2) == 0) {
1695 if (strcmp(argv[i], "-i") == 0) {
1696 if ((i + 1) >= argc) {
1697 laserror("'%s' needs at least 1 argument: file_name or wild_card", argv[i]);
1698 }
1699 *argv[i] = '\0';
1700 i += 1;
1701 while ((i < argc) && (*argv[i] != '-') && (*argv[i] != '\0')) {
1702 input_patterns.emplace_back(argv[i]);
1703 *argv[i] = '\0';
1704 i += 1;
1705 }
1706 i -= 1;
1707 } else if (strncmp(argv[i], "-ignore_", 8) == 0) {
1708 if (parse_ignore) {
1709 if (ignore == 0) {
1710 ignore = new LASignore();
1711 }
1712 if (!ignore->parse(i, argc, argv)) {
1713 delete ignore;
1714 ignore = 0;
1715 return;
1716 }
1717 } else if (!suppress_ignore) {
1718 LASMessage(LAS_WARNING, "this tool does not process '-ignore_xxxx' options");
1719 }
1720 } else if (strncmp(argv[i], "-inside", 7) == 0) {
1721 if (strcmp(argv[i], "-inside_tile") == 0) {
1722 if ((i + 3) >= argc) {
1723 laserror("'%s' needs 3 arguments: ll_x ll_y size", argv[i]);
1724 }
1725 F32 ll_x;
1726 if (sscanf(argv[i + 1], "%f", &ll_x) != 1) {
1727 laserror("'%s' needs 3 arguments: ll_x ll_y size, but '%s' is not a valid ll_x.", argv[i], argv[i + 1]);
1728 }
1729 F32 ll_y;
1730 if (sscanf(argv[i + 2], "%f", &ll_y) != 1) {
1731 laserror("'%s' needs 3 arguments: ll_x ll_y size, but '%s' is not a valid ll_y.", argv[i], argv[i + 2]);
1732 }
1733 F32 size;
1734 if (sscanf(argv[i + 3], "%f", &size) != 1) {
1735 laserror("'%s' needs 3 arguments: ll_x ll_y size, but '%s' is not a valid size.", argv[i], argv[i + 3]);
1736 }

Callers

nothing calls this directly

Calls 15

LASignoreClass · 0.85
laserrorFunction · 0.85
LASMessageFunction · 0.85
add_attributeFunction · 0.85
set_offsetFunction · 0.85
set_offset_adjustFunction · 0.85
stringFunction · 0.85
filteredMethod · 0.80
setFilterMethod · 0.80

Tested by

no test coverage detected