| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.diagnostics; |
| |
| enum PatternMatcher { |
| WILDCARD = 0; |
| GLOB = 1; |
| }; |
| |
| /// The set of states that a selection node can exist in. A selection-node |
| /// is a matcher of a container in a nested hierarchy, such as |
| /// a match of nested components at a location in the component hierarchy |
| /// or a match of nodes in an Inspect tree. |
| /// |
| /// string_pattern: This is a provided string that defines a pattern to |
| /// match against at the current location in a nested hierarchy. The |
| /// parser treats wildcards (*) and backslashes (\) as special characters. |
| /// If you wish to match against literal wildcards, it must be escaped. |
| /// If you wish to match against literal backslashes, they must be escaped. |
| /// |
| /// eg: <curr_node>/abc will match any node contained within curr_node |
| /// with the exact name "abc". |
| /// eg: <curr_node>/a\* will match any node contained within curr_node |
| /// with the exact name "a*". |
| /// eg: <curr_node>/a\\* will match any node contained within curr_node |
| /// that starts with exactly "a\". |
| /// eg: <curr_node>/a* will match any node contained within curr_node |
| /// that starts with "a". |
| /// eg: <curr_node>/a*b will match any node contained within curr_node |
| /// that starts with a and ends with b. |
| /// eg: <curr_node>/*b will match any node contained within curr_node |
| /// that ends with b. |
| /// |
| /// pattern_matcher: This is either a wild-card or a glob. |
| /// |
| /// wildcard: will match all nodes at the current location in the |
| /// component hierarchy. These PathSelectionNode types are a result of the |
| /// only text provided in the selector-node spot being an escaped star. |
| /// |
| /// glob: will match all nodes at or below the current location in the |
| /// component hierarchy. These PathSelectionNode types are a result of |
| /// the only text provided in the selector-node spot being two escaped stars. |
| xunion PathSelectionNode { |
| string:1024 string_pattern; |
| PatternMatcher pattern_matcher; |
| }; |
| |
| /// ComponentSelector encodes path to a component that is being selected for. |
| /// The `component_moniker` specifies a pattern of component absolute monikers which |
| /// identify components being selected for. |
| table ComponentSelector { |
| /// Vector encoding the absolute moniker of a component being selected for. |
| /// |
| /// There must be at least one path selection node provided, which |
| /// specifies the component names that are matched by |
| /// the current selector. With only the component name |
| /// present, we treat the `component_moniker` as selecting for all monikers |
| /// that end in the specified name. |
| 1: vector<PathSelectionNode>:1024 component_moniker; |
| }; |