CMTDInfo::~CMTDInfo() { for(int x=0;x<getMTDCount();x++) { delete mtdData[x]; } mtdData.clear(); }
int CMTDInfo::findMTDNumberFromName(const char* name) { for (int i = 0; i < getMTDCount(); i++) { if ((std::string)name == getMTDName(i)) return i; } return -1; }
int CMTDInfo::findMTDNumber( string filename ) { for(int x=0;x<getMTDCount();x++) { if(filename == getMTDFileName(x)) { return x; } } return -1; }
int CMTDInfo::findMTDNumberFromDescription(const std::string & description) { for(int x=0;x<getMTDCount();x++) { if(description == getMTDName(x)) { return x; } } return -1; }
std::string CMTDInfo::findMTDsystem(const std::string & filename) { for(int i = 0; i < getMTDCount(); i++) { if(getMTDName(i) == filename) { return getMTDFileName(i); } } return ""; }
std::string CMTDInfo::findMTDsystem() { std::string sysfs = "systemFS"; for(int i = 0; i < getMTDCount(); i++) { if(getMTDName(i) == sysfs) { printf("systemFS: %d dev %s\n", i, getMTDFileName(i).c_str()); return getMTDFileName(i); } } return ""; }
std::string CMTDInfo::findMTDsystem() { #ifdef BOXMODEL_APOLLO std::string sysfs = "root0"; #else std::string sysfs = "systemFS"; #endif for(int i = 0; i < getMTDCount(); i++) { if(getMTDName(i) == sysfs) { printf("systemFS: %d dev %s\n", i, getMTDFileName(i).c_str()); return getMTDFileName(i); } } return ""; }