returns TRUE if 'val' is found in 'vec'
| 496 | |
| 497 | /// returns TRUE if 'val' is found in 'vec' |
| 498 | bool 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 |
| 508 | void bytes_to_readable(size_t bytes, double* value_out, const char** unit_out) { |
no test coverage detected