mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
CMTDInfo: Add function findMTDNumberFromName()
This commit is contained in:
@@ -636,6 +636,15 @@ int CMTDInfo::findMTDNumber(const std::string & filename)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CMTDInfo::findMTDNumberFromName(const char* name)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < getMTDCount(); i++) {
|
||||||
|
if ((std::string)name == getMTDName(i))
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
std::string CMTDInfo::getMTDName(const std::string & filename)
|
std::string CMTDInfo::getMTDName(const std::string & filename)
|
||||||
{
|
{
|
||||||
return getMTDName( findMTDNumber(filename) );
|
return getMTDName( findMTDNumber(filename) );
|
||||||
|
@@ -131,6 +131,7 @@ class CMTDInfo
|
|||||||
int getMTDEraseSize( const std::string & filename );
|
int getMTDEraseSize( const std::string & filename );
|
||||||
|
|
||||||
int findMTDNumber(const std::string & filename);
|
int findMTDNumber(const std::string & filename);
|
||||||
|
int findMTDNumberFromName(const char* name);
|
||||||
std::string findMTDsystem();
|
std::string findMTDsystem();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user