forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryEngineUtils.cs
More file actions
27 lines (23 loc) · 831 Bytes
/
Copy pathQueryEngineUtils.cs
File metadata and controls
27 lines (23 loc) · 831 Bytes
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
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System.Collections.Generic;
namespace UnityEditor.Search
{
static class QueryEngineUtils
{
static readonly HashSet<char> k_WhiteSpaceChars = new HashSet<char>(" \f\n\r\t\v");
public static bool IsNestedQueryToken(in StringView token)
{
if (token.length < 2)
return false;
var startIndex = token.IndexOf('{');
var endIndex = token.LastIndexOf('}');
return startIndex != -1 && endIndex == token.length - 1 && startIndex < endIndex;
}
public static bool IsWhiteSpaceChar(char c)
{
return k_WhiteSpaceChars.Contains(c);
}
}
}