X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fseek.cpp;fp=source%2Fio%2Fseek.cpp;h=b10c5a0c27aa966add8703e739da11d0819efff2;hp=0000000000000000000000000000000000000000;hb=6e0fd758970bcb5bad5e3f2454b694cc4d7b4b66;hpb=b97d4e9f86e90254ab9edef7ee62a910f6333c78 diff --git a/source/io/seek.cpp b/source/io/seek.cpp new file mode 100644 index 0000000..b10c5a0 --- /dev/null +++ b/source/io/seek.cpp @@ -0,0 +1,32 @@ +#ifdef WIN32 +#include +#endif +#include "except.h" +#include "seek.h" + +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 InvalidParameterValue("Invalid seek type"); +} + +} // namespace IO +} // namespace Msp