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