X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/d63d2c3c6cbbd574dda4f8b00ebe6c661735edd5..4bc08995411e21f3564f09e136809be68ddf96a8:/lib/service/servicefs.cpp diff --git a/lib/service/servicefs.cpp b/lib/service/servicefs.cpp index ad40f0af..de75cc67 100644 --- a/lib/service/servicefs.cpp +++ b/lib/service/servicefs.cpp @@ -11,15 +11,32 @@ #include #include + +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 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 &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 &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 &list) return 0; } -eAutoInitP0 init_eServiceFactoryFS(eAutoInitNumbers::service+1, "eServiceFactoryFS"); +eAutoInitPtr init_eServiceFactoryFS(eAutoInitNumbers::service+1, "eServiceFactoryFS");