class BootProperties
Defined at line 22 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
Public Methods
void BootProperties (std::string_view cmdline, linux_boot_config::LinuxBootConfig bootconfig)
Defined at line 24 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
void BootProperties (std::string_view cmdline, linux_boot_config::LinuxBootConfig bootconfig)
Defined at line 24 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
template <auto&&... keys>
std::array<std::optional<std::string_view>, sizeof...(keys)> GetProperties (std::convertible_to<std::string_view> auto &&... keys)
Extract multiple properties at once. This is not only a shorthand for
calling GetProperty N times conveniently, but is more efficient. e.g.
```
auto [a, b, c] = bp.GetProperties("a", "b", "c");
if (a) { ... }
if (b) { ... }
if (c) { ... }
```
Defined at line 40 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
template <auto&&... keys>
std::array<std::optional<std::string_view>, sizeof...(keys)> GetProperties (std::convertible_to<std::string_view> auto &&... keys)
Extract multiple properties at once. This is not only a shorthand for
calling GetProperty N times conveniently, but is more efficient. e.g.
```
auto [a, b, c] = bp.GetProperties("a", "b", "c");
if (a) { ... }
if (b) { ... }
if (c) { ... }
```
Defined at line 40 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
template <auto&&... keys>
std::array<std::optional<std::string_view>, sizeof...(keys)> GetProperties (std::convertible_to<std::string_view> auto &&... keys)
Extract multiple properties at once. This is not only a shorthand for
calling GetProperty N times conveniently, but is more efficient. e.g.
```
auto [a, b, c] = bp.GetProperties("a", "b", "c");
if (a) { ... }
if (b) { ... }
if (c) { ... }
```
Defined at line 40 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
template <auto&&... keys>
std::array<std::optional<std::string_view>, sizeof...(keys)> GetProperties (std::convertible_to<std::string_view> auto &&... keys)
Extract multiple properties at once. This is not only a shorthand for
calling GetProperty N times conveniently, but is more efficient. e.g.
```
auto [a, b, c] = bp.GetProperties("a", "b", "c");
if (a) { ... }
if (b) { ... }
if (c) { ... }
```
Defined at line 40 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
template <auto&&... keys>
std::array<std::string_view, sizeof...(keys)> GetPropertiesOrEmpty (std::convertible_to<std::string_view> auto &&... keys)
This is the same, except it yields for each key just a std::string_view
that's "" for a missing property, not std::optional
<std
::string_view> that
distinguishes std::nullopt (missing) from "" (present with empty value).
Defined at line 52 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
template <auto&&... keys>
std::array<std::string_view, sizeof...(keys)> GetPropertiesOrEmpty (std::convertible_to<std::string_view> auto &&... keys)
This is the same, except it yields for each key just a std::string_view
that's "" for a missing property, not std::optional
<std
::string_view> that
distinguishes std::nullopt (missing) from "" (present with empty value).
Defined at line 52 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
template <auto&&... keys>
std::array<std::string_view, sizeof...(keys)> GetPropertiesOrEmpty (std::convertible_to<std::string_view> auto &&... keys)
This is the same, except it yields for each key just a std::string_view
that's "" for a missing property, not std::optional
<std
::string_view> that
distinguishes std::nullopt (missing) from "" (present with empty value).
Defined at line 52 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
template <auto&&... keys>
std::array<std::string_view, sizeof...(keys)> GetPropertiesOrEmpty (std::convertible_to<std::string_view> auto &&... keys)
This is the same, except it yields for each key just a std::string_view
that's "" for a missing property, not std::optional
<std
::string_view> that
distinguishes std::nullopt (missing) from "" (present with empty value).
Defined at line 52 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
template <auto&& cb>
void EnumerateProperty (std::string_view key, auto && cb)
Invokes a callback for all matching property definitions/appends for a key.
BootConfig is small enough that it's worthwhile to parse the entirety for
each key we care about to keep the API for each given item
straightforward. We could refactor this to scan once, but the ergonomics
change to Item classes wouldn't be worth it.
Defined at line 78 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
template <auto&& cb>
void EnumerateProperty (std::string_view key, auto && cb)
Invokes a callback for all matching property definitions/appends for a key.
BootConfig is small enough that it's worthwhile to parse the entirety for
each key we care about to keep the API for each given item
straightforward. We could refactor this to scan once, but the ergonomics
change to Item classes wouldn't be worth it.
Defined at line 78 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/boot-properties.h
zx::result<std::string_view> GetProperty (std::string_view key)
Extracts a property value (e.g. "kernel.param", "driver.option").
Precedence: Bootconfig first, then command line.
Defined at line 94 of file ../../zircon/kernel/phys/lib/boot-shim/boot-properties.cc
zx::result<std::string_view> GetProperty (std::string_view key)
Extracts a property value (e.g. "kernel.param", "driver.option").
Precedence: Bootconfig first, then command line.
Defined at line 94 of file ../../zircon/kernel/phys/lib/boot-shim/boot-properties.cc
zx::result<std::string_view> JoinProperty (std::string_view key, std::span<char> buffer)
Joins all values of a property with ',' into buffer and returns a view of
the result. Precedence is the same as GetProperty(), and a define or
override resets the value.
BootConfig may contain unquoted values like "key:=a,b,c", which BootConfig
syntax parses as an array of values. Joining the elements recovers the full
value ("a,b,c").
Values that do not fit in buffer are truncated.
Defined at line 118 of file ../../zircon/kernel/phys/lib/boot-shim/boot-properties.cc
zx::result<std::string_view> JoinProperty (std::string_view key, std::span<char> buffer)
Joins all values of a property with ',' into buffer and returns a view of
the result. Precedence is the same as GetProperty(), and a define or
override resets the value.
BootConfig may contain unquoted values like "key:=a,b,c", which BootConfig
syntax parses as an array of values. Joining the elements recovers the full
value ("a,b,c").
Values that do not fit in buffer are truncated.
Defined at line 118 of file ../../zircon/kernel/phys/lib/boot-shim/boot-properties.cc
zx::result<std::string_view> JoinProperty (std::string_view key, std::span<char> buffer)
Joins all values of a property with ',' into buffer and returns a view of
the result. Precedence is the same as GetProperty(), and a define or
override resets the value.
BootConfig may contain unquoted values like "key:=a,b,c", which BootConfig
syntax parses as an array of values. Joining the elements recovers the full
value ("a,b,c").
Values that do not fit in buffer are truncated.
Defined at line 118 of file ../../zircon/kernel/phys/lib/boot-shim/boot-properties.cc
zx::result<std::string_view> JoinProperty (std::string_view key, std::span<char> buffer)
Joins all values of a property with ',' into buffer and returns a view of
the result. Precedence is the same as GetProperty(), and a define or
override resets the value.
BootConfig may contain unquoted values like "key:=a,b,c", which BootConfig
syntax parses as an array of values. Joining the elements recovers the full
value ("a,b,c").
Values that do not fit in buffer are truncated.
Defined at line 118 of file ../../zircon/kernel/phys/lib/boot-shim/boot-properties.cc