mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-28 02:37:40 +00:00
36 lines
901 B
C#
36 lines
901 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
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();
|
|
}
|
|
}
|
|
}
|