Utils

ndn.schema.util.NamePattern

NamePattern is a list containing mixed name components and varaible patterns. A variable pattern is a capturing pattern that matches with exactly one name component. It is a tuple containing 3 variables:

  • The 1st element is reserved and always 0. This is a quick and dirty solution in this PoC implementation It will be used if we want to support multiple name components matching patterns.

  • The 2nd element is the TLV type of the name component to be matched.

  • The 3rd element is the name of the pattern variable.

alias of List[Union[bytes, bytearray, memoryview, Tuple[int, int, str]]]

ndn.schema.util.norm_pattern(name)

This function returns a normalized name pattern from a string, just like normalizing a name.

Parameters

name (str) – the name pattern string.

Return type

List[Union[bytes, bytearray, memoryview, Tuple[int, int, str]]]

Returns

normalized name pattern.