mpd/src/util/StringUtil.hxx

32 lines
746 B
C++
Raw Normal View History

// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
2017-09-13 10:35:11 +02:00
#ifndef STRING_UTIL_HXX
#define STRING_UTIL_HXX
#include <cstddef>
#include <string_view>
/**
* 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]]
bool
StringArrayContainsCase(const char *const*haystack,
std::string_view needle) noexcept;
/**
* Convert the specified ASCII string (0x00..0x7f) to upper case.
*
* @param size the destination buffer size
*/
void
ToUpperASCII(char *dest, const char *src, size_t size) noexcept;
#endif