aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/Path.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-03-02 21:48:37 +0100
committerMax Kellermann <max@duempel.org>2015-03-02 21:48:37 +0100
commit87a8a3e22f7d25c88c344cd195bde58d237716a0 (patch)
tree1541669084b0586e2cfb1e82143fecba803b8a06 /src/fs/Path.hxx
parente9125ef8e4fc42ba123aa71b5aed6f7e8d05f103 (diff)
downloadmpd-87a8a3e22f7d25c88c344cd195bde58d237716a0.tar.gz
mpd-87a8a3e22f7d25c88c344cd195bde58d237716a0.tar.xz
mpd-87a8a3e22f7d25c88c344cd195bde58d237716a0.zip
PlaylistFile: move memchr() call to class Path
Diffstat (limited to '')
-rw-r--r--src/fs/Path.hxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx
index 8126a668a..962518896 100644
--- a/src/fs/Path.hxx
+++ b/src/fs/Path.hxx
@@ -123,6 +123,16 @@ public:
}
/**
+ * 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"
* (#IsNull returns true).