class Key

Defined at line 107 of file ../../zircon/kernel/phys/lib/linux-boot-config/include/lib/linux-boot-config/linux-boot-config.h

BootConfig provides a hierarchical declaration syntax for keys:

```

foo.bar {

baz.fooz {

....

}

}

```

Each Node in the path, is a step taken into a nested scope. In order to resolve

a key, the entire path must be taken into account. Elements in the path are joined by '.'.

When a node is visited, it is provided the current path, through this means visitors/observer

patterns may skip entire subtrees.

Public Methods

bool start_of (std::string_view key)

The key parts in `key` form a key prefix of this.

E.g.:

```

Key key = ["foo.bar"]

a.prefix_of("foo.bar.baz") is true.

```

Defined at line 160 of file ../../zircon/kernel/phys/lib/linux-boot-config/include/lib/linux-boot-config/linux-boot-config.h

bool starts_with (std::string_view key)

The key parts in this form a key prefix of `key`.

E.g.:

```

Key key = ["foo.bar"]

a.starts_with("foo") is true.

```

Defined at line 169 of file ../../zircon/kernel/phys/lib/linux-boot-config/include/lib/linux-boot-config/linux-boot-config.h

bool operator== (std::string_view key)

Defined at line 171 of file ../../zircon/kernel/phys/lib/linux-boot-config/include/lib/linux-boot-config/linux-boot-config.h

CompareResult Compare (std::string_view key)

Returns the relationship between the `ley` and the path to the current.

Defined at line 337 of file ../../zircon/kernel/phys/lib/linux-boot-config/linux-boot-config.cc

Enumerations

enum class CompareResult : uint8_t
Name Value Comments
kParent 0

The 'key' is a child of this path

```
// Assume Key = ['foo.bar', 'baz']
assert(path.Compare("foo.bar.baz.fooz") == CompareResult::kDescendant)
```

kChild 1

The 'key' is a parent of this path.

```
// Assume Key = ['foo.bar', 'baz']
assert(path.Compare("foo.bar") == CompareResult::kAncestor)
```

kMatch 2

The 'key' is a child of this path.

```
// Assume Key = ['foo.bar', 'baz']
assert(path.Compare("foo.bar.baz") == CompareResult::kMatch)
```

kNoMatch 3

The 'key' is not related to this path.

```
// Assume Key = ['foo.bar', 'baz']
assert(path.Compare("foo.baz") == CompareResult::kNoMatch)
```

Result information obtained when comparing abn arbitrary key in string form against a Key.

Caller then may take actions based on this.

A Key can be thought of a collection of string joined by '.'. We will call each of the elements

in this collection as a section of a key. The unit of comparison is per section.For example,

guven two keys a("foo.bar") and b("foo.barz"), even though a is a prefix of b, since the

sections 'bar' and 'barz' do not match, the result is considered `kNoMatch`.

Defined at line 116 of file ../../zircon/kernel/phys/lib/linux-boot-config/include/lib/linux-boot-config/linux-boot-config.h