|
YATL
|
Functions for querying span content and properties. More...
Functions | |
| const char * | YATL_span_type_name (YATL_SpanType_t type) |
| Get the string name of a span type. | |
| YATL_Result_t | YATL_span_keyval_slice (const YATL_Span_t *in_span, YATL_Span_t *key, YATL_Span_t *val) |
| Slice a key-value span into separate key and value spans. | |
| YATL_SpanType_t | YATL_span_type (const YATL_Span_t *span) |
| Get the type of a span. | |
| YATL_Result_t | YATL_span_text (const YATL_Span_t *in_span, const char **out_text, size_t *out_len) |
| Get text content of a single-line span. | |
| YATL_Result_t | YATL_span_get_string (const YATL_Span_t *in_span, const char *key, const char **out_text, size_t *out_len) |
| Convenience function to find a key and get its string value. | |
Functions for querying span content and properties.
| YATL_Result_t YATL_span_get_string | ( | const YATL_Span_t * | in_span, |
| const char * | key, | ||
| const char ** | out_text, | ||
| size_t * | out_len ) |
Convenience function to find a key and get its string value.
Combines YATL_span_find_name(), YATL_span_keyval_slice(), and YATL_span_text() into a single call for simple key-value lookups.
| in_span | Span to search within |
| key | Key name to find |
| out_text | Output pointer to value text (not null-terminated) |
| out_len | Output length of value text |
| YATL_Result_t YATL_span_keyval_slice | ( | const YATL_Span_t * | in_span, |
| YATL_Span_t * | key, | ||
| YATL_Span_t * | val ) |
Slice a key-value span into separate key and value spans.
Given a span of type YATL_S_LEAF_KEYVAL, extracts the key and value as separate spans.
| in_span | Input key-value span (must be YATL_S_LEAF_KEYVAL type) |
| key | Output span for the key portion |
| val | Output span for the value portion. The span type is set according to the value type (e.g., YATL_S_NODE_ARRAY for arrays, YATL_S_NODE_INLINE_TABLE for inline tables). For string values, the span text excludes quote delimiters. |
| YATL_Result_t YATL_span_text | ( | const YATL_Span_t * | in_span, |
| const char ** | out_text, | ||
| size_t * | out_len ) |
Get text content of a single-line span.
Returns a pointer to the text content of a span that fits on a single line. For multi-line spans, use YATL_span_iter_line().
| in_span | Span to get text from |
| out_text | Output pointer to text (not null-terminated) |
| out_len | Output length of text |
| YATL_SpanType_t YATL_span_type | ( | const YATL_Span_t * | span | ) |
Get the type of a span.
| span | Span to query |
| const char * YATL_span_type_name | ( | YATL_SpanType_t | type | ) |
Get the string name of a span type.
Returns a human-readable string for the span type.
| type | Span type value |