added: parameters consist of a name and a value now
sample: /dir/dir2/function/paramname:paramvalue removed: TemplatesMisc namespace git-svn-id: svn://ttmath.org/publicrep/winix/trunk@618 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -117,19 +117,49 @@ void FunctionParser::ParseFunction()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FunctionParser::ParseParams(const std::string & par)
|
||||
{
|
||||
Param param;
|
||||
size_t i;
|
||||
|
||||
if( par.empty() )
|
||||
return;
|
||||
|
||||
// looking for the first colon ':'
|
||||
for(i=0 ; i<par.size() && par[i] != ':' ; ++i);
|
||||
|
||||
if( i == par.size() )
|
||||
{
|
||||
// there is no a colon
|
||||
param.name = par;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( i > 0 )
|
||||
param.name = par.substr(0, i);
|
||||
|
||||
if( i < par.size() - 1 )
|
||||
param.value = par.substr(i+1);
|
||||
}
|
||||
|
||||
request.param_table.push_back(param);
|
||||
|
||||
log << log3 << "FP: Param: name=" << param.name << ", value=" << param.value << logend;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FunctionParser::ParseParams()
|
||||
{
|
||||
while( true )
|
||||
for( ; true ; ++get_index )
|
||||
{
|
||||
SkipEmptyString("FP: Params: skipped empty string");
|
||||
|
||||
if( get_index == get_table_len )
|
||||
break;
|
||||
|
||||
request.param_table.push_back( &request.get_table[get_index] );
|
||||
log << log3 << "FP: Params: " << request.get_table[get_index] << logend;
|
||||
|
||||
++get_index;
|
||||
ParseParams(request.get_table[get_index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user