Add iostream to CTL

This commit is contained in:
Justine Tunney 2024-06-29 15:45:09 -07:00
parent 617ddfee93
commit 98e684622b
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
20 changed files with 1531 additions and 7 deletions

53
ctl/ostream.h Normal file
View file

@ -0,0 +1,53 @@
// -*-mode:c++;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8-*-
// vi: set et ft=cpp ts=4 sts=4 sw=4 fenc=utf-8 :vi
#ifndef CTL_OSTREAM_H_
#define CTL_OSTREAM_H_
#include "ios.h"
namespace ctl {
struct string_view;
class ostream : public ios
{
public:
ostream() = delete;
explicit ostream(FILE*);
virtual ~ostream();
ostream& operator<<(const char*);
ostream& operator<<(char);
ostream& operator<<(int);
ostream& operator<<(long);
ostream& operator<<(double);
ostream& operator<<(const string_view&);
ostream& operator<<(bool);
ostream& operator<<(ostream& (*)(ostream&));
ostream& put(char);
ostream& write(const char*, streamsize);
ostream& flush();
ostream(ostream&&) noexcept;
ostream& operator=(ostream&&) noexcept;
private:
ostream(const ostream&) = delete;
ostream& operator=(const ostream&) = delete;
};
extern ostream cout;
extern ostream cerr;
ostream&
endl(ostream&);
ostream&
ends(ostream&);
ostream&
flush(ostream&);
} // namespace ctl
#endif // CTL_OSTREAM_H_