Skip to navigation

holoscan::config::Path

Beta
View as Markdown

Own an RFC 6901 JSON Pointer path.

Paths copy and validate every token. They are independent of the source text and safe for concurrent reads after construction.

#include <holoscan/config/document.hpp>

Methods

token_count

std::size_t holoscan::config::Path::token_count() const noexcept

Return the number of decoded tokens.

token

std::string_view holoscan::config::Path::token(
std::size_t index
) const noexcept

Borrow one decoded token.

Returns: The token, or an empty view when index is out of range.

Parameters

index
std::size_t

Zero-based token index.

to_string

std::string holoscan::config::Path::to_string() const

Render the path with RFC 6901 escaping.

Returns: Newly allocated pointer text; the root renders as an empty string.

is_root

bool holoscan::config::Path::is_root() const noexcept

Return whether this path addresses the document root.


Static methods

parse

static Path holoscan::config::Path::parse(
std::string_view text
)

Parse and own an RFC 6901 JSON Pointer.

Returns: The owned path.

Throws: ConfigException with CONFIG_PATH_SYNTAX, CONFIG_INVALID_UTF8, or CONFIG_LIMIT_EXCEEDED on failure.

Parameters

text
std::string_view

Empty root text or slash-prefixed UTF-8 pointer text.

See also: try_parse

try_parse

static ConfigResult<Path> holoscan::config::Path::try_parse(
std::string_view text
)

Try to parse and own an RFC 6901 JSON Pointer.

Returns: The owned path or CONFIG_PATH_SYNTAX/CONFIG_INVALID_UTF8/ CONFIG_LIMIT_EXCEEDED.

Parameters

text
std::string_view

Empty root text or slash-prefixed UTF-8 pointer text.

See also: parse

root

static Path holoscan::config::Path::root() noexcept

Create the empty root path without allocating.


Member variables

NameTypeDescription
tokens_std::vector< std::string >