X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fio%2Fbuffered.h;h=c05fc25eed5ad9454448d34f60a716ed091d56cb;hb=3ba20e3ddde250a78ab2410012551eb60304f766;hp=39c8159ff18c7fa091b8f91c4ab898d0bd36b880;hpb=122846f0881673770d88eff7d925ecf25c01b62e;p=libs%2Fcore.git diff --git a/source/io/buffered.h b/source/io/buffered.h index 39c8159..c05fc25 100644 --- a/source/io/buffered.h +++ b/source/io/buffered.h @@ -2,40 +2,41 @@ #define MSP_IO_BUFFERED_H_ #include +#include #include "base.h" namespace Msp { namespace IO { -class Buffered: public Base, public sigc::trackable +class MSPCORE_API Buffered: public Base, public sigc::trackable { private: Base &below; std::size_t buf_size = 0; - char *buf = 0; - char *begin = 0; - char *end = 0; + char *buf = nullptr; + char *begin = nullptr; + char *end = nullptr; Mode cur_op = M_NONE; public: Buffered(Base &, unsigned = 8192); ~Buffered(); - virtual void set_block(bool); - virtual void set_inherit(bool); + void set_block(bool) override; + void set_inherit(bool) override; void flush(); protected: - virtual std::size_t do_write(const char *, std::size_t); - virtual std::size_t do_read(char *, std::size_t); + std::size_t do_write(const char *, std::size_t) override; + std::size_t do_read(char *, std::size_t) override; public: - virtual std::size_t put(char); + std::size_t put(char) override; - bool getline(std::string &); - int get(); + bool getline(std::string &) override; + int get() override; - virtual const Handle &get_handle(Mode); + const Handle &get_handle(Mode) override; private: void set_op(Mode);