aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/io/TextFile.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-11 22:53:48 +0200
committerMax Kellermann <max@duempel.org>2014-08-11 22:53:48 +0200
commit8283f23651580c57e199f7547f2c0a0512e868be (patch)
treeaad15e492e743d6261f302b73271413b9fc7784d /src/fs/io/TextFile.hxx
parent7cc25f91ffe240720c0692b7c75b9f566882dff0 (diff)
downloadmpd-8283f23651580c57e199f7547f2c0a0512e868be.tar.gz
mpd-8283f23651580c57e199f7547f2c0a0512e868be.tar.xz
mpd-8283f23651580c57e199f7547f2c0a0512e868be.zip
fs/io/TextFile: add method Check()
Diffstat (limited to 'src/fs/io/TextFile.hxx')
-rw-r--r--src/fs/io/TextFile.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fs/io/TextFile.hxx b/src/fs/io/TextFile.hxx
index 8bab808c7..5577363e7 100644
--- a/src/fs/io/TextFile.hxx
+++ b/src/fs/io/TextFile.hxx
@@ -56,10 +56,18 @@ public:
* space. There is a reasonable maximum line length, only to
* prevent denial of service.
*
+ * Use Check() after nullptr has been returned to check
+ * whether an error occurred or end-of-file has been reached.
+ *
* @param file the source file, opened in text mode
* @return a pointer to the line, or nullptr on end-of-file or error
*/
char *ReadLine();
+
+ /**
+ * Check whether a ReadLine() call has thrown an error.
+ */
+ bool Check(Error &error) const;
};
#endif