protected CharMatchBase(CharMatchBase previous) { if (previous != null) { previous.Next = this; } }
public static bool Match(string queue, string key) { var queueParts = queue.Split('.'); CharMatchBase previous = null; IMatchChar first = null; for (int i = 0; i < queueParts.Length; i++) { switch (queueParts[i]) { case "*": previous = new StarMatch(previous); break; case "#": previous = new HashMatch(previous); break; default: previous = new CharMatch(previous, queueParts[i]); break; } if (i == 0) { first = previous; } } var keyParts = new LinkedList <string>(key.Split('.')); if (first == null) { return(false); } first.Consume(keyParts); return(first.MatchValues.All(x => x)); }
public StarMatch(CharMatchBase previous) : base(previous) { }
public HashMatch(CharMatchBase previous) : base(previous) { }
public CharMatch(CharMatchBase previous, string keyPart) : base(previous) { this.keyPart = keyPart; }