util/StringUtil: use CamelCase

This commit is contained in:
Max Kellermann 2016-06-10 22:08:13 +02:00
parent 6b75be183d
commit e4c7e343c8
6 changed files with 13 additions and 13 deletions

View File

@ -56,7 +56,7 @@ archive_plugin_from_suffix(const char *suffix)
archive_plugins_for_each_enabled(plugin) archive_plugins_for_each_enabled(plugin)
if (plugin->suffixes != nullptr && if (plugin->suffixes != nullptr &&
string_array_contains(plugin->suffixes, suffix)) StringArrayContainsCase(plugin->suffixes, suffix))
return plugin; return plugin;
return nullptr; return nullptr;

View File

@ -26,12 +26,12 @@ get_bool(const char *value, bool *value_r)
static const char *const t[] = { "yes", "true", "1", nullptr }; static const char *const t[] = { "yes", "true", "1", nullptr };
static const char *const f[] = { "no", "false", "0", nullptr }; static const char *const f[] = { "no", "false", "0", nullptr };
if (string_array_contains(t, value)) { if (StringArrayContainsCase(t, value)) {
*value_r = true; *value_r = true;
return true; return true;
} }
if (string_array_contains(f, value)) { if (StringArrayContainsCase(f, value)) {
*value_r = false; *value_r = false;
return true; return true;
} }

View File

@ -31,8 +31,8 @@ DecoderPlugin::SupportsSuffix(const char *suffix) const
assert(suffix != nullptr); assert(suffix != nullptr);
#endif #endif
return suffixes != nullptr && string_array_contains(suffixes, suffix); return suffixes != nullptr &&
StringArrayContainsCase(suffixes, suffix);
} }
bool bool
@ -44,5 +44,5 @@ DecoderPlugin::SupportsMimeType(const char *mime_type) const
#endif #endif
return mime_types != nullptr && return mime_types != nullptr &&
string_array_contains(mime_types, mime_type); StringArrayContainsCase(mime_types, mime_type);
} }

View File

@ -120,7 +120,7 @@ playlist_list_open_uri_scheme(const char *uri, Mutex &mutex, Cond &cond,
if (playlist_plugins_enabled[i] && plugin->open_uri != nullptr && if (playlist_plugins_enabled[i] && plugin->open_uri != nullptr &&
plugin->schemes != nullptr && plugin->schemes != nullptr &&
string_array_contains(plugin->schemes, scheme.c_str())) { StringArrayContainsCase(plugin->schemes, scheme.c_str())) {
playlist = playlist_plugin_open_uri(plugin, uri, playlist = playlist_plugin_open_uri(plugin, uri,
mutex, cond); mutex, cond);
if (playlist != nullptr) if (playlist != nullptr)
@ -151,7 +151,7 @@ playlist_list_open_uri_suffix(const char *uri, Mutex &mutex, Cond &cond,
if (playlist_plugins_enabled[i] && !tried[i] && if (playlist_plugins_enabled[i] && !tried[i] &&
plugin->open_uri != nullptr && plugin->suffixes != nullptr && plugin->open_uri != nullptr && plugin->suffixes != nullptr &&
string_array_contains(plugin->suffixes, suffix)) { StringArrayContainsCase(plugin->suffixes, suffix)) {
playlist = playlist_plugin_open_uri(plugin, uri, playlist = playlist_plugin_open_uri(plugin, uri,
mutex, cond); mutex, cond);
if (playlist != nullptr) if (playlist != nullptr)
@ -189,7 +189,7 @@ playlist_list_open_stream_mime2(InputStreamPtr &&is, const char *mime)
playlist_plugins_for_each_enabled(plugin) { playlist_plugins_for_each_enabled(plugin) {
if (plugin->open_stream != nullptr && if (plugin->open_stream != nullptr &&
plugin->mime_types != nullptr && plugin->mime_types != nullptr &&
string_array_contains(plugin->mime_types, mime)) { StringArrayContainsCase(plugin->mime_types, mime)) {
/* rewind the stream, so each plugin gets a /* rewind the stream, so each plugin gets a
fresh start */ fresh start */
is->Rewind(IgnoreError()); is->Rewind(IgnoreError());
@ -230,7 +230,7 @@ playlist_list_open_stream_suffix(InputStreamPtr &&is, const char *suffix)
playlist_plugins_for_each_enabled(plugin) { playlist_plugins_for_each_enabled(plugin) {
if (plugin->open_stream != nullptr && if (plugin->open_stream != nullptr &&
plugin->suffixes != nullptr && plugin->suffixes != nullptr &&
string_array_contains(plugin->suffixes, suffix)) { StringArrayContainsCase(plugin->suffixes, suffix)) {
/* rewind the stream, so each plugin gets a /* rewind the stream, so each plugin gets a
fresh start */ fresh start */
is->Rewind(IgnoreError()); is->Rewind(IgnoreError());
@ -279,7 +279,7 @@ playlist_suffix_supported(const char *suffix)
playlist_plugins_for_each_enabled(plugin) { playlist_plugins_for_each_enabled(plugin) {
if (plugin->suffixes != nullptr && if (plugin->suffixes != nullptr &&
string_array_contains(plugin->suffixes, suffix)) StringArrayContainsCase(plugin->suffixes, suffix))
return true; return true;
} }

View File

@ -91,7 +91,7 @@ Strip(char *p)
} }
bool bool
string_array_contains(const char *const* haystack, const char *needle) StringArrayContainsCase(const char *const*haystack, const char *needle)
{ {
assert(haystack != nullptr); assert(haystack != nullptr);
assert(needle != nullptr); assert(needle != nullptr);

View File

@ -104,7 +104,7 @@ Strip(char *p);
*/ */
gcc_pure gcc_pure
bool bool
string_array_contains(const char *const* haystack, const char *needle); StringArrayContainsCase(const char *const*haystack, const char *needle);
/** /**
* Convert the specified ASCII string (0x00..0x7f) to upper case. * Convert the specified ASCII string (0x00..0x7f) to upper case.