X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fio%2Ffile.h;h=d59cd577fc0f33e1acbcbb62bcaa9fa0bb31c141;hb=e46de55d3c8f65d3b0eeaee76247476695e9eb7c;hp=05aaf9565a08653f278773e010fee4acb6361779;hpb=6e0fd758970bcb5bad5e3f2454b694cc4d7b4b66;p=libs%2Fcore.git diff --git a/source/io/file.h b/source/io/file.h index 05aaf95..d59cd57 100644 --- a/source/io/file.h +++ b/source/io/file.h @@ -1,21 +1,28 @@ #ifndef MSP_IO_FILE_H_ #define MSP_IO_FILE_H_ +#include #include -#include "base.h" #include "buffered.h" #include "filtered.h" -#include "seek.h" +#include "seekable.h" namespace Msp { namespace IO { +class file_not_found: public std::runtime_error +{ +public: + file_not_found(const std::string &fn): std::runtime_error(fn) { } +}; + + /** A class for reading and writing files. Non-blocking mode is not supported on Win32. */ -class File: public Base +class File: public Seekable { public: enum CreateMode @@ -48,11 +55,8 @@ protected: public: virtual void sync(); - /** Changes the read/write offset of the file. Returns the new offset. */ - virtual int seek(int, SeekType); - - /** Returns the current read/write offset of the file. */ - virtual int tell() const; + virtual unsigned seek(int, SeekType); + virtual unsigned tell() const; virtual Handle get_event_handle() { return handle; }