MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

Functions
StringUtil.hxx File Reference
`#include "Compiler.h"`
`#include <stddef.h>`
Include dependency graph for StringUtil.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions
gcc_nonnull_all char * | CopyString (char *dest, const char *src, size_t size)
| Copy a string. More...
gcc_pure const char * | StripLeft (const char *p)
| Returns a pointer to the first non-whitespace character in the string, or to the end of the string. More...
static gcc_pure char * | StripLeft (char *p)
gcc_pure const char * | StripLeft (const char *p, const char *end)
gcc_pure const char * | StripRight (const char *p, const char *end)
| Determine the string's end as if it was stripped on the right side. More...
static gcc_pure char * | StripRight (char *p, char *end)
| Determine the string's end as if it was stripped on the right side. More...
gcc_pure size_t | StripRight (const char *p, size_t length)
| Determine the string's length as if it was stripped on the right side. More...
void | StripRight (char *p)
| Strip trailing whitespace by null-terminating the string. More...
char * | Strip (char *p)
| Skip whitespace at the beginning and terminate the string after the last non-whitespace character. More...
gcc_pure bool | StringArrayContainsCase (const char *const *haystack, const char *needle)
| Checks whether a string array contains the specified string. More...
void | ToUpperASCII (char *dest, const char *src, size_t size)
| Convert the specified ASCII string (0x00..0x7f) to upper case. More...

## Function Documentation

gcc_nonnull_all char* CopyString | ( | char * | dest,
|  | const char * | src,
|  | size_t | size
| ) |  |

Copy a string.

If the buffer is too small, then the string is truncated. This is a safer version of strncpy().

Parameters

  size | the size of the destination buffer (including the null terminator)

Returns
  a pointer to the null terminator

gcc_pure bool StringArrayContainsCase | ( | const char *const * | haystack,
|  | const char * | needle
| ) |  |

Checks whether a string array contains the specified string.

Parameters

  haystack | a NULL terminated list of strings
  needle | the string to search for; the comparison is case-insensitive for ASCII characters

Returns
  true if found

char* Strip | ( | char * | p | ) |

Skip whitespace at the beginning and terminate the string after the last non-whitespace character.

gcc_pure const char* StripLeft | ( | const char * | p | ) |

Returns a pointer to the first non-whitespace character in the string, or to the end of the string.

static gcc_pure char* StripLeft | ( | char * | p | ) |
| inline static

Definition at line 49 of file StringUtil.hxx.

gcc_pure const char* StripLeft | ( | const char * | p,
|  | const char * | end
| ) |  |

gcc_pure const char* StripRight | ( | const char * | p,
|  | const char * | end
| ) |  |

Determine the string's end as if it was stripped on the right side.

static gcc_pure char* StripRight | ( | char * | p,
|  | char * | end
| ) |  |
| inline static

Determine the string's end as if it was stripped on the right side.

Definition at line 70 of file StringUtil.hxx.

gcc_pure size_t StripRight | ( | const char * | p,
|  | size_t | length
| ) |  |

Determine the string's length as if it was stripped on the right side.

void StripRight | ( | char * | p | ) |

Strip trailing whitespace by null-terminating the string.

void ToUpperASCII | ( | char * | dest,
|  | const char * | src,
|  | size_t | size
| ) |  |

Convert the specified ASCII string (0x00..0x7f) to upper case.

Parameters

  size | the destination buffer size