]> git.tdb.fi Git - libs/core.git/blob - source/io/seekable.cpp
101676e0ef304a5d56efada803808d3e990b5065
[libs/core.git] / source / io / seekable.cpp
1 #ifdef WIN32
2 #include <windows.h>
3 #endif
4 #include <stdexcept>
5 #include "seekable.h"
6
7 using namespace std;
8
9 namespace Msp {
10 namespace IO {
11
12 int sys_seek_type(SeekType st)
13 {
14 #ifdef WIN32
15         if(st==S_BEG)
16                 return FILE_BEGIN;
17         else if(st==S_CUR)
18                 return FILE_CURRENT;
19         else if(st==S_END)
20                 return FILE_END;
21 #else
22         if(st==S_BEG)
23                 return SEEK_SET;
24         else if(st==S_CUR)
25                 return SEEK_CUR;
26         else if(st==S_END)
27                 return SEEK_END;
28 #endif
29
30         throw invalid_argument("sys_seek_type");
31 }
32
33 } // namespace IO
34 } // namespace Msp