add infrastructure for record service events (not finished yet)
[enigma2.git] / lib / service / servicefs.cpp
index 8e5b729bafe2a36eabc8a0c0cc87080d2b2d2cfe..16948854484240a9af262edec8cad69c3e65315d 100644 (file)
@@ -96,6 +96,11 @@ eServiceFS::~eServiceFS()
 {
 }
 
+int lower(char c)
+{
+       return std::tolower(static_cast<unsigned char>(c));
+}
+
 RESULT eServiceFS::getContent(std::list<eServiceReference> &list, bool sorted)
 {
        DIR *d=opendir(path.c_str());
@@ -131,6 +136,7 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list, bool sorted)
                {
                        size_t e = filename.rfind('.');
                        std::string extension = (e != std::string::npos) ? filename.substr(e) : "";
+                       std::transform(extension.begin(), extension.end(), extension.begin(), lower);
                        int type = -1;
                        
                        if (extension == ".ts")
@@ -171,6 +177,7 @@ RESULT eServiceFS::getContent(std::list<eServiceReference> &list, bool sorted)
 //   useable format options are
 //   R = Service Reference (as swig object .. this is very slow)
 //   S = Service Reference (as python string object .. same as ref.toString())
+//   C = Service Reference (as python string object .. same as ref.toCompareString())
 //   N = Service Name (as python string object)
 //   when exactly one return value per service is selected in the format string,
 //   then each value is directly a list entry
@@ -210,6 +217,9 @@ PyObject *eServiceFS::getContent(const char* format, bool sorted)
                                case 'R':  // service reference (swig)object
                                        tmp = New_eServiceReference(ref);
                                        break;
+                               case 'C':  // service reference compare string
+                                       tmp = PyString_FromString(ref.toCompareString().c_str());
+                                       break;
                                case 'S':  // service reference string
                                        tmp = PyString_FromString(ref.toString().c_str());
                                        break;