PlaylistFile: move memchr() call to class Path

This commit is contained in:
Max Kellermann
2015-03-02 21:48:37 +01:00
parent e9125ef8e4
commit 87a8a3e22f
2 changed files with 14 additions and 2 deletions

View File

@@ -122,6 +122,16 @@ public:
return value;
}
/**
* Does the path contain a newline character? (Which is
* usually rejected by MPD because its protocol cannot
* transfer newline characters).
*/
gcc_pure
bool HasNewline() const {
return strchr(value, '\n') != nullptr;
}
/**
* Convert the path to UTF-8.
* Returns empty string on error or if this instance is "nulled"