move findFilter usage out of mh_exec

This commit is contained in:
dockes 2006-12-13 09:13:18 +00:00
parent c46d673475
commit 4141db6d50
4 changed files with 21 additions and 16 deletions

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.34 2006-12-11 14:50:53 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.35 2006-12-13 09:13:18 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@ -389,10 +389,14 @@ bool RclConfig::getUncompressor(const string &mtype, list<string>& cmd)
LOGERR(("getUncompressor: empty spec for mtype %s\n", mtype.c_str()));
return false;
}
if (stringlowercmp("uncompress", tokens.front()))
return false;
list<string>::iterator it = tokens.begin();
cmd.assign(++it, tokens.end());
if (tokens.size() < 2)
return false;
if (stringlowercmp("uncompress", *it++))
return false;
cmd.clear();
cmd.push_back(findFilter(*it++));
cmd.insert(cmd.end(), it, tokens.end());
return true;
}

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: internfile.cpp,v 1.17 2006-11-10 13:29:39 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: internfile.cpp,v 1.18 2006-12-13 09:13:18 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@ -49,7 +49,7 @@ static bool uncompressfile(RclConfig *conf, const string& ifn,
LOGERR(("uncompressfile: can't clear temp dir %s\n", tdir.c_str()));
return false;
}
string cmd = conf->findFilter(cmdv.front());
string cmd = cmdv.front();
// Substitute file name and temp dir in command elements
list<string>::const_iterator it = cmdv.begin();

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: mh_exec.cpp,v 1.6 2006-01-26 17:59:50 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: mh_exec.cpp,v 1.7 2006-12-13 09:13:18 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@ -47,8 +47,9 @@ MimeHandlerExec::mkDoc(RclConfig *conf, const string &fn,
mtype.c_str()));
return MimeHandler::MHError;
}
// Command name
string cmd = conf->findFilter(params.front());
string cmd = params.front();
// Build parameter list: delete cmd name and add the file name
list<string>::iterator it = params.begin();

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: mimehandler.cpp,v 1.18 2006-03-29 13:08:08 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: mimehandler.cpp,v 1.19 2006-12-13 09:13:18 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@ -68,20 +68,20 @@ MimeHandler *getMimeHandler(const string &mtype, RclConfig *cfg)
}
// Retrieve handler function according to type
if (!stringlowercmp("internal", toks.front())) {
list<string>::iterator it = toks.begin();
if (!stringlowercmp("internal", *it)) {
return mhFactory(mtype);
} else if (!stringlowercmp("dll", toks.front())) {
} else if (!stringlowercmp("exec", toks.front())) {
} else if (!stringlowercmp("dll", *it)) {
} else if (!stringlowercmp("exec", *it)) {
if (toks.size() < 2) {
LOGERR(("getMimeHandler: bad line for %s: %s\n",
mtype.c_str(), hs.c_str()));
return 0;
}
MimeHandlerExec *h = new MimeHandlerExec;
list<string>::const_iterator it1 = toks.begin();
it1++;
for (;it1 != toks.end();it1++)
h->params.push_back(*it1);
it++;
h->params.push_back(cfg->findFilter(*it++));
h->params.insert(h->params.end(), it, toks.end());
return h;
}
}