MPD: util/StringCompare.hxx File Reference

MPD 0.20.15

Functions
StringCompare.hxx File Reference
`#include "StringView.hxx"`
`#include "Compiler.h"`
Include dependency graph for StringCompare.hxx:

Go to the source code of this file.

## Functions
static bool | StringIsEmpty (const char *string)
gcc_pure static gcc_nonnull_all bool | StringStartsWith (const char *haystack, StringView needle) noexcept
gcc_pure bool | StringEndsWith (const char *haystack, const char *needle) noexcept
gcc_pure static gcc_nonnull_all const char * | StringAfterPrefix (const char *haystack, StringView needle) noexcept
| Returns the portion of the string after a prefix. More...
gcc_pure const char * | FindStringSuffix (const char *p, const char *suffix) noexcept
| Check if the given string ends with the specified suffix. More...

## Function Documentation

## ◆ FindStringSuffix()

gcc_pure const char* FindStringSuffix | ( | const char * | p,
|  | const char * | suffix
| ) |  |
| noexcept

Check if the given string ends with the specified suffix.

If yes, returns the position of the suffix, and nullptr otherwise.

## ◆ StringAfterPrefix()

gcc_pure static gcc_nonnull_all const char* StringAfterPrefix | ( | const char * | haystack,
|  | StringView | needle
| ) |  |
| inlinestaticnoexcept

Returns the portion of the string after a prefix.

If the string does not begin with the specified prefix, this function returns nullptr.

Definition at line 64 of file StringCompare.hxx.

## ◆ StringEndsWith()

gcc_pure bool StringEndsWith | ( | const char * | haystack,
|  | const char * | needle
| ) |  |
| noexcept

## ◆ StringIsEmpty()

static bool StringIsEmpty | ( | const char * | string | ) |
| inlinestatic

Definition at line 41 of file StringCompare.hxx.

## ◆ StringStartsWith()

gcc_pure static gcc_nonnull_all bool StringStartsWith | ( | const char * | haystack,
|  | StringView | needle
| ) |  |
| inlinestaticnoexcept

Definition at line 48 of file StringCompare.hxx.