Initial
This commit is contained in:
30
watchdog/CreateServiceParams.cpp
Normal file
30
watchdog/CreateServiceParams.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <watchdog/CreateServiceParams.hpp>
|
||||
|
||||
bool CreateServiceParams::getNullSeparatedDependencies(Array<char> &dependencies)
|
||||
{
|
||||
String strDepCopy;
|
||||
char *pString=0;
|
||||
char *pDest=0;
|
||||
|
||||
if(mDependencies.isNull())return false;
|
||||
dependencies.size(1024);
|
||||
::memset(&dependencies[0],0,dependencies.size());
|
||||
strDepCopy=mDependencies;
|
||||
pString=strDepCopy;
|
||||
pDest=&dependencies[0];
|
||||
pString=::strtok(pString,";,\0");
|
||||
if(0==pString)return false;
|
||||
::strcpy(pDest,pString);
|
||||
pDest+=::strlen(pString);
|
||||
while(true)
|
||||
{
|
||||
pString=::strtok(0,";,\0");
|
||||
if(0==pString)break;
|
||||
*(pDest++)='\0';
|
||||
::strcpy(pDest,pString);
|
||||
pDest+=::strlen(pString);
|
||||
}
|
||||
*(pDest++)=0;
|
||||
*(pDest++)=0;
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user