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

Function StringInVector

LASzip/src/mydefs.cpp:498–505  ·  view source on GitHub ↗

returns TRUE if 'val' is found in 'vec'

Source from the content-addressed store, hash-verified

496
497/// returns TRUE if 'val' is found in 'vec'
498bool StringInVector(const std::string& val, const std::vector<std::string>& vec, bool casesense) {
499 if (casesense) {
500 return std::find(vec.begin(), vec.end(), val) != vec.end();
501 } else {
502 auto iterator = std::find_if(vec.begin(), vec.end(), [&](std::string s) { return (to_lower_copy(s).compare(to_lower_copy(val)) == 0); });
503 return iterator != vec.end();
504 }
505}
506
507/// Converts a byte count into a human-readable value and unit
508void bytes_to_readable(size_t bytes, double* value_out, const char** unit_out) {

Callers 1

SetWktMethod · 0.85

Calls 4

findFunction · 0.85
to_lower_copyFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected