mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
neutrino use check empty() instead of length() or size()
This commit is contained in:
@@ -1402,7 +1402,7 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat )
|
||||
hh->printf("\t\t<info2>%s</info2>\n",ZapitTools::UTF8_to_UTF8XML(epg.info2.c_str()).c_str());
|
||||
if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) {
|
||||
hh->printf("\t\t<fsk>%u</fsk>\n", longepg.fsk);
|
||||
if (longepg.contentClassification.length()> 0){
|
||||
if (!longepg.contentClassification.empty()){
|
||||
genere = GetGenre(longepg.contentClassification[0]);
|
||||
genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str());
|
||||
hh->printf("\t\t<genre>%s</genre>\n", genere.c_str());
|
||||
@@ -1436,7 +1436,7 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat )
|
||||
hh->WriteLn(epg.info2);
|
||||
if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) {
|
||||
hh->printf("fsk:%u\n", longepg.fsk);
|
||||
if (longepg.contentClassification.length()> 0){
|
||||
if (!longepg.contentClassification.empty()){
|
||||
genere = GetGenre(longepg.contentClassification[0]);
|
||||
genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str());
|
||||
hh->WriteLn(genere);
|
||||
|
@@ -534,7 +534,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary,
|
||||
}
|
||||
log_level_printf(2,"<POST Boundary> read file (already:%d all:%d)\n", _readbytes, content_len);
|
||||
}
|
||||
while((_readbytes < content_len) && (tmp_line.length() != 0));
|
||||
while((_readbytes < content_len) && (!tmp_line.empty()));
|
||||
content_len -= _readbytes;
|
||||
close(fd);
|
||||
log_level_printf(2,"<POST Boundary> read file End\n");
|
||||
|
@@ -202,7 +202,7 @@ std::string CmodSendfile::GetFileName(CyhookHandler *hh, std::string path, std::
|
||||
//-----------------------------------------------------------------------------
|
||||
int CmodSendfile::OpenFile(CyhookHandler *, std::string fullfilename) {
|
||||
int fd = -1;
|
||||
if (fullfilename.length() > 0) {
|
||||
if (!fullfilename.empty()) {
|
||||
fd = open(fullfilename.c_str(), O_RDONLY | O_LARGEFILE);
|
||||
if (fd <= 0) {
|
||||
aprintf("cannot open file %s: ", fullfilename.c_str());
|
||||
|
@@ -181,7 +181,7 @@ void CyParser::cgi(CyhookHandler *hh) {
|
||||
yresult = cgi_file_parsing(hh, htmlfilename, ydebug);
|
||||
} else
|
||||
printf("[CyParser] Y-cgi:no parameter given\n");
|
||||
if (yresult.length() <= 0)
|
||||
if (yresult.empty())
|
||||
hh->SetError(HTTP_NOT_IMPLEMENTED, HANDLED_NOT_IMPLEMENTED);
|
||||
else
|
||||
hh->addResult(yresult, HANDLED_READY);
|
||||
@@ -249,7 +249,7 @@ void CyParser::ParseAndSendFile(CyhookHandler *hh) {
|
||||
}
|
||||
// parsing given file
|
||||
yresult += cgi_file_parsing(hh, hh->UrlData["path"]+hh->UrlData["filename"], ydebug);
|
||||
if (yresult.length() <= 0)
|
||||
if (yresult.empty())
|
||||
hh->SetError(HTTP_NOT_IMPLEMENTED, HANDLED_NOT_IMPLEMENTED);
|
||||
else {
|
||||
hh->addResult(yresult, HANDLED_READY);
|
||||
@@ -582,7 +582,7 @@ std::string CyParser::YWeb_cgi_include_block(std::string filename,
|
||||
blockname.c_str());
|
||||
}
|
||||
pthread_mutex_unlock(&yParser_mutex);
|
||||
if (yfile.length() != 0) {
|
||||
if (!yfile.empty()) {
|
||||
std::string t = "start-block~" + blockname;
|
||||
std::string::size_type start, end;
|
||||
if ((start = yfile.find(t)) != std::string::npos) {
|
||||
|
Reference in New Issue
Block a user