asternet/Asterisk.2013/Asterisk.NET/FastAGI/Command/AGICommand.cs
2014-01-08 14:16:39 +00:00

27 lines
531 B
C#

using System.Text;
namespace AsterNET.FastAGI.Command
{
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);
}
}
}