X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fseekable.cpp;fp=source%2Fio%2Fseekable.cpp;h=101676e0ef304a5d56efada803808d3e990b5065;hp=0000000000000000000000000000000000000000;hb=86e0004bd195bc7f7478cf736871339bddf38127;hpb=8f2711fba7a2817840038630d9cf9a2060ecbe8e diff --git a/source/io/seekable.cpp b/source/io/seekable.cpp new file mode 100644 index 0000000..101676e --- /dev/null +++ b/source/io/seekable.cpp @@ -0,0 +1,34 @@ +#ifdef WIN32 +#include +#endif +#include +#include "seekable.h" + +using namespace std; + +namespace Msp { +namespace IO { + +int sys_seek_type(SeekType st) +{ +#ifdef WIN32 + if(st==S_BEG) + return FILE_BEGIN; + else if(st==S_CUR) + return FILE_CURRENT; + else if(st==S_END) + return FILE_END; +#else + if(st==S_BEG) + return SEEK_SET; + else if(st==S_CUR) + return SEEK_CUR; + else if(st==S_END) + return SEEK_END; +#endif + + throw invalid_argument("sys_seek_type"); +} + +} // namespace IO +} // namespace Msp