diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-01-11 12:50:19 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-01-11 12:50:19 +0000 |
| commit | b14f1520fe0dabd185ab3555c9d2dd8ab5276dd0 (patch) | |
| tree | 709e35aec7d42c672d8aa953b52d0d7c494dd3d8 /lib/base | |
| parent | 26ff43bdf1eb6fe4da12db2c61a63c0dcd9612c8 (diff) | |
| download | enigma2-b14f1520fe0dabd185ab3555c9d2dd8ab5276dd0.tar.gz enigma2-b14f1520fe0dabd185ab3555c9d2dd8ab5276dd0.zip | |
filter short name brakets in getContent ('N')
add possibility to get short names with getContent ('n')
the same for epg.search...
filter short name brakets in Converter/ServiceName
Diffstat (limited to 'lib/base')
| -rw-r--r-- | lib/base/estring.cpp | 18 | ||||
| -rw-r--r-- | lib/base/estring.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/base/estring.cpp b/lib/base/estring.cpp index 77746299..487dceec 100644 --- a/lib/base/estring.cpp +++ b/lib/base/estring.cpp @@ -5,6 +5,24 @@ #include <lib/base/encoding.h> #include <lib/base/estring.h> +std::string buildShortName( const std::string &str ) +{ + std::string tmp; + static char stropen[3] = { 0xc2, 0x86, 0x00 }; + static char strclose[3] = { 0xc2, 0x87, 0x00 }; + unsigned int open=std::string::npos-1; + while ( (open = str.find(stropen, open+2)) != std::string::npos ) + { + unsigned int close = str.find(strclose, open); + if ( close != std::string::npos ) + { + tmp+=str.substr( open+2, close-(open+2) ); + eDebug("now %s", tmp.c_str()); + } + } + return tmp.length() ? tmp : str; +} + std::string getNum(int val, int sys) { // Returns a string that contain the value val as string diff --git a/lib/base/estring.h b/lib/base/estring.h index 34022280..68e0970f 100644 --- a/lib/base/estring.h +++ b/lib/base/estring.h @@ -6,6 +6,8 @@ #include <stdio.h> #include "eerror.h" +std::string buildShortName( const std::string &str ); + int strnicmp(const char*, const char*, int); std::string getNum(int num, int base=10); |
