2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Copyright The Music Player Daemon Project
|
2010-12-23 16:13:11 +01:00
|
|
|
|
2017-09-13 10:35:11 +02:00
|
|
|
#ifndef STRING_UTIL_HXX
|
|
|
|
#define STRING_UTIL_HXX
|
2010-12-23 16:13:11 +01:00
|
|
|
|
2020-03-13 00:46:28 +01:00
|
|
|
#include <cstddef>
|
2020-03-13 20:38:40 +01:00
|
|
|
#include <string_view>
|
2019-06-11 19:29:40 +02:00
|
|
|
|
2010-12-23 16:13:11 +01:00
|
|
|
/**
|
|
|
|
* Checks whether a string array contains the specified string.
|
|
|
|
*
|
|
|
|
* @param haystack a NULL terminated list of strings
|
|
|
|
* @param needle the string to search for; the comparison is
|
|
|
|
* case-insensitive for ASCII characters
|
|
|
|
* @return true if found
|
|
|
|
*/
|
2023-03-06 15:57:36 +01:00
|
|
|
[[gnu::pure]]
|
2010-12-23 16:13:11 +01:00
|
|
|
bool
|
2017-05-08 14:44:49 +02:00
|
|
|
StringArrayContainsCase(const char *const*haystack,
|
2020-03-13 20:38:40 +01:00
|
|
|
std::string_view needle) noexcept;
|
2019-06-11 19:29:40 +02:00
|
|
|
|
2014-12-04 17:43:01 +01:00
|
|
|
/**
|
|
|
|
* Convert the specified ASCII string (0x00..0x7f) to upper case.
|
|
|
|
*
|
|
|
|
* @param size the destination buffer size
|
|
|
|
*/
|
|
|
|
void
|
2017-05-08 14:44:49 +02:00
|
|
|
ToUpperASCII(char *dest, const char *src, size_t size) noexcept;
|
2014-12-04 17:43:01 +01:00
|
|
|
|
2010-12-23 16:13:11 +01:00
|
|
|
#endif
|