MatchGlob.webidl (856B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 /** 6 * Represents a simple glob pattern matcher. Any occurrence of "*" in the glob 7 * pattern matches any literal string of characters in the string being 8 * compared. Additionally, if created with `allowQuestion = true`, any 9 * occurrence of "?" in the glob matches any single literal character. 10 */ 11 [ChromeOnly, Exposed=Window] 12 interface MatchGlob { 13 [Throws] 14 constructor(UTF8String glob, optional boolean allowQuestion = true); 15 16 /** 17 * Returns true if the string matches the glob. 18 */ 19 boolean matches(UTF8String string); 20 21 /** 22 * The glob string this MatchGlob represents. 23 */ 24 [Constant] 25 readonly attribute UTF8String glob; 26 };