Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8283f236
Commit
8283f236
authored
Aug 11, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/io/TextFile: add method Check()
parent
7cc25f91
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
TextFile.cxx
src/fs/io/TextFile.cxx
+8
-0
TextFile.hxx
src/fs/io/TextFile.hxx
+8
-0
No files found.
src/fs/io/TextFile.cxx
View file @
8283f236
...
...
@@ -61,3 +61,11 @@ TextFile::ReadLine()
return
buffered_reader
->
ReadLine
();
}
bool
TextFile
::
Check
(
Error
&
error
)
const
{
assert
(
buffered_reader
!=
nullptr
);
return
buffered_reader
->
Check
(
error
);
}
src/fs/io/TextFile.hxx
View file @
8283f236
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment