- fixed dvb scan
[enigma2.git] / lib / service / servicefs.cpp
index ad40f0af9ff9020e59668a0e0863ebb7a5576a48..de75cc672fe6b35053a151995b3c1a76bbe1c035 100644 (file)
 #include <sys/stat.h>
 #include <unistd.h>
 
+
+class eServiceFSInformation: public iServiceInformation
+{
+       DECLARE_REF;
+public:
+       RESULT getName(const eServiceReference &ref, std::string &name);
+};
+
+DEFINE_REF(eServiceFSInformation);
+
+RESULT eServiceFSInformation::getName(const eServiceReference &ref, std::string &name)
+{
+       name = ref.path;
+}
+
 // eServiceFactoryFS
 
-eServiceFactoryFS::eServiceFactoryFS(): ref(0)
+eServiceFactoryFS::eServiceFactoryFS()
 {
        ePtr<eServiceCenter> sc;
        
        eServiceCenter::getInstance(sc);
        if (sc)
                sc->addServiceFactory(eServiceFactoryFS::id, this);
+       
+       m_service_information = new eServiceFSInformation();
 }
 
 eServiceFactoryFS::~eServiceFactoryFS()
@@ -52,11 +69,17 @@ RESULT eServiceFactoryFS::list(const eServiceReference &ref, ePtr<iListableServi
        return 0;
 }
 
+RESULT eServiceFactoryFS::info(const eServiceReference &ref, ePtr<iServiceInformation> &ptr)
+{
+       ptr = m_service_information;
+       return 0;
+}
+
 // eServiceFS
 
 DEFINE_REF(eServiceFS);
 
-eServiceFS::eServiceFS(const char *path): ref(0), path(path)
+eServiceFS::eServiceFS(const char *path): path(path)
 {
 }
 
@@ -74,7 +97,7 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list)
                if (!(strcmp(e->d_name, ".") && strcmp(e->d_name, "..")))
                        continue;
                
-               eString filename;
+               std::string filename;
                
                filename = path;
                filename += e->d_name;
@@ -109,4 +132,4 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list)
        return 0;
 }
 
-eAutoInitP0<eServiceFactoryFS> init_eServiceFactoryFS(eAutoInitNumbers::service+1, "eServiceFactoryFS");
+eAutoInitPtr<eServiceFactoryFS> init_eServiceFactoryFS(eAutoInitNumbers::service+1, "eServiceFactoryFS");