convert most char[...] configuration values to std::string

Signed-off-by: Jacek Jendrzej <crashdvb@googlemail.com>
This commit is contained in:
martii
2013-06-11 13:32:19 +02:00
committed by Jacek Jendrzej
parent fce161b70b
commit cbc9299df8
40 changed files with 483 additions and 470 deletions

View File

@@ -566,9 +566,11 @@ void CDateInput::onAfterExec()
}
//-----------------------------#################################-------------------------------------------------------
CMACInput::CMACInput(const neutrino_locale_t Name, char* Value, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ)
: CExtendedInput(Name, Value, Hint_1, Hint_2, Observ)
CMACInput::CMACInput(const neutrino_locale_t Name, std::string &
Value, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ)
: CExtendedInput(Name, MAC, Hint_1, Hint_2, Observ)
{
mac = &Value;
frameBuffer = CFrameBuffer::getInstance();
addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") );
addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") );
@@ -600,7 +602,7 @@ void CMACInput::onBeforeExec()
return;
}
int _mac[6];
sscanf( value, "%x:%x:%x:%x:%x:%x", &_mac[0], &_mac[1], &_mac[2], &_mac[3], &_mac[4], &_mac[5] );
sscanf( mac->c_str(), "%x:%x:%x:%x:%x:%x", &_mac[0], &_mac[1], &_mac[2], &_mac[3], &_mac[4], &_mac[5] );
sprintf( value, "%02x:%02x:%02x:%02x:%02x:%02x", _mac[0], _mac[1], _mac[2], _mac[3], _mac[4], _mac[5]);
}
@@ -610,7 +612,11 @@ void CMACInput::onAfterExec()
sscanf( value, "%x:%x:%x:%x:%x:%x", &_mac[0], &_mac[1], &_mac[2], &_mac[3], &_mac[4], &_mac[5] );
sprintf( value, "%02x:%02x:%02x:%02x:%02x:%02x", _mac[0], _mac[1], _mac[2], _mac[3], _mac[4], _mac[5]);
if(strcmp(value,"00:00:00:00:00:00")==0)
value[0] = 0; /* strcpy(value, ""); */
{
(*mac) = "";
}
else
(*mac) = value;
}
//-----------------------------#################################-------------------------------------------------------