projects
/
libdcp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85207b5
)
Add ::puts().
author
Carl Hetherington
<cth@carlh.net>
Fri, 15 Apr 2022 20:40:52 +0000
(22:40 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 5 May 2022 19:46:30 +0000
(21:46 +0200)
src/file.cc
patch
|
blob
|
history
src/file.h
patch
|
blob
|
history
diff --git
a/src/file.cc
b/src/file.cc
index 8ab5029300df229f04a0b8b97f288c320be51d5e..bb276d48b619fdce98636fa1dccee0162e54358b 100644
(file)
--- a/
src/file.cc
+++ b/
src/file.cc
@@
-120,6
+120,14
@@
File::gets(char *s, int size)
}
+int
+File::puts(char const* s)
+{
+ DCP_ASSERT(_file);
+ return fputs(s, _file);
+}
+
+
File::operator bool() const
{
return _file != nullptr;
diff --git
a/src/file.h
b/src/file.h
index 037251c10ee76debfe30f8df649b3178e1a20cdd..edc431bdf3251da03282f9a6bfed331727455444 100644
(file)
--- a/
src/file.h
+++ b/
src/file.h
@@
-71,6
+71,8
@@
public:
int eof();
/** fgets() wrapper */
char *gets(char *s, int size);
+ /** fputs() wrapper */
+ int puts(char const *s);
/** fseek/fseeki64 wrapper */
int seek(int64_t offset, int whence);
/** ftell/ftelli64 wrapper */