Loading...
Searching...
No Matches
Data printer flags
Trees » Data Tree
Collaboration diagram for Data printer flags:

## Macros

#define | LYD_PRINT_KEEPEMPTYCONT 0x04
#define | LYD_PRINT_SHRINK LY_PRINT_SHRINK
#define | LYD_PRINT_WD_ALL 0x20
#define | LYD_PRINT_WD_ALL_TAG 0x40
#define | LYD_PRINT_WD_EXPLICIT 0x00
#define | LYD_PRINT_WD_IMPL_TAG 0x80
#define | LYD_PRINT_WD_MASK 0xF0
#define | LYD_PRINT_WD_TRIM 0x10
#define | LYD_PRINT_WITHSIBLINGS 0x01

## Detailed Description

Options to change default behavior of the data printers.

## Macro Definition Documentation

## LYD_PRINT_KEEPEMPTYCONT

#define LYD_PRINT_KEEPEMPTYCONT 0x04

Preserve empty non-presence containers

Definition at line 81 of file printer_data.h.

## LYD_PRINT_SHRINK

#define LYD_PRINT_SHRINK LY_PRINT_SHRINK

Flag for output without indentation and formatting new lines.

Definition at line 80 of file printer_data.h.

## LYD_PRINT_WD_ALL

#define LYD_PRINT_WD_ALL 0x20

With this option, all the nodes are printed as none of them are considered default

Definition at line 89 of file printer_data.h.

## LYD_PRINT_WD_ALL_TAG

#define LYD_PRINT_WD_ALL_TAG 0x40

Same as LYD_PRINT_WD_ALL but also adds attribute 'default' with value 'true' to all nodes that has its default value. The 'default' attribute has namespace: urn:ietf:params:xml:ns:netconf:default:1.0 and thus the attributes are printed only when the ietf-netconf-with-defaults module is present in libyang context (but in that case this namespace is always printed).

Definition at line 91 of file printer_data.h.

## LYD_PRINT_WD_EXPLICIT

#define LYD_PRINT_WD_EXPLICIT 0x00

Explicit with-defaults mode. Only the data explicitly being present in the data tree are printed, so the implicitly added default nodes are not printed. Note that this is the default value when no WD option is specified.

Definition at line 83 of file printer_data.h.

## LYD_PRINT_WD_IMPL_TAG

#define LYD_PRINT_WD_IMPL_TAG 0x80

Same as LYD_PRINT_WD_ALL_TAG but the attributes are added only to the nodes that are not explicitly present in the original data tree despite their value is equal to their default value. There is the same limitation regarding the presence of ietf-netconf-with-defaults module in libyang context.

Definition at line 96 of file printer_data.h.

## LYD_PRINT_WD_MASK

#define LYD_PRINT_WD_MASK 0xF0

Mask for with-defaults modes

Definition at line 82 of file printer_data.h.

## LYD_PRINT_WD_TRIM

#define LYD_PRINT_WD_TRIM 0x10

Trim mode avoids printing the nodes with the value equal to their default value

Definition at line 87 of file printer_data.h.

## LYD_PRINT_WITHSIBLINGS

#define LYD_PRINT_WITHSIBLINGS 0x01

Flag for printing also the (following) sibling nodes of the data node. The flag is not allowed for lyd_print_all() and lyd_print_tree().

Definition at line 78 of file printer_data.h.