X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fslice.h;h=2965f9899a8252c8415b5c776e31dee8b6c490fd;hp=8ca4327415ff29f16d19decee872a7f0234185d9;hb=HEAD;hpb=c8bf2d6c15893ccc9dbc4e04611b7229029f4808 diff --git a/source/io/slice.h b/source/io/slice.h index 8ca4327..272fa2c 100644 --- a/source/io/slice.h +++ b/source/io/slice.h @@ -1,6 +1,7 @@ #ifndef MSP_IO_SLICE_H_ #define MSP_IO_SLICE_H_ +#include #include "seekable.h" namespace Msp { @@ -16,37 +17,37 @@ its range. If the offset of the underlying object is changed, the Slice will restore it before the next access. This enables multiple Slices to be created on top of the same object. */ -class Slice: public Seekable, public sigc::trackable +class MSPCORE_API Slice: public Seekable, public sigc::trackable { private: Seekable &below; - SeekOffset start_offset; - SeekOffset length; - SeekOffset position; - bool sync_position; + SeekOffset start_offset = 0; + SeekOffset length = 0; + SeekOffset position = 0; + bool sync_position = true; public: Slice(Seekable &, SeekOffset, SeekOffset); - virtual void set_block(bool); - virtual void set_inherit(bool); + void set_block(bool) override; + void set_inherit(bool) override; private: void flush(); unsigned prepare_op(unsigned, Mode); 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); - virtual int get(); + std::size_t put(char) override; + int get() override; - virtual const Handle &get_handle(Mode); + const Handle &get_handle(Mode) override; - virtual SeekOffset seek(SeekOffset, SeekType); - virtual SeekOffset tell() const { return position; } + SeekOffset seek(SeekOffset, SeekType) override; + SeekOffset tell() const override { return position; } }; } // namespace IO