[Commits] : Tuxbox-GIT: apps branch master updated. CVS-Final-435-g8f9abfa
Tuxbox Sources
Brought to you by:
dbt1
|
From: GetAway <tux...@ne...> - 2014-11-07 15:46:49
|
Project "Tuxbox-GIT: apps":
The branch, master has been updated
via 8f9abfa8c0b426b42231f8ede21d3a434ec12e65 (commit)
via 8d7215d40fa907d95568e6852d54b21af02ea8a0 (commit)
via 155e42daa74ea4e5e1ca4ab789430c0056f904dc (commit)
via 35e42b607dd140eb2a990be519b093af6c99f776 (commit)
via 2ccff82fe9c1f58060487e74c0e29049d848368c (commit)
via 74a24e3364a44c5d17f21bf1560ba056a4e571e4 (commit)
via ec1bb8bcdd17a86ff34df8694dbd5221e36031a1 (commit)
via ae16f57cc525556d829511166b2ca058a6ddcc62 (commit)
via bd7b8acdcb425b48d278c893bf709ccc0cbd9359 (commit)
via bc5228d81bb23518a182db94c6df0287bc3fdfd9 (commit)
via 27260ea172d037de57fa691c5c670ddfe85cf897 (commit)
via ad2ecda9e11da3ca2cb6f38e4229a214d58568bd (commit)
via adf6297278c2de1f7758e98151e2bfb9fcf8bb90 (commit)
via a726e172299ec8521db9f8d636dc7aa7420a9ed7 (commit)
via 02873f78090484613c7e632844dbbca8cc1ea7a8 (commit)
from 8cade3ffa8084dba2171ab4cabb90065fb692659 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8f9abfa8c0b426b42231f8ede21d3a434ec12e65
Author: Christian Schuett <Gau...@ho...>
Date: Sun Nov 2 20:53:20 2014 +0100
nhttpd controlapi: allow zapping to subchannels
based on idea by Moritz Venn <mor...@fr...>
Signed-off-by: Christian Schuett <Gau...@ho...>
Signed-off-by: GetAway <get...@t-...>
diff --git a/tuxbox/neutrino/daemons/nhttpd/doc/nhttpd_controlapi.html b/tuxbox/neutrino/daemons/nhttpd/doc/nhttpd_controlapi.html
index 62cdf55..3a7748e 100644
--- a/tuxbox/neutrino/daemons/nhttpd/doc/nhttpd_controlapi.html
+++ b/tuxbox/neutrino/daemons/nhttpd/doc/nhttpd_controlapi.html
@@ -800,6 +800,20 @@ Beispiel:<br>
>>>http://dbox/control/zapto?name=Das%20Erste<br>
ok <br>
</div>
+<br>
+<b>Parameter:</b> subchannel=<channel_id> (64 bit, hexidecimal value)<br>
+<b>Rueckgabe:</b><br>
+<br>
+Zappt auf den angegebenen Unterkanal.<br>
+Als Rueckgabe ist im Erfolgsfall ok zu erwarten.<br>
+<br>
+<b>Rueckgabe-Format:</b> ok / error<br>
+<div class="example">
+Beispiel:<br>
+<br>
+>>>http://dbox/control/zapto?subchannel=1008500d4<br>
+ok <br>
+</div>
<!-- *********************************************************** -->
<div class="title1"><a name="setmode"></a>7. Radio/TV, Record Mode</div>
diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
index f2a7188..d6f825b 100644
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
@@ -1428,7 +1428,8 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
CSectionsdClient::LinkageDescriptorList desc;
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
bool has_current_next = NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(current_channel, currentNextInfo);
- if (has_current_next && NeutrinoAPI->Sectionsd->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey, desc))
+ if (has_current_next && currentNextInfo.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors &&
+ NeutrinoAPI->Sectionsd->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey, desc))
{
for(unsigned int i=0;i< desc.size();i++)
{
@@ -1454,6 +1455,19 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
else
hh->SendError();
}
+ else if (!hh->ParamList["subchannel"].empty())
+ {
+ t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID();
+ CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
+ bool has_current_next = NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(current_channel, currentNextInfo);
+ if (has_current_next && currentNextInfo.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors)
+ {
+ NeutrinoAPI->ZapToSubService(hh->ParamList["subchannel"].c_str());
+ hh->SendOk();
+ }
+ else
+ hh->SendError();
+ }
else
{
NeutrinoAPI->ZapTo(hh->ParamList["1"].c_str());
commit 8d7215d40fa907d95568e6852d54b21af02ea8a0
Author: Christian Schuett <Gau...@ho...>
Date: Sun Nov 2 17:27:15 2014 +0100
nhttpd helper: pass std::string by reference if possible
Signed-off-by: Christian Schuett <Gau...@ho...>
Signed-off-by: GetAway <get...@t-...>
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.cpp
index 471eb23..8e17c03 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.cpp
@@ -92,7 +92,7 @@ std::string string_printf(const char *fmt, ...)
// ySplitString: spit string "str" in two strings "left" and "right" at
// one of the chars in "delimiter" returns true if delimiter found
//-------------------------------------------------------------------------
-bool ySplitString(std::string str, std::string delimiter, std::string& left, std::string& right)
+bool ySplitString(const std::string &str, const std::string &delimiter, std::string &left, std::string &right)
{
std::string::size_type pos;
if ((pos = str.find_first_of(delimiter)) != std::string::npos)
@@ -111,7 +111,7 @@ bool ySplitString(std::string str, std::string delimiter, std::string& left, std
// ySplitString: spit string "str" in two strings "left" and "right" at
// one of the chars in "delimiter" returns true if delimiter found
//-------------------------------------------------------------------------
-bool ySplitStringExact(std::string str, std::string delimiter, std::string& left, std::string& right)
+bool ySplitStringExact(const std::string &str, const std::string &delimiter, std::string &left, std::string &right)
{
std::string::size_type pos;
if ((pos = str.find(delimiter)) != std::string::npos)
@@ -130,7 +130,7 @@ bool ySplitStringExact(std::string str, std::string delimiter, std::string& left
// ySplitStringRight: spit string "str" in two strings "left" and "right" at
// one of the chars in "delimiter" returns true if delimiter found
//-------------------------------------------------------------------------
-bool ySplitStringLast(std::string str, std::string delimiter, std::string& left, std::string& right)
+bool ySplitStringLast(const std::string &str, const std::string &delimiter, std::string &left, std::string &right)
{
std::string::size_type pos;
if ((pos = str.find_last_of(delimiter)) != std::string::npos)
@@ -148,7 +148,7 @@ bool ySplitStringLast(std::string str, std::string delimiter, std::string& left,
//-------------------------------------------------------------------------
// ySplitStringVector: spit string "str" and build vector of strings
//-------------------------------------------------------------------------
-CStringArray ySplitStringVector(std::string str, std::string delimiter)
+CStringArray ySplitStringVector(const std::string &str, const std::string &delimiter)
{
std::string left, right, rest;
bool found;
@@ -203,7 +203,7 @@ bool nocase_compare (char c1, char c2)
//-----------------------------------------------------------------------------
// Decode URLEncoded std::string
//-----------------------------------------------------------------------------
-std::string decodeString(std::string encodedString)
+std::string decodeString(const std::string &encodedString)
{
const char *string = encodedString.c_str();
unsigned int count=0;
@@ -239,7 +239,7 @@ std::string decodeString(std::string encodedString)
//-----------------------------------------------------------------------------
// HTMLEncode std::string
//-----------------------------------------------------------------------------
-std::string encodeString(std::string decodedString)
+std::string encodeString(const std::string &decodedString)
{
unsigned int len = sizeof(char) * decodedString.length()*5 + 1;
std::string result( len, '\0' );
@@ -279,7 +279,7 @@ std::string string_tolower(std::string str)
//-----------------------------------------------------------------------------
// write string to a file
//-----------------------------------------------------------------------------
-bool write_to_file(std::string filename, std::string content)
+bool write_to_file(const std::string &filename, const std::string &content)
{
FILE *fd = NULL;
if((fd = fopen(filename.c_str(),"w")) != NULL) // open file
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.h b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.h
index 2d570ac..2b22c66 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.h
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.h
@@ -21,8 +21,8 @@ void correctTime(struct tm *zt);
//-----------------------------------------------------------------------------
std::string itoa(unsigned int conv);
std::string itoh(unsigned int conv);
-std::string decodeString(std::string encodedString);
-std::string encodeString(std::string decodedString);
+std::string decodeString(const std::string &encodedString);
+std::string encodeString(const std::string &decodedString);
std::string string_tolower(std::string str);
//-----------------------------------------------------------------------------
@@ -31,12 +31,12 @@ std::string string_tolower(std::string str);
std::string trim(std::string const& source, char const* delims = " \t\r\n");
void replace(std::string &str, const std::string &find_what, const std::string &replace_with);
std::string string_printf(const char *fmt, ...);
-bool ySplitString(std::string str, std::string delimiter, std::string& left, std::string& right);
-bool ySplitStringExact(std::string str, std::string delimiter, std::string& left, std::string& right);
-bool ySplitStringLast(std::string str, std::string delimiter, std::string& left, std::string& right);
-CStringArray ySplitStringVector(std::string str, std::string delimiter);
+bool ySplitString(const std::string &str, const std::string &delimiter, std::string &left, std::string &right);
+bool ySplitStringExact(const std::string &str, const std::string &delimiter, std::string &left, std::string &right);
+bool ySplitStringLast(const std::string &str, const std::string &delimiter, std::string &left, std::string &right);
+CStringArray ySplitStringVector(const std::string &str, const std::string &delimiter);
bool nocase_compare (char c1, char c2);
std::string timeString(time_t time);
-bool write_to_file(std::string filename, std::string content);
+bool write_to_file(const std::string &filename, const std::string &content);
#endif /* __yhttpd_helper_h__ */
commit 155e42daa74ea4e5e1ca4ab789430c0056f904dc
Author: GetAway <get...@t-...>
Date: Sat Nov 1 19:13:18 2014 +0100
tuxmaild: fix mail header parsing version bump 1.51C
Signed-off-by: GetAway <get...@t-...>
diff --git a/tuxbox/plugins/tuxmail/daemon/tuxmaild.c b/tuxbox/plugins/tuxmail/daemon/tuxmaild.c
index 5069113..06af926 100644
--- a/tuxbox/plugins/tuxmail/daemon/tuxmaild.c
+++ b/tuxbox/plugins/tuxmail/daemon/tuxmaild.c
@@ -829,7 +829,7 @@ int DecodeHeader(char *encodedstring)
{
char *ptrS, *ptrE;
- if((ptrS = strstr(encodedstring, "?B?")))
+ if((ptrS = strstr(encodedstring, "?B?")) || (ptrS = strstr(encodedstring, "?b?")))
{
ptrS += 3;
@@ -840,7 +840,7 @@ int DecodeHeader(char *encodedstring)
return ptrE+2 - encodedstring;
}
}
- else if((ptrS = strstr(encodedstring, "?Q?")))
+ else if((ptrS = strstr(encodedstring, "?Q?")) || (ptrS = strstr(encodedstring, "?q?")))
{
ptrS += 3;
@@ -4800,7 +4800,7 @@ void SigHandler(int signal)
int main(int argc, char **argv)
{
- char cvs_revision[] = "$Revision: 1.51B $";
+ char cvs_revision[] = "$Revision: 1.51C $";
int param, nodelay = 0, account, mailstatus, unread_mailstatus;
pthread_t thread_id;
void *thread_result = 0;
commit 35e42b607dd140eb2a990be519b093af6c99f776
Author: Christian Schuett <Gau...@ho...>
Date: Fri Oct 31 18:12:37 2014 +0100
Neutrino: check emptiness of strings with empty()
Signed-off-by: Christian Schuett <Gau...@ho...>
Signed-off-by: GetAway <get...@t-...>
diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
index cdaeadd..f2a7188 100644
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
@@ -51,7 +51,7 @@ CControlAPI::CControlAPI(CNeutrinoAPI *_NeutrinoAPI)
//-----------------------------------------------------------------------------
void CControlAPI::init(CyhookHandler *hh)
{
- if(PLUGIN_DIRS[0] == "")
+ if(PLUGIN_DIRS[0].empty())
{ // given in nhttpd.conf
PLUGIN_DIRS[0]=hh->WebserverConfigList["PublicDocumentRoot"];
PLUGIN_DIRS[0].append("/scripts");
@@ -226,7 +226,7 @@ void CControlAPI::Execute(CyhookHandler *hh)
else if(std::string(yCgiCallList[index].mime_type) == "") // decide in function
;
else if(std::string(yCgiCallList[index].mime_type) == "+xml") // Parameter xml?
- if (hh->ParamList["xml"] != "")
+ if (!hh->ParamList["xml"].empty())
hh->SetHeader(HTTP_OK, "text/xml; charset=iso-8859-1");
else
hh->SetHeader(HTTP_OK, "text/html; charset=iso-8859-1");
@@ -264,7 +264,7 @@ void CControlAPI::TimerCGI(CyhookHandler *hh)
NeutrinoAPI->Timerd->removeTimerEvent(removeId);
hh->SendOk();
}
- else if(hh->ParamList["get"] != "")
+ else if(!hh->ParamList["get"].empty())
{
int pre=0,post=0;
NeutrinoAPI->Timerd->getRecordingSafety(pre,post);
@@ -807,11 +807,11 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh)
}
unsigned int repeat = 1;
unsigned int delay = 250;
- if (hh->ParamList["delay"] != "")
+ if (!hh->ParamList["delay"].empty())
delay = atoi(hh->ParamList["delay"].c_str());
- if (hh->ParamList["duration"] != "")
+ if (!hh->ParamList["duration"].empty())
repeat = atoi(hh->ParamList["duration"].c_str())*1000/delay;
- if (hh->ParamList["repeat"] != "")
+ if (!hh->ParamList["repeat"].empty())
repeat = atoi(hh->ParamList["repeat"].c_str());
int evd = open(EVENTDEV, O_RDWR);
@@ -973,7 +973,7 @@ void CControlAPI::VolumeCGI(CyhookHandler *hh)
{
hh->Write((char *) (NeutrinoAPI->Controld->getMute() ? "1" : "0")); // mute
}
- else if(hh->ParamList["1"]!="")
+ else if(!hh->ParamList["1"].empty())
{ //set volume
char vol = atol( hh->ParamList["1"].c_str() );
NeutrinoAPI->Controld->setVolume(vol);
@@ -1198,7 +1198,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh)
}
}
}
- else if (hh->ParamList["eventid"] != "")
+ else if (!hh->ParamList["eventid"].empty())
{
//special epg query
unsigned long long epgid;
@@ -1211,9 +1211,9 @@ void CControlAPI::EpgCGI(CyhookHandler *hh)
hh->WriteLn(epg.info2);
}
}
- else if (hh->ParamList["eventid2fsk"] != "")
+ else if (!hh->ParamList["eventid2fsk"].empty())
{
- if (hh->ParamList["starttime"] != "")
+ if (!hh->ParamList["starttime"].empty())
{
unsigned long long epgid;
time_t starttime;
@@ -1442,7 +1442,7 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
}
}
}
- else if (hh->ParamList["name"] != "")
+ else if (!hh->ParamList["name"].empty())
{
t_channel_id channel_id;
channel_id = NeutrinoAPI->ChannelNameToChannelId(hh->ParamList["name"]);
@@ -1472,7 +1472,7 @@ void CControlAPI::StartPluginCGI(CyhookHandler *hh)
std::string pluginname;
if (!(hh->ParamList.empty()))
{
- if (hh->ParamList["name"] != "")
+ if (!hh->ParamList["name"].empty())
{
pluginname = hh->ParamList["name"];
//pluginname=decodeString(pluginname);
@@ -1517,21 +1517,21 @@ void CControlAPI::LCDAction(CyhookHandler *hh)
return;
}
- if (hh->ParamList["lock"] != "")
+ if (!hh->ParamList["lock"].empty())
if(sscanf( hh->ParamList["lock"].c_str(), "%d", &tval))
NeutrinoAPI->LcdAPI->LockDisplay(tval);
else
error=1;
- if (hh->ParamList["clear"] != "")
+ if (!hh->ParamList["clear"].empty())
if(sscanf( hh->ParamList["clear"].c_str(), "%d", &tval))
if(tval)
NeutrinoAPI->LcdAPI->Clear();
else
error=1;
- if (hh->ParamList["png"] != "")
+ if (!hh->ParamList["png"].empty())
if(! NeutrinoAPI->LcdAPI->ShowPng((char*)hh->ParamList["png"].c_str()))
error=1;
- if (hh->ParamList["raw"] != "")
+ if (!hh->ParamList["raw"].empty())
{
char *sptr=strdup((char*)hh->ParamList["raw"].c_str()),*pptr;
int loop=4;
@@ -1550,44 +1550,44 @@ void CControlAPI::LCDAction(CyhookHandler *hh)
if(sptr)
free(sptr);
}
- if (hh->ParamList["line"] != "")
+ if (!hh->ParamList["line"].empty())
if(sscanf( hh->ParamList["line"].c_str(), "%d,%d,%d,%d,%d",&x1,&y1,&x2,&y2,&coll)==5)
NeutrinoAPI->LcdAPI->DrawLine(x1,y1,x2,y2,coll);
else
error=1;
- if (hh->ParamList["rect"] != "")
+ if (!hh->ParamList["rect"].empty())
if(sscanf( hh->ParamList["rect"].c_str(), "%d,%d,%d,%d,%d,%d",&x1,&y1,&x2,&y2,&coll,&colf)==6)
NeutrinoAPI->LcdAPI->DrawRect(x1,y1,x2,y2,coll,colf);
else
error=1;
- if (hh->ParamList["xpos"] != "")
+ if (!hh->ParamList["xpos"].empty())
if(sscanf( hh->ParamList["xpos"].c_str(), "%d", &tval))
xpos=tval;
else
error=1;
- if (hh->ParamList["ypos"] != "")
+ if (!hh->ParamList["ypos"].empty())
if(sscanf( hh->ParamList["ypos"].c_str(), "%d", &tval))
ypos=tval;
else
error=1;
- if (hh->ParamList["size"] != "")
+ if (!hh->ParamList["size"].empty())
if(sscanf( hh->ParamList["size"].c_str(), "%d", &tval))
size=tval;
else
error=1;
- if (hh->ParamList["color"] != "")
+ if (!hh->ParamList["color"].empty())
if(sscanf( hh->ParamList["color"].c_str(), "%d", &tval))
color=tval;
else
error=1;
- if (hh->ParamList["font"] != "")
+ if (!hh->ParamList["font"].empty())
if(sscanf( hh->ParamList["font"].c_str(), "%d", &tval) && tval>=0 && tval<3)
font=tval;
else
error=1;
- if (hh->ParamList["text"] != "")
+ if (!hh->ParamList["text"].empty())
NeutrinoAPI->LcdAPI->DrawText(xpos, ypos, size, color, font, (char*)hh->ParamList["text"].c_str());
- if (hh->ParamList["update"] != "")
+ if (!hh->ParamList["update"].empty())
if(sscanf( hh->ParamList["update"].c_str(), "%d", &tval))
if(tval)
NeutrinoAPI->LcdAPI->Update();
@@ -2194,7 +2194,7 @@ void CControlAPI::YWebCGI(CyhookHandler *hh)
{
bool status=true;
int para;
- if (hh->ParamList["video_stream_pids"] != "")
+ if (!hh->ParamList["video_stream_pids"].empty())
{
para=0;
sscanf( hh->ParamList["video_stream_pids"].c_str(), "%d", ¶);
@@ -2221,7 +2221,7 @@ void CControlAPI::YWeb_SendVideoStreamingPids(CyhookHandler *hh, int apid_no)
apid_idx=apid_no;
if(!pids.APIDs.empty())
apid = pids.APIDs[apid_idx].pid;
- if(hh->ParamList["no_commas"] != "")
+ if(!hh->ParamList["no_commas"].empty())
{
hh->printf("0x%04x 0x%04x 0x%04x",pids.PIDs.pmtpid,pids.PIDs.vpid,apid);
if (pids.PIDs.pcrpid != 0 && pids.PIDs.pcrpid != pids.PIDs.vpid)
@@ -2316,17 +2316,17 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
int alHour=0;
// if alarm given then in parameters im time_t format
- if(hh->ParamList["alarm"] != "")
+ if(!hh->ParamList["alarm"].empty())
{
alarmTimeT = atoi(hh->ParamList["alarm"].c_str());
- if(hh->ParamList["stop"] != "")
+ if(!hh->ParamList["stop"].empty())
stopTimeT = atoi(hh->ParamList["stop"].c_str());
- if(hh->ParamList["announce"] != "")
+ if(!hh->ParamList["announce"].empty())
announceTimeT = atoi(hh->ParamList["announce"].c_str());
else
announceTimeT = alarmTimeT;
}
- else if(hh->ParamList["alDate"] != "") //given formatted
+ else if(!hh->ParamList["alDate"].empty()) //given formatted
{
// Alarm Date - Format exact! DD.MM.YYYY
tnull = time(NULL);
@@ -2339,7 +2339,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
}
// Alarm Time - Format exact! HH:MM
- if(hh->ParamList["alTime"] != "")
+ if(!hh->ParamList["alTime"].empty())
sscanf(hh->ParamList["alTime"].c_str(),"%2d.%2d",&(alarmTime->tm_hour), &(alarmTime->tm_min));
alHour = alarmTime->tm_hour;
correctTime(alarmTime);
@@ -2348,11 +2348,11 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
struct tm *stopTime = localtime(&alarmTimeT);
stopTime->tm_sec = 0;
// Stop Time - Format exact! HH:MM
- if(hh->ParamList["stTime"] != "")
+ if(!hh->ParamList["stTime"].empty())
sscanf(hh->ParamList["stTime"].c_str(),"%2d.%2d",&(stopTime->tm_hour), &(stopTime->tm_min));
// Stop Date - Format exact! DD.MM.YYYY
- if(hh->ParamList["stDate"] != "")
+ if(!hh->ParamList["stDate"].empty())
if(sscanf(hh->ParamList["stDate"].c_str(),"%2d.%2d.%4d",&(stopTime->tm_mday), &(stopTime->tm_mon), &(stopTime->tm_year)) == 3)
{
stopTime->tm_mon -= 1;
@@ -2360,7 +2360,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
}
correctTime(stopTime);
stopTimeT = mktime(stopTime);
- if(hh->ParamList["stDate"] == "" && alHour > stopTime->tm_hour)
+ if(hh->ParamList["stDate"].empty() && alHour > stopTime->tm_hour)
stopTimeT += 24* 60 * 60; // add 1 Day
}
else // alarm/stop time given in pieces
@@ -2368,15 +2368,15 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
// alarm time
time_t now = time(NULL);
struct tm *alarmTime=localtime(&now);
- if(hh->ParamList["ad"] != "")
+ if(!hh->ParamList["ad"].empty())
alarmTime->tm_mday = atoi(hh->ParamList["ad"].c_str());
- if(hh->ParamList["amo"] != "")
+ if(!hh->ParamList["amo"].empty())
alarmTime->tm_mon = atoi(hh->ParamList["amo"].c_str())-1;
- if(hh->ParamList["ay"] != "")
+ if(!hh->ParamList["ay"].empty())
alarmTime->tm_year = atoi(hh->ParamList["ay"].c_str())-1900;
- if(hh->ParamList["ah"] != "")
+ if(!hh->ParamList["ah"].empty())
alarmTime->tm_hour = atoi(hh->ParamList["ah"].c_str());
- if(hh->ParamList["ami"] != "")
+ if(!hh->ParamList["ami"].empty())
alarmTime->tm_min = atoi(hh->ParamList["ami"].c_str());
alarmTime->tm_sec = 0;
correctTime(alarmTime);
@@ -2385,15 +2385,15 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
// stop time
struct tm *stopTime = alarmTime;
- if(hh->ParamList["sd"] != "")
+ if(!hh->ParamList["sd"].empty())
stopTime->tm_mday = atoi(hh->ParamList["sd"].c_str());
- if(hh->ParamList["smo"] != "")
+ if(!hh->ParamList["smo"].empty())
stopTime->tm_mon = atoi(hh->ParamList["smo"].c_str())-1;
- if(hh->ParamList["sy"] != "")
+ if(!hh->ParamList["sy"].empty())
stopTime->tm_year = atoi(hh->ParamList["sy"].c_str())-1900;
- if(hh->ParamList["sh"] != "")
+ if(!hh->ParamList["sh"].empty())
stopTime->tm_hour = atoi(hh->ParamList["sh"].c_str());
- if(hh->ParamList["smi"] != "")
+ if(!hh->ParamList["smi"].empty())
stopTime->tm_min = atoi(hh->ParamList["smi"].c_str());
stopTime->tm_sec = 0;
correctTime(stopTime);
@@ -2404,22 +2404,22 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
announceTimeT -= 60;
CTimerd::CTimerEventTypes type;
- if(hh->ParamList["type"] != "")
+ if(!hh->ParamList["type"].empty())
type = (CTimerd::CTimerEventTypes) atoi(hh->ParamList["type"].c_str());
else // default is: record
type = CTimerd::TIMER_RECORD;
// repeat
- if(hh->ParamList["repcount"] != "")
+ if(!hh->ParamList["repcount"].empty())
{
repCount = atoi(hh->ParamList["repcount"].c_str());
}
CTimerd::CTimerEventRepeat rep;
- if(hh->ParamList["rep"] != "")
+ if(!hh->ParamList["rep"].empty())
rep = (CTimerd::CTimerEventRepeat) atoi(hh->ParamList["rep"].c_str());
else // default: no repeat
rep = (CTimerd::CTimerEventRepeat)0;
- if(((int)rep) >= ((int)CTimerd::TIMERREPEAT_WEEKDAYS) && hh->ParamList["wd"] != "")
+ if(((int)rep) >= ((int)CTimerd::TIMERREPEAT_WEEKDAYS) && !hh->ParamList["wd"].empty())
NeutrinoAPI->Timerd->getWeekdaysFromStr((int*)&rep, hh->ParamList["wd"].c_str());
// apids
@@ -2457,7 +2457,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
eventinfo.recordingSafety = (hh->ParamList["rs"] == "1");
// channel by Id or name
- if(hh->ParamList["channel_id"] != "")
+ if(!hh->ParamList["channel_id"].empty())
sscanf(hh->ParamList["channel_id"].c_str(),
SCANF_CHANNEL_ID_TYPE,
&eventinfo.channel_id);
@@ -2477,7 +2477,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
data= &eventinfo;
else if (type==CTimerd::TIMER_RECORD)
{
- if(_rec_dir == "")
+ if(_rec_dir.empty())
{
// get Default Recordingdir
CConfigFile *Config = new CConfigFile(',');
@@ -2508,7 +2508,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
// update or add timer
if(hh->ParamList["update"]=="1")
{
- if(hh->ParamList["id"] != "")
+ if(!hh->ParamList["id"].empty())
{
unsigned modyId = atoi(hh->ParamList["id"].c_str());
if(type == CTimerd::TIMER_RECORD)
@@ -2551,7 +2551,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
//-------------------------------------------------------------------------
void CControlAPI::setBouquetCGI(CyhookHandler *hh)
{
- if (hh->ParamList["selected"] != "") {
+ if (!hh->ParamList["selected"].empty()) {
int selected = atoi(hh->ParamList["selected"].c_str());
if(hh->ParamList["action"].compare("hide") == 0)
NeutrinoAPI->Zapit->setBouquetHidden(selected - 1,true);
@@ -2576,7 +2576,7 @@ void CControlAPI::saveBouquetCGI(CyhookHandler *hh)
//-------------------------------------------------------------------------
void CControlAPI::moveBouquetCGI(CyhookHandler *hh)
{
- if (hh->ParamList["selected"] != "" && (
+ if (!hh->ParamList["selected"].empty() && (
hh->ParamList["action"] == "up" ||
hh->ParamList["action"] == "down"))
{
@@ -2598,7 +2598,7 @@ void CControlAPI::deleteBouquetCGI(CyhookHandler *hh)
{
int selected = -1;
- if (hh->ParamList["selected"] != "") {
+ if (!hh->ParamList["selected"].empty()) {
selected = atoi(hh->ParamList["selected"].c_str());
NeutrinoAPI->Zapit->deleteBouquet(selected - 1);
hh->SendOk();
@@ -2624,9 +2624,9 @@ void CControlAPI::addBouquetCGI(CyhookHandler *hh)
//-------------------------------------------------------------------------
void CControlAPI::renameBouquetCGI(CyhookHandler *hh)
{
- if (hh->ParamList["selected"] != "")
+ if (!hh->ParamList["selected"].empty())
{
- if (hh->ParamList["nameto"] != "")
+ if (!hh->ParamList["nameto"].empty())
{
if (NeutrinoAPI->Zapit->existsBouquet((hh->ParamList["nameto"]).c_str()) == -1)
{
@@ -2667,7 +2667,7 @@ void CControlAPI::changeBouquetCGI(CyhookHandler *hh)
NeutrinoAPI->Zapit->renumChannellist();
NeutrinoAPI->UpdateBouquets();
- if(hh->ParamList["redirect"] != "")
+ if(!hh->ParamList["redirect"].empty())
hh->SendRewrite(hh->ParamList["redirect"]);
else
hh->SendOk();
@@ -2695,7 +2695,7 @@ void CControlAPI::build_live_url(CyhookHandler *hh)
int apid=0,apid_no=0,apid_idx=0;
pids.PIDs.vpid=0;
- if(hh->ParamList["audio_no"] !="")
+ if(!hh->ParamList["audio_no"].empty())
apid_no = atoi(hh->ParamList["audio_no"].c_str());
NeutrinoAPI->Zapit->getPIDS(pids);
@@ -2722,14 +2722,14 @@ void CControlAPI::build_live_url(CyhookHandler *hh)
hh->SendError();
// build url
std::string url = "";
- if(hh->ParamList["host"] !="")
+ if(!hh->ParamList["host"].empty())
url = "http://"+hh->ParamList["host"];
else
url = "http://"+hh->HeaderList["Host"];
url += (mode == CZapitClient::MODE_TV) ? ":31339/0," : ":31338/";
url += xpids;
// response url
- if(hh->ParamList["vlc_link"] !="")
+ if(!hh->ParamList["vlc_link"].empty())
{
write_to_file("/tmp/vlc.m3u", url);
hh->SendRedirect("/tmp/vlc.m3u");
diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp
index 38542af..ef59fbe 100644
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp
@@ -157,7 +157,7 @@ std::string CNeutrinoYParser::func_mount_get_list(CyhookHandler */*hh*/, std::s
yip = Config->getString("network_nfs_ip_"+ynr,"");
ydir = Config->getString("network_nfs_dir_"+ynr,"");
ylocal_dir = Config->getString("network_nfs_local_dir_"+ynr,"");
- if(ydir != "")
+ if(!ydir.empty())
ydir="("+ydir+")";
yresult += string_printf("<input type='radio' name='R1' value='%d' %s />%d %s - %s %s %s<br/>",
@@ -201,7 +201,7 @@ std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler */*hh
unsigned int nr=1;
ySplitString(para," ",nr_str, do_show_hidden);
- if(nr_str != "")
+ if(!nr_str.empty())
nr = atoi(nr_str.c_str());
for (unsigned int i = 0; i < NeutrinoAPI->BouquetList.size();i++)
@@ -268,7 +268,7 @@ std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler */*hh
int mode = CZapitClient::MODE_CURRENT;
ySplitString(para," ",abouquet, achannel_id);
- if(abouquet != "")
+ if(!abouquet.empty())
bnumber = atoi(abouquet.c_str());
if(bnumber != 0) //Bouquet View
@@ -300,7 +300,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
CZapitClient::BouquetChannelList *channellist;
ySplitString(para," ",abnumber, tmp);
- if(abnumber != "")
+ if(!abnumber.empty())
BouquetNr = atoi(abnumber.c_str());
if (BouquetNr > 0)
channellist = NeutrinoAPI->GetBouquet(BouquetNr, CZapitClient::MODE_CURRENT);
@@ -317,7 +317,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
std::string timestr;
bool have_logos = false;
- if(hh->WebserverConfigList["TUXBOX_LOGOS_URL"] != "")
+ if(!hh->WebserverConfigList["TUXBOX_LOGOS_URL"].empty())
have_logos = true;
CZapitClient::BouquetChannelList::iterator channel = channellist->begin();
for (; channel != channellist->end(); ++channel)
@@ -482,7 +482,7 @@ std::string CNeutrinoYParser::func_get_video_pids(CyhookHandler */*hh*/, std::s
int apid=0,apid_no=0,apid_idx=0;
pids.PIDs.vpid=0;
- if(para != "")
+ if(!para.empty())
apid_no = atoi(para.c_str());
NeutrinoAPI->Zapit->getPIDS(pids);
@@ -641,7 +641,7 @@ std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler */*hh*/, st
in >> ymtd >> dummy >> dummy; //format: mtd# start end "name "
in.getline(ytmp, 200); // Rest of line is the mtd description
yname = ytmp;
- if((j>0) && (ymtd != ""))// iggnore first line
+ if((j>0) && !ymtd.empty())// iggnore first line
{
ysel = ((j==1) ? "checked=\"checked\"" : "");
yresult += string_printf("<input type='radio' name='R1' value='%d' %s title='%s' />%d %s<br/>",
@@ -860,7 +860,7 @@ std::string CNeutrinoYParser::func_set_timer_form(CyhookHandler *hh, std::strin
if(cmd != "new")
{
// init timerid
- if(stimerid != "")
+ if(!stimerid.empty())
timerId = (unsigned)atoi(stimerid.c_str());
NeutrinoAPI->Timerd->getTimer(timer, timerId);
@@ -1004,7 +1004,7 @@ std::string CNeutrinoYParser::func_bouquet_editor_main(CyhookHandler *hh, std::
if (hh->ParamList["saved"] == "1")
hh->ParamList["have_saved"]="true";
- if (hh->ParamList["selected"] != "")
+ if (!hh->ParamList["selected"].empty())
selected = atoi(hh->ParamList["selected"].c_str());
// List of all bouquets
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd.cpp
index a8197c7..285c3b0 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd.cpp
@@ -221,7 +221,7 @@ bool Cyhttpd::Configure()
std::string groupname= ConfigList["server.group_name"];
// get user data
- if(username != "")
+ if(!username.empty())
{
if((pwd = getpwnam(username.c_str())) == NULL)
{
@@ -230,7 +230,7 @@ bool Cyhttpd::Configure()
}
}
// get group data
- if(groupname != "")
+ if(!groupname.empty())
{
if((grp = getgrnam(groupname.c_str())) == NULL)
{
@@ -259,7 +259,7 @@ bool Cyhttpd::Configure()
}
#endif
#ifdef Y_CONFIG_FEATURE_HTTPD_USER
- if(username != "" && pwd != NULL && grp != NULL)
+ if(!username.empty() && pwd != NULL && grp != NULL)
{
log_level_printf(2, "set user and groups\n");
@@ -267,7 +267,7 @@ bool Cyhttpd::Configure()
setgid(grp->gr_gid);
setgroups(0, NULL);
// set user group
- if(groupname != "")
+ if(!groupname.empty())
initgroups(username.c_str(), grp->gr_gid);
// set user
if(setuid(pwd->pw_uid) == -1)
@@ -433,11 +433,11 @@ void Cyhttpd::ReadConfig(void)
Config->setBool("webserver.threading", OrgConfig.getBool("THREADS", true));
Config->setInt32("WebsiteMain.port",OrgConfig.getInt32("Port", HTTPD_STANDARD_PORT));
Config->setString("WebsiteMain.directory", OrgConfig.getString("PrivatDocRoot", PRIVATEDOCUMENTROOT));
- if(OrgConfig.getString("PublicDocRoot", "") != "")
+ if(!OrgConfig.getString("PublicDocRoot", "").empty())
Config->setString("WebsiteMain.override_directory", OrgConfig.getString("PublicDocRoot", PRIVATEDOCUMENTROOT));
- if(OrgConfig.getString("HostedDocRoot", "") != "")
+ if(!OrgConfig.getString("HostedDocRoot", "").empty())
Config->setString("WebsiteMain.special_locations", "/hosted/="+OrgConfig.getString("HostedDocRoot", PRIVATEDOCUMENTROOT));
- if(OrgConfig.getString("HostedDocRoot", "") != "")
+ if(!OrgConfig.getString("HostedDocRoot", "").empty())
Config->setString("Tuxbox.HostedDocumentRoot", OrgConfig.getString("HostedDocRoot", PRIVATEDOCUMENTROOT));
// mod_auth
Config->setString("mod_auth.username", OrgConfig.getString("AuthUser", AUTHUSER));
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/yrequest.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/yrequest.cpp
index 35de525..d861516 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/yrequest.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/yrequest.cpp
@@ -61,7 +61,7 @@ bool CWebserverRequest::HandleRequest(void)
start_line = Connection->sock->ReceiveLine();
if(!Connection->sock->isValid)
return false;
- if(start_line == "") // Socket empty
+ if(start_line.empty()) // Socket empty
{
log_level_printf(1,"HandleRequest: End of line not found\n");
Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR);
@@ -89,7 +89,7 @@ bool CWebserverRequest::HandleRequest(void)
return false;
}
- if(tmp_line == "")
+ if(tmp_line.empty())
{
Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR);
return false;
@@ -272,7 +272,7 @@ bool CWebserverRequest::HandlePost()
do
{
tmp_line = Connection->sock->ReceiveLine();
- if(tmp_line == "") // Socket empty
+ if(tmp_line.empty()) // Socket empty
{
log_level_printf(1,"HandleRequest: (Header) End of line not found: %s\n", strerror(errno));
Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR);
@@ -285,7 +285,7 @@ bool CWebserverRequest::HandlePost()
// read meesage body
unsigned int content_len = 0;
- if(HeaderList["Content-Length"] != "")
+ if(!HeaderList["Content-Length"].empty())
content_len = atoi( HeaderList["Content-Length"].c_str() );
// Get Rest of Request from Socket
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/ysocket.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/ysocket.cpp
index ba69d9c..93e1ba6 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/ysocket.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/ysocket.cpp
@@ -115,12 +115,12 @@ bool CySocket::initSSL(void)
aprintf("ySocket:SSL Error: Create SSL_CTX_new : %s\n", ERR_error_string(ERR_get_error(), NULL) );
return false;
}
- if(SSL_pemfile == "")
+ if(SSL_pemfile.empty())
{
aprintf("ySocket:SSL Error: no pemfile given\n");
return false;
}
- if(SSL_CA_file != "") // have a CA?
+ if(!SSL_CA_file.empty()) // have a CA?
if(1 != SSL_CTX_load_verify_locations(SSL_ctx, SSL_CA_file.c_str(), NULL))
{
aprintf("ySocket:SSL Error: %s CA-File:%s\n",ERR_error_string(ERR_get_error(), NULL), SSL_CA_file.c_str());
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_auth.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_auth.cpp
index 41682da..9a900bb 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_auth.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_auth.cpp
@@ -18,7 +18,7 @@ THandleStatus CmAuth::Hook_PrepareResponse(CyhookHandler *hh)
if(authenticate)
{
if( (hh->UrlData["clientaddr"]).find(IADDR_LOCAL)>0 &&
- (no_auth_client == "" ||
+ (no_auth_client.empty() ||
(hh->UrlData["clientaddr"]).find(no_auth_client)>0)) // dont check local calls or calls from NoAuthClient
{
if (!CheckAuth(hh))
@@ -53,7 +53,7 @@ THandleStatus CmAuth::Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigLi
//-----------------------------------------------------------------------------
bool CmAuth::CheckAuth(CyhookHandler *hh)
{
- if (hh->HeaderList["Authorization"] == "")
+ if (hh->HeaderList["Authorization"].empty())
return false;
std::string encodet = hh->HeaderList["Authorization"].substr(6,hh->HeaderList["Authorization"].length() - 6);
std::string decodet = decodeBase64(encodet.c_str());
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_cache.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_cache.cpp
index 9bbefca..e54f4aa 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_cache.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_cache.cpp
@@ -40,7 +40,7 @@ THandleStatus CmodCache::Hook_PrepareResponse(CyhookHandler *hh)
// Check if modified
time_t if_modified_since = (time_t)-1;
- if(hh->HeaderList["If-Modified-Since"] != "") // Have If-Modified-Since Requested by Browser?
+ if(!hh->HeaderList["If-Modified-Since"].empty()) // Have If-Modified-Since Requested by Browser?
{
struct tm mod;
if(strptime(hh->HeaderList["If-Modified-Since"].c_str(), RFC1123FMT, &mod) != NULL)
@@ -235,12 +235,12 @@ void CmodCache::yshowCacheInfo(CyhookHandler *hh)
void CmodCache::yCacheClear(CyhookHandler *hh)
{
std::string result="";
- if(hh->ParamList["category"] != "")
+ if(!hh->ParamList["category"].empty())
{
RemoveCategoryFromCache(hh->ParamList["category"]);
result = string_printf("Category (%s) removed from cache.</br>", hh->ParamList["category"].c_str());
}
- else if(hh->ParamList["url"] != "")
+ else if(!hh->ParamList["url"].empty())
{
RemoveURLFromCache(hh->ParamList["url"]);
result = string_printf("URL (%s) removed from cache.</br>", hh->ParamList["url"].c_str());
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_sendfile.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_sendfile.cpp
index c3b53b1..87468f7 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_sendfile.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_sendfile.cpp
@@ -72,7 +72,7 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh)
int filed;
log_level_printf(4,"mod_sendfile prepare hook start url:%s\n",hh->UrlData["fullurl"].c_str());
std::string mime = sendfileTypes[hh->UrlData["fileext"]];
- if(mime != "" || (hh->WebserverConfigList["mod_sendfile.sendAll"] == "true") && hh->UrlData["fileext"] != "yhtm")
+ if(!mime.empty() || (hh->WebserverConfigList["mod_sendfile.sendAll"] == "true") && hh->UrlData["fileext"] != "yhtm")
{
//TODO: Check allowed directories / actually in GetFileName
// build filename
@@ -94,7 +94,7 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh)
// check If-Modified-Since
time_t if_modified_since = (time_t)-1;
- if(hh->HeaderList["If-Modified-Since"] != "")
+ if(!hh->HeaderList["If-Modified-Since"].empty())
{
struct tm mod;
if(strptime(hh->HeaderList["If-Modified-Since"].c_str(), RFC1123FMT, &mod) != NULL)
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_weblog.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_weblog.cpp
index cf27273..63db846 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_weblog.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_weblog.cpp
@@ -67,7 +67,7 @@ THandleStatus CmWebLog::Hook_ReadConfig(CConfigFile *Config, CStringList &/*Conf
//-----------------------------------------------------------------------------
bool CmWebLog::OpenLogFile()
{
- if(WebLogFilename == "")
+ if(WebLogFilename.empty())
return false;
if(WebLogFile == NULL)
{
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_yparser.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_yparser.cpp
index 837e6ad..198eb71 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_yparser.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_yparser.cpp
@@ -52,7 +52,7 @@ CyParser::~CyParser(void)
//-----------------------------------------------------------------------------
void CyParser::init(CyhookHandler *hh)
{
- if(HTML_DIRS[0] == "")
+ if(HTML_DIRS[0].empty())
{
CyParser::HTML_DIRS[0]=hh->WebserverConfigList["PublicDocumentRoot"];
HTML_DIRS[1]=hh->WebserverConfigList["PrivatDocumentRoot"];
@@ -137,7 +137,7 @@ void CyParser::Execute(CyhookHandler *hh)
if(std::string(yCgiCallList[index].mime_type) == "") // set by self
;
else if(std::string(yCgiCallList[index].mime_type) == "+xml") // Parameter xml?
- if (hh->ParamList["xml"] != "")
+ if (!hh->ParamList["xml"].empty())
hh->SetHeader(HTTP_OK, "text/xml");
else
hh->SetHeader(HTTP_OK, "text/plain");
@@ -167,14 +167,14 @@ void CyParser::cgi(CyhookHandler *hh)
if (!hh->ParamList.empty())
{
- if (hh->ParamList["tmpl"] != "") // for GET and POST
+ if (!hh->ParamList["tmpl"].empty()) // for GET and POST
htmlfilename = hh->ParamList["tmpl"];
else
htmlfilename = hh->ParamList["1"];
- if (hh->ParamList["debug"] != "") // switch debug on
+ if (!hh->ParamList["debug"].empty()) // switch debug on
ydebug = true;
- if (hh->ParamList["execute"] != "") // execute done first!
+ if (!hh->ParamList["execute"].empty()) // execute done first!
{
ycmd = hh->ParamList["execute"];
ycmd = YPARSER_ESCAPE_START + ycmd + YPARSER_ESCAPE_END;
@@ -182,7 +182,7 @@ void CyParser::cgi(CyhookHandler *hh)
yresult = cgi_cmd_parsing(hh, ycmd, ydebug); // parsing engine
}
// parsing given file
- if(htmlfilename != "")
+ if (!htmlfilename.empty())
yresult = cgi_file_parsing(hh, htmlfilename, ydebug);
}
else
@@ -243,9 +243,9 @@ void CyParser::ParseAndSendFile(CyhookHandler *hh)
hh->SetHeader(HTTP_OK, "text/html");
if (hh->Method == M_HEAD)
return;
- if (hh->ParamList["debug"] != "") // switch debug on
+ if (!hh->ParamList["debug"].empty()) // switch debug on
ydebug = true;
- if (hh->ParamList["execute"] != "") // execute done first!
+ if (!hh->ParamList["execute"].empty()) // execute done first!
{
ycmd = hh->ParamList["execute"];
ycmd = YPARSER_ESCAPE_START + ycmd + YPARSER_ESCAPE_END;
@@ -382,7 +382,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd)
if(ySplitString(ycmd_name,"~",if_value,if_then))
{
ySplitString(if_then,"~",if_then,if_else);
- yresult = (if_value == "") ? if_then : if_else;
+ yresult = (if_value.empty()) ? if_then : if_else;
}
}
else if(ycmd_type == "if-equal")
@@ -451,7 +451,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd)
{
ySplitString(tmp,";",varname, ydefault);
yresult = YWeb_cgi_get_ini(hh, filename, varname, yaccess);
- if(yresult == "" && ydefault != "")
+ if(yresult.empty() && !ydefault.empty())
yresult = ydefault;
}
else
@@ -525,7 +525,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd)
else
yresult = "ycgi-type unknown";
}
- else if (hh->ParamList[ycmd] != "")
+ else if (!hh->ParamList[ycmd].empty())
{
if((hh->ParamList[ycmd]).find("script") == std::string::npos)
yresult = hh->ParamList[ycmd];
@@ -543,7 +543,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd)
std::string CyParser::YWeb_cgi_get_ini(CyhookHandler */*hh*/, std::string filename, std::string varname, std::string yaccess)
{
std::string result;
- if((yaccess == "open") || (yaccess == ""))
+ if((yaccess == "open") || yaccess.empty())
{
yConfig->clear();
yConfig->loadConfig(filename);
@@ -559,13 +559,13 @@ std::string CyParser::YWeb_cgi_get_ini(CyhookHandler */*hh*/, std::string filen
void CyParser::YWeb_cgi_set_ini(CyhookHandler */*hh*/, std::string filename, std::string varname, std::string varvalue, std::string yaccess)
{
std::string result;
- if((yaccess == "open") || (yaccess == ""))
+ if((yaccess == "open") || yaccess.empty())
{
yConfig->clear();
yConfig->loadConfig(filename);
}
yConfig->setString(varname, varvalue);
- if((yaccess == "save") || (yaccess == ""))
+ if((yaccess == "save") || yaccess.empty())
yConfig->saveConfig(filename);
}
@@ -767,7 +767,7 @@ std::string CyParser::func_do_reload_httpd_config(CyhookHandler */*hh*/, std::s
//-------------------------------------------------------------------------
std::string CyParser::func_change_httpd(CyhookHandler *hh, std::string para)
{
- if(para != "" && access(para.c_str(), 4) == 0)
+ if(!para.empty() && access(para.c_str(), 4) == 0)
{
hh->status = HANDLED_ABORT;
int err = execvp(para.c_str(), NULL); // no return if successful
diff --git a/tuxbox/neutrino/src/driver/rcinput.cpp b/tuxbox/neutrino/src/driver/rcinput.cpp
index eb2c466..4a5b6dc 100644
--- a/tuxbox/neutrino/src/driver/rcinput.cpp
+++ b/tuxbox/neutrino/src/driver/rcinput.cpp
@@ -525,13 +525,13 @@ void CRCInput::load_conf(bool initialize) {
if (keyaction != CRCInput::RC_nokey)
{
if (debug_user_translate) {
- if (data == "")
+ if (data.empty())
printf("[rcinput] Binding %s[%c] -> %s\n", keyword.c_str(), modint2ch(modifier), argument.c_str());
else
printf("[rcinput] Binding %s[%c] -> %s(%s)\n", keyword.c_str(), modint2ch(modifier), action.c_str(), data.c_str());
}
user_translate_table[modifier][keycode] = (neutrino_msg_t) keyaction;
- if (data != "")
+ if (!data.empty())
{
char *data_str = (char *) malloc((data.length()+1)*sizeof(char));
strcpy(data_str, data.c_str());
diff --git a/tuxbox/neutrino/src/gui/epgplus.cpp b/tuxbox/neutrino/src/gui/epgplus.cpp
index 0b3fd63..97eeafc 100644
--- a/tuxbox/neutrino/src/gui/epgplus.cpp
+++ b/tuxbox/neutrino/src/gui/epgplus.cpp
@@ -1622,7 +1622,7 @@ int EpgPlus::MenuTargetAddRecordTimer::exec(CMenuTarget*, const std::string&)
epgPlus->paint();
recDir = recDirs.get_selected_dir();
}
- if (recDir != "" || RECORDING_FILE != g_settings.recording_type)
+ if (!recDir.empty() || RECORDING_FILE != g_settings.recording_type)
{
if (timerdclient.addRecordTimerEvent(epgPlus->selectedChannelEntry->channel->channel_id,
(*It)->channelEvent.startTime,
diff --git a/tuxbox/neutrino/src/gui/epgview.cpp b/tuxbox/neutrino/src/gui/epgview.cpp
index e7ea041..4da1704 100644
--- a/tuxbox/neutrino/src/gui/epgview.cpp
+++ b/tuxbox/neutrino/src/gui/epgview.cpp
@@ -501,7 +501,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
text2 = epgData.title.substr(text1.length()+ 1, uint(-1) );
}
- if (text2!="")
+ if (!text2.empty())
toph = 2* topboxheight;
else
toph = topboxheight;
@@ -740,13 +740,13 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_
recDir = recDirs.get_selected_dir();
}
- if ((recDir == "") && (RECORDING_FILE == g_settings.recording_type))
+ if (recDir.empty() && (RECORDING_FILE == g_settings.recording_type))
{
printf("set zapto timer failed, no record directory...\n");
ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_EPGLIST_ERROR_NO_RECORDDIR_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_ERROR);
}
- if ((recDir != "") || (RECORDING_FILE != g_settings.recording_type))
+ if (!recDir.empty() || (RECORDING_FILE != g_settings.recording_type))
{
if (timerdclient.addRecordTimerEvent(channel_id,
epgData.epg_times.startzeit,
diff --git a/tuxbox/neutrino/src/gui/esound.cpp b/tuxbox/neutrino/src/gui/esound.cpp
index fb3ff09..b2ba48a 100644
--- a/tuxbox/neutrino/src/gui/esound.cpp
+++ b/tuxbox/neutrino/src/gui/esound.cpp
@@ -137,7 +137,7 @@ int CEsoundGui::exec(CMenuTarget* parent, const std::string &)
}
}
- if (tmp == "")
+ if (tmp.empty())
{
printf("[esound.cpp] %s in %s or %s not found, returning...", esound_start_script.c_str(), esound_start_path1.c_str(), esound_start_path2.c_str());
return menu_return::RETURN_EXIT_ALL;
diff --git a/tuxbox/neutrino/src/gui/eventlist.cpp b/tuxbox/neutrino/src/gui/eventlist.cpp
index ec90cd5..fa78f29 100644
--- a/tuxbox/neutrino/src/gui/eventlist.cpp
+++ b/tuxbox/neutrino/src/gui/eventlist.cpp
@@ -419,13 +419,13 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam
recDir = recDirs.get_selected_dir();
}
- if ((recDir == "") && (RECORDING_FILE == g_settings.recording_type))
+ if (recDir.empty() && (RECORDING_FILE == g_settings.recording_type))
{
printf("set zapto timer failed, no record directory...\n");
ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_EPGLIST_ERROR_NO_RECORDDIR_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_ERROR);
}
- if ((recDir != "") || (RECORDING_FILE != g_settings.recording_type))
+ if (!recDir.empty() || (RECORDING_FILE != g_settings.recording_type))
{
// if (Timer.addRecordTimerEvent(channel_id,
if (Timer.addRecordTimerEvent(evtlist[selected].get_channel_id(),
@@ -1175,7 +1175,7 @@ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey)
if(parent != NULL)
parent->hide();
- if(actionkey == "")
+ if(actionkey.empty())
{
res = showMenu();
}
diff --git a/tuxbox/neutrino/src/gui/moviebrowser.cpp b/tuxbox/neutrino/src/gui/moviebrowser.cpp
index 3467f76..1904de3 100644
--- a/tuxbox/neutrino/src/gui/moviebrowser.cpp
+++ b/tuxbox/neutrino/src/gui/moviebrowser.cpp
@@ -1920,7 +1920,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
source = m_movieSelectionHandler->file.Name;
CDirChooser dir(&dest,"/mnt/","/hdd");
dir.exec(NULL,"");
- if(dest != "")
+ if(!dest.empty())
{
dest += "/";
dest += m_movieSelectionHandler->file.getFileName();
@@ -1939,7 +1939,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
source = m_movieSelectionHandler->file.Name;
CDirChooser dir(&dest,"/mnt/","/hdd");
dir.exec(NULL,"");
- if(dest != "")
+ if(!dest.empty())
{
dest += "/";
dest += m_movieSelectionHandler->file.getFileName();
@@ -2507,10 +2507,8 @@ void CMovieBrowser::updateDir(void)
// check if there is a record dir and if we should use it
for(int i = 0; i < MAX_RECORDING_DIR; i++)
{
- if(g_settings.recording_dir[i] != "" )
- {
+ if(!g_settings.recording_dir[i].empty())
addDir(g_settings.recording_dir[i],&m_settings.storageDirRecUsed[i]);
- }
}
for(int i = 0; i < MB_MAX_DIRS; i++)
@@ -3170,7 +3168,7 @@ bool CMovieBrowser::showMenu(MI_MOVIE_INFO* /*movie_info*/)
CMenuOptionChooser* chooserRec[MAX_RECORDING_DIR];
for(i = 0; i < MAX_RECORDING_DIR; i++)
{
- if(g_settings.recording_dir[i] != "" &&
+ if(!g_settings.recording_dir[i].empty() &&
g_settings.recording_dir[i] != g_settings.streaming_moviedir)
{
chooserRec[i] = new CMenuOptionChooser(g_settings.recording_dir[i].c_str() , &m_settings.storageDirRecUsed[i] , MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true);
@@ -3849,7 +3847,7 @@ int CDirMenu::exec(CMenuTarget* parent, const std::string & actionKey)
{
int returnval = menu_return::RETURN_REPAINT;
- if(actionKey == "")
+ if(actionKey.empty())
{
if(parent)
parent->hide();
diff --git a/tuxbox/neutrino/src/gui/movieplayer2.cpp b/tuxbox/neutrino/src/gui/movieplayer2.cpp
index 3951f19..57e5e1d 100644
--- a/tuxbox/neutrino/src/gui/movieplayer2.cpp
+++ b/tuxbox/neutrino/src/gui/movieplayer2.cpp
@@ -2753,7 +2753,7 @@ CMoviePlayerGui::PlayStream(int streamtype)
else if (streamtype == STREAMTYPE_LOCAL)
{
INFO("STREAMTYPE_LOCAL '%s'\n", startfilename.c_str());
- if (startfilename != "")
+ if (!startfilename.empty())
{
CFile file;
struct stat s;
diff --git a/tuxbox/neutrino/src/gui/widget/dirchooser.cpp b/tuxbox/neutrino/src/gui/widget/dirchooser.cpp
index 50a8c65..8582903 100755
--- a/tuxbox/neutrino/src/gui/widget/dirchooser.cpp
+++ b/tuxbox/neutrino/src/gui/widget/dirchooser.cpp
@@ -234,7 +234,7 @@ int CRecDirChooser::exec(CMenuTarget* parent, const std::string & actionKey)
else if (strcmp(key, "dirChooser") == 0)
{
selectedDir = -1;
- if(g_settings.recording_dir[0] != "")
+ if(!g_settings.recording_dir[0].empty())
{
dir = g_settings.recording_dir[0];
}
@@ -248,7 +248,7 @@ int CRecDirChooser::exec(CMenuTarget* parent, const std::string & actionKey)
{
dir = "";
}
- if(dir == "" )
+ if(dir.empty())
{
result = menu_return::RETURN_REPAINT;
}
@@ -257,7 +257,7 @@ int CRecDirChooser::exec(CMenuTarget* parent, const std::string & actionKey)
{
dir = "";
result = CMenuWidget::exec(parent, actionKey);
- if(dir != "")
+ if(!dir.empty())
{
if (localDir)
{
diff --git a/tuxbox/neutrino/src/gui/widget/menue.cpp b/tuxbox/neutrino/src/gui/widget/menue.cpp
index 914a166..8a6cc27 100644
--- a/tuxbox/neutrino/src/gui/widget/menue.cpp
+++ b/tuxbox/neutrino/src/gui/widget/menue.cpp
@@ -1366,7 +1366,7 @@ int CLockedMenuForwarder::exec(CMenuTarget* parent)
int CMenuSelectorTarget::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
{
// printf("CMenuSelector: %s\n", actionKey.c_str());
- if (actionKey != "")
+ if (!actionKey.empty())
*m_select = atoi(actionKey.c_str());
else
*m_select = -1;
diff --git a/tuxbox/neutrino/src/neutrino.cpp b/tuxbox/neutrino/src/neutrino.cpp
index efd383f..93996a5 100644
--- a/tuxbox/neutrino/src/neutrino.cpp
+++ b/tuxbox/neutrino/src/neutrino.cpp
@@ -1756,7 +1756,7 @@ bool CNeutrinoApp::doGuiRecord(char * preselectedDir, bool addTimer, char * file
refreshGui = true;
recDir = recDirs.get_selected_dir();
//printf("dir : %s\n",recDir.c_str());
- if( recDir != "")
+ if (!recDir.empty())
{
int nfs_nr = getNFSIDOfDir(recDir.c_str());
if(nfs_nr != -1)
commit 2ccff82fe9c1f58060487e74c0e29049d848368c
Author: Christian Schuett <Gau...@ho...>
Date: Wed Oct 29 21:14:04 2014 +0100
Neutrino: use empty() instead of length() if possible
Signed-off-by: Christian Schuett <Gau...@ho...>
Signed-off-by: GetAway <get...@t-...>
diff --git a/dvb/zapit/src/controld.cpp b/dvb/zapit/src/controld.cpp
index 96f0c6c..ed64fa2 100644
--- a/dvb/zapit/src/controld.cpp
+++ b/dvb/zapit/src/controld.cpp
@@ -273,7 +273,7 @@ void setup_tv_vcr(tv_vcr_format &v2, std::string &line) {
void setup_scalar(switchvalue &s, std::string &str) {
nuke_leading_whitespace(str);
- if (str.length() > 0) {
+ if (!str.empty()) {
int n;
sscanf(str.c_str(), "%d", &n);
s = (switchvalue) n;
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/yrequest.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/yrequest.cpp
index c4813e1..35de525 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/yrequest.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/yrequest.cpp
@@ -562,7 +562,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne
}
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");
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_sendfile.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_sendfile.cpp
index 07be8b9..c3b53b1 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_sendfile.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_sendfile.cpp
@@ -192,7 +192,7 @@ int CmodSendfile::OpenFile(CyhookHandler */*hh*/, std::string fullfilename)
{
int fd= -1;
std::string tmpstring;
- if(fullfilename.length() > 0)
+ if (!fullfilename.empty())
{
fd = open( fullfilename.c_str(), O_RDONLY );
if (fd<=0)
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_yparser.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_yparser.cpp
index 4f1c9e0..837e6ad 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_yparser.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_mods/mod_yparser.cpp
@@ -187,7 +187,7 @@ void CyParser::cgi(CyhookHandler *hh)
}
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);
@@ -254,7 +254,7 @@ void CyParser::ParseAndSendFile(CyhookHandler *hh)
}
// parsing given file
yresult += cgi_file_parsing(hh, hh->UrlData["filename"], ydebug);
- if (yresult.length()<=0)
+ if (yresult.empty())
hh->SetError(HTTP_NOT_IMPLEMENTED, HANDLED_NOT_IMPLEMENTED);
else
{
@@ -612,7 +612,7 @@ std::string CyParser::YWeb_cgi_include_block(std::string filename, std::string
log_level_printf(6, "include-block: (%s) from file\n", 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;
diff --git a/tuxbox/neutrino/daemons/sectionsd/SIbouquets.hpp b/tuxbox/neutrino/daemons/sectionsd/SIbouquets.hpp
index 42b8414..d3c89a3 100644
--- a/tuxbox/neutrino/daemons/sectionsd/SIbouquets.hpp
+++ b/tuxbox/neutrino/daemons/sectionsd/SIbouquets.hpp
@@ -122,7 +122,7 @@ public:
printf("Transport-Stream-ID: %hu\n", transport_stream_id);
printf("Service-ID: %hu\n", service_id);
printf("Service-Typ: %hhu\n", serviceTyp);
- if(bouquetName.length())
+ if (!bouquetName.empty())
printf("Bouquet-Name: %s\n", bouquetName.c_str());
}
};
diff --git a/tuxbox/neutrino/daemons/sectionsd/SIevents.cpp b/tuxbox/neutrino/daemons/sectionsd/SIevents.cpp
index 15cc153..ff4a644 100644
--- a/tuxbox/neutrino/daemons/sectionsd/SIevents.cpp
+++ b/tuxbox/neutrino/daemons/sectionsd/SIevents.cpp
@@ -162,7 +162,7 @@ int SIevent::saveXML2(FILE *file) const
i = langName.begin() ;
i != langName.end() ;
++i) {
- if (i->second.length()) {
+ if (!i->second.empty()) {
fprintf(file, "\t\t\t<name lang=\"%s\" string=\"", i->first.c_str());
saveStringToXMLfile(file, i->second.c_str());
fprintf(file, "\"/>\n");
@@ -172,18 +172,18 @@ int SIevent::saveXML2(FILE *file) const
i = langText.begin() ;
i != langText.end() ;
++i) {
- if (i->second.length()) {
+ if (!i->second.empty()) {
fprintf(file, "\t\t\t<text lang=\"%s\" string=\"", i->first.c_str());
saveStringToXMLfile(file, i->second.c_str());
fprintf(file, "\"/>\n");
}
}
- if(item.length()) {
+ if (!item.empty()) {
fprintf(file, "\t\t\t<item string=\"");
saveStringToXMLfile(file, item.c_str());
fprintf(file, "\"/>\n");
}
- if(itemDescription.length()) {
+ if (!itemDescription.empty()) {
fprintf(file, "\t\t\t<item_description string=\"");
saveStringToXMLfile(file, itemDescription.c_str());
fprintf(file, "\"/>\n");
@@ -192,7 +192,7 @@ int SIevent::saveXML2(FILE *file) const
i = langExtendedText.begin() ;
i != langExtendedText.end() ;
++i) {
- if (i->second.length()) {
+ if (!i->second.empty()) {
fprintf(file, "\t\t\t<extended_text lang=\"%s\" string=\"", i->first.c_str());
saveStringToXMLfile(file, i->second.c_str());
fprintf(file, "\"/>\n");
@@ -291,9 +291,9 @@ void SIevent::dump(void) const
if (service_id)
printf("Service-ID: %hu\n", service_id);
printf("Event-ID: %hu\n", eventID);
- if(item.length())
+ if (!item.empty())
printf("Item: %s\n", item.c_str());
- if(itemDescription.length())
+ if (!itemDescription.empty())
printf("Item-Description: %s\n", itemDescription.c_str());
for (std::map<std::string, std::string>::const_iterator it = langName.begin() ;
@@ -306,13 +306,13 @@ void SIevent::dump(void) const
it != langEx...
[truncated message content] |