PlsParser::PlsParser (QString playlistSource) { auto lines = playlistSource.split ('\n'); i = 1; updatePrefixes (); QString fileName, title; foreach (auto line, lines) { if (line.startsWith (filePrefix)) { fileName = line.mid (filePrefix.length ()); } else if (line.startsWith (titlePrefix)) { title = line.mid (titlePrefix.length ()); output.append (SongData (fileName, title)); incrementFile (); } } }
bool TClntOptIA_PD::doDuties() { if (!OriginalMsg) { Log(Error) << "Internal error. Unable to set prefixes: setContext() not called." << LogEnd; return false; } switch(OriginalMsg->getType()) { case REQUEST_MSG: case SOLICIT_MSG: return addPrefixes(); case RELEASE_MSG: return delPrefixes(); case RENEW_MSG: case REBIND_MSG: return updatePrefixes(); default: break; } return true; }
void PlsParser::incrementFile () { i++; updatePrefixes (); }