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

Method add_file_name_single

LASlib/src/lasreader.cpp:2708–2733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2706#endif
2707
2708BOOL LASreadOpener::add_file_name_single(const CHAR* file_name, BOOL unique)
2709{
2710 if (unique) {
2711 U32 i;
2712 for (i = 0; i < file_name_number; i++) {
2713 if (strcmp(file_names[i], file_name) == 0) {
2714 return FALSE;
2715 }
2716 }
2717 }
2718 if (file_name_number == file_name_allocated) {
2719 if (file_names) {
2720 file_name_allocated *= 2;
2721 file_names = (CHAR**)realloc_las(file_names, sizeof(CHAR*) * file_name_allocated);
2722 } else {
2723 file_name_allocated = 16;
2724 file_names = (CHAR**)malloc_las(sizeof(CHAR*) * file_name_allocated);
2725 }
2726 if (file_names == 0) {
2727 laserror("alloc for file_names pointer array failed at %d", file_name_allocated);
2728 }
2729 }
2730 if (file_names != nullptr) file_names[file_name_number] = LASCopyString(file_name);
2731 file_name_number++;
2732 return TRUE;
2733}
2734
2735BOOL LASreadOpener::add_file_name(const CHAR* file_name, U32 ID, BOOL unique) {
2736 if (unique) {

Callers

nothing calls this directly

Calls 3

realloc_lasFunction · 0.85
malloc_lasFunction · 0.85
laserrorFunction · 0.85

Tested by

no test coverage detected