forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParserHelper.cs
38 lines (30 loc) · 1003 Bytes
/
ParserHelper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using NHibernate.SqlCommand;
namespace NHibernate.Hql
{
public static class ParserHelper
{
public const string HqlVariablePrefix = ":";
public const string HqlSeparators = " \n\r\f\t,()=<>&|+-=/*'^![]#~\\;";
internal static readonly char[] HqlSeparatorsAsCharArray = HqlSeparators.ToCharArray();
//NOTICE: no " or . since they are part of (compound) identifiers
public const string Whitespace = " \n\r\f\t";
public const string EntityClass = "class";
public static bool IsWhitespace(string str)
{
return Whitespace.IndexOf(str, StringComparison.Ordinal) > - 1;
}
internal static bool HasHqlVariable(string value)
{
return value.IndexOf(HqlVariablePrefix, StringComparison.Ordinal) >= 0;
}
internal static bool HasHqlVariable(SqlString value)
{
return value.IndexOfOrdinal(HqlVariablePrefix) >= 0;
}
internal static bool IsHqlVariable(string value)
{
return value.StartsWith(HqlVariablePrefix, StringComparison.Ordinal);
}
}
}