diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-11-16 10:22:37 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-11-16 10:22:37 +0000 |
| commit | 68b90d5fc4598225d38579634686a3a16083fa69 (patch) | |
| tree | 39f39d121d1e8103b0d7837022861ab0a70dac1d /lib | |
| parent | 8dfcf7d1701e9f178ec6d8d756a8bd779854a3d9 (diff) | |
| download | enigma2-68b90d5fc4598225d38579634686a3a16083fa69.tar.gz enigma2-68b90d5fc4598225d38579634686a3a16083fa69.zip | |
factor out genSortName, cleanup comment
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dvb/db.cpp | 23 | ||||
| -rw-r--r-- | lib/dvb/idvb.h | 13 |
2 files changed, 26 insertions, 10 deletions
diff --git a/lib/dvb/db.cpp b/lib/dvb/db.cpp index e7617fd3..3f42da96 100644 --- a/lib/dvb/db.cpp +++ b/lib/dvb/db.cpp @@ -113,6 +113,18 @@ eDVBService &eDVBService::operator=(const eDVBService &s) return *this; } +void eDVBService::genSortName() +{ + m_service_name_sort = removeDVBChars(m_service_name); + makeUpper(m_service_name_sort); + while ((!m_service_name_sort.empty()) && m_service_name_sort[0] == ' ') + m_service_name_sort.erase(0, 1); + + /* put unnamed services at the end, not at the beginning. */ + if (m_service_name_sort.empty()) + m_service_name_sort = "\xFF"; +} + RESULT eDVBService::getName(const eServiceReference &ref, std::string &name) { if (!ref.name.empty()) @@ -303,15 +315,8 @@ void eDVBDB::load() line[strlen(line)-1]=0; s->m_service_name = line; - s->m_service_name_sort = removeDVBChars(line); - makeUpper(s->m_service_name_sort); - while ((!s->m_service_name_sort.empty()) && s->m_service_name_sort[0] == ' ') - s->m_service_name_sort.erase(0, 1); - - /* put unnamed services at the end, not at the beginning. */ - if (s->m_service_name_sort.empty()) - s->m_service_name_sort = "\xFF"; - + s->genSortName(); + fgets(line, 256, f); if (strlen(line)) line[strlen(line)-1]=0; diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index c6cf20eb..ad5da21e 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -29,7 +29,16 @@ struct eBouquet RESULT moveService(const eServiceReference &, unsigned int); }; - // bitte KEINE operator int() definieren, sonst bringt das ganze nix! + /* these structures have by intention no operator int() defined. + the reason of these structures is to avoid mixing for example + a onid and a tsid (as there's no general order for them). + + defining an operator int() would implicitely convert values + between them over the constructor with the int argument. + + 'explicit' doesn't here - eTransportStreamID(eOriginalNetworkID(n)) + would still work. */ + struct eTransportStreamID { private: @@ -198,6 +207,8 @@ public: std::string m_service_name, m_service_name_sort; std::string m_provider_name; + void genSortName(); + int m_flags; std::set<int> m_ca; std::map<int,int> m_cache; |
