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:
2010-07-04 20:27:14 +00:00
parent 76e32703ac
commit 50cb88c5ed
17 changed files with 150 additions and 51 deletions

View File

@@ -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]);
}
}