1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-27 18:28:19 +00:00
Sonarr/Marr.Data/QGen/Dialects/OracleDialect.cs
2013-07-18 20:47:55 -07:00

35 lines
867 B
C#

using System;
using System.Linq;
using System.Text;
namespace Marr.Data.QGen.Dialects
{
public class OracleDialect : Dialect
{
public override string CreateToken(string token)
{
if (string.IsNullOrEmpty(token))
{
return string.Empty;
}
string[] parts = token.Replace('[', new Char()).Replace(']', new Char()).Split('.');
StringBuilder sb = new StringBuilder();
foreach (string part in parts)
{
if (sb.Length > 0)
sb.Append(".");
bool hasSpaces = part.Contains(' ');
if (hasSpaces)
sb.Append("[").Append(part).Append("]");
else
sb.Append(part);
}
return sb.ToString();
}
}
}