Add ::puts().
authorCarl Hetherington <cth@carlh.net>
Fri, 15 Apr 2022 20:40:52 +0000 (22:40 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 5 May 2022 19:46:30 +0000 (21:46 +0200)
src/file.cc
src/file.h

index 8ab5029300df229f04a0b8b97f288c320be51d5e..bb276d48b619fdce98636fa1dccee0162e54358b 100644 (file)
@@ -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;
index 037251c10ee76debfe30f8df649b3178e1a20cdd..edc431bdf3251da03282f9a6bfed331727455444 100644 (file)
@@ -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 */