2013-01-18 15:55:50 +00:00
|
|
|
using System.Text;
|
|
|
|
|
2014-01-08 14:16:39 +00:00
|
|
|
namespace AsterNET.FastAGI.Command
|
2013-01-18 15:55:50 +00:00
|
|
|
{
|
|
|
|
public abstract class AGICommand
|
|
|
|
{
|
|
|
|
public abstract string BuildCommand();
|
|
|
|
|
|
|
|
protected internal string EscapeAndQuote(string s)
|
|
|
|
{
|
|
|
|
string tmp;
|
|
|
|
if (s == null)
|
|
|
|
return "\"\"";
|
|
|
|
|
|
|
|
tmp = s;
|
|
|
|
tmp = tmp.Replace("\\\"", "\\\\\""); // escape quotes
|
|
|
|
tmp = tmp.Replace("\\\n", ""); // filter newline
|
|
|
|
return "\"" + tmp + "\""; // add quotes
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
return Helper.ToString(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|