add addFactoryExtension/removeFactoryExtension to eServiceCenter
authorghost <andreas.monzner@multimedia-labs.de>
Tue, 9 Nov 2010 22:31:47 +0000 (23:31 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Tue, 9 Nov 2010 22:31:47 +0000 (23:31 +0100)
lib/service/service.cpp
lib/service/service.h

index eb2757a..8c674c5 100644 (file)
@@ -201,6 +201,25 @@ RESULT eServiceCenter::removeServiceFactory(int id)
        return 0;
 }
 
+RESULT eServiceCenter::addFactoryExtension(int id, const char *extension)
+{
+       std::map<int, std::list<std::string> >::iterator it = extensions.find(id);
+       if (it == extensions.end())
+               return -1;
+       it->second.push_back(extension);
+       return 0;
+}
+
+RESULT eServiceCenter::removeFactoryExtension(int id, const char *extension)
+{
+       std::map<int, std::list<std::string> >::iterator it = extensions.find(id);
+       if (it == extensions.end())
+               return -1;
+       it->second.remove(extension);
+       return 0;
+}
+
+
 int eServiceCenter::getServiceTypeForExtension(const char *str)
 {
        for (std::map<int, std::list<std::string> >::iterator sit(extensions.begin()); sit != extensions.end(); ++sit)
index 6f6ab98..ffc7d27 100644 (file)
@@ -40,6 +40,8 @@ public:
        static RESULT getPrivInstance(ePtr<eServiceCenter> &ptr) { ptr = instance; return 0; }
        RESULT addServiceFactory(int id, iServiceHandler *hnd, std::list<std::string> &extensions);
        RESULT removeServiceFactory(int id);
+       RESULT addFactoryExtension(int id, const char *extension);
+       RESULT removeFactoryExtension(int id, const char *extension);
 #endif
        static SWIG_VOID(RESULT) getInstance(ePtr<iServiceHandler> &SWIG_NAMED_OUTPUT(ptr)) { ptr = instance; return 0; }
 };