translate text attribute for skin objects
[enigma2.git] / lib / service / event.cpp
index 07c92c52ffd7b25f3af11cb31081b1a7268b8d5b..4dda57796609ab09667ddbf57701ffdd2072f2e5 100644 (file)
@@ -10,6 +10,9 @@
 #include <dvbsi++/component_descriptor.h>
 #include <dvbsi++/descriptor_tag.h>
 
 #include <dvbsi++/component_descriptor.h>
 #include <dvbsi++/descriptor_tag.h>
 
+#include <sys/types.h>
+#include <fcntl.h>
+
 // static members / methods
 std::string eServiceEvent::m_language = "de_DE";
 
 // static members / methods
 std::string eServiceEvent::m_language = "de_DE";
 
@@ -185,6 +188,27 @@ RESULT eServiceEvent::parseFrom(Event *evt, int tsidonid)
        return 0;
 }
 
        return 0;
 }
 
+RESULT eServiceEvent::parseFrom(const std::string filename, int tsidonid)
+{
+       if (!filename.empty())
+       {
+               int fd = ::open( filename.c_str(), O_RDONLY );
+               if ( fd > -1 )
+               {
+                       __u8 buf[4096];
+                       int rd = ::read(fd, buf, 4096);
+                       ::close(fd);
+                       if ( rd > 12 /*EIT_LOOP_SIZE*/ )
+                       {
+                               Event ev(buf);
+                               parseFrom(&ev, tsidonid);
+                               return 0;
+                       }
+               }
+       }
+       return -1;
+}
+
 std::string eServiceEvent::getBeginTimeString() const
 {
        tm t;
 std::string eServiceEvent::getBeginTimeString() const
 {
        tm t;