aboutsummaryrefslogtreecommitdiff
path: root/lib/base/rawfile.cpp
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2010-11-09 23:21:28 +0100
committerghost <andreas.monzner@multimedia-labs.de>2010-11-09 23:21:28 +0100
commit81b7cc6b1815ec6f0f0c42d6a826d56c8b35033b (patch)
tree0803e6c521cac23828da7650bb4ef56bc6cc0fe9 /lib/base/rawfile.cpp
parent57f0f06b1e3235dfb6739a43bb95ab92c02f9574 (diff)
downloadenigma2-81b7cc6b1815ec6f0f0c42d6a826d56c8b35033b.tar.gz
enigma2-81b7cc6b1815ec6f0f0c42d6a826d56c8b35033b.zip
add virtual baseclass for data sources (iDataSource)
let eRawFile inherit from iDataSource
Diffstat (limited to 'lib/base/rawfile.cpp')
-rw-r--r--lib/base/rawfile.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/base/rawfile.cpp b/lib/base/rawfile.cpp
index c7e11feb..1552203a 100644
--- a/lib/base/rawfile.cpp
+++ b/lib/base/rawfile.cpp
@@ -4,7 +4,10 @@
#include <lib/base/rawfile.h>
#include <lib/base/eerror.h>
+DEFINE_REF(eRawFile);
+
eRawFile::eRawFile()
+ :m_lock(true)
{
m_fd = -1;
m_file = 0;
@@ -232,3 +235,20 @@ 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;
+}