#include <boost/optional.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/format.hpp>
+#include <boost/algorithm/string.hpp>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "logger.hh"
#include "dnsparser.hh"
+#include "arguments.hh"
#ifndef WIN32
#include <sys/resource.h>
#include <sys/time.h>
return ret;
}
+template<typename T>
+string doGetParameter(T begin, T end)
+{
+ string ret;
+ string parm;
+ for(T i=begin; i != end; ++i) {
+ if(::arg().parmIsset(*i)) {
+ parm=::arg()[*i];
+ replace_all(parm, "\\", "\\\\");
+ replace_all(parm, "\"", "\\\"");
+ replace_all(parm, "\n", "\\n");
+ ret += *i +"=\""+ parm +"\"\n";
+ }
+ else
+ ret += *i +" not known\n";
+ }
+ return ret;
+}
+
+
template<typename T>
string doDumpCache(T begin, T end)
{
if(cmd=="get")
return doGet(begin, end);
+ if(cmd=="get-parameter")
+ return doGetParameter(begin, end);
+
+
if(cmd=="quit") {
*command=&doExit;
return "bye\n";