X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fbase%2Frawfile.cpp;h=1552203ae358952b9b324eb280b5440f5bcae4e3;hp=d7f2a6551f28289db48e16f646031bc2ed1b41a8;hb=593d7ac3a2a3c916eda486352bbcc25c4aede678;hpb=6f3208500f3b07aaa3733b0b47f2e7a00426ed3e diff --git a/lib/base/rawfile.cpp b/lib/base/rawfile.cpp index d7f2a65..1552203 100644 --- a/lib/base/rawfile.cpp +++ b/lib/base/rawfile.cpp @@ -4,7 +4,10 @@ #include #include +DEFINE_REF(eRawFile); + eRawFile::eRawFile() + :m_lock(true) { m_fd = -1; m_file = 0; @@ -227,3 +230,25 @@ int eRawFile::openFileUncached(int nr) } return ::open(filename.c_str(), O_RDONLY | O_LARGEFILE); } + +off_t eRawFile::length() +{ + return m_totallength; +} + +off_t eRawFile::position() +{ + if (m_nrfiles < 2) + { + if (!m_cached) + return ::lseek(m_fd, 0, SEEK_CUR); + else + return ::fseeko(m_file, 0, SEEK_CUR); + } + return m_current_offset; +} + +eSingleLock &eRawFile::getLock() +{ + return m_lock; +}