GMimeHtmlEntityDecoder

GMimeHtmlEntityDecoder — Incremental named and numeric character references

Functions

Types and Values

Description

Push characters beginning with an ampersand until push() returns FALSE. The rejected character remains unconsumed. Obtain the decoded value, then reset the decoder before starting another reference. Attribute values apply HTML's historical missing-semicolon rule using the next unconsumed scalar. Returned strings are borrowed and invalidated by decoder mutation.

Functions

g_mime_html_entity_decoder_new ()

GMimeHtmlEntityDecoder *
g_mime_html_entity_decoder_new (void);

Returns

a new incremental entity decoder.

[transfer full]


g_mime_html_entity_decoder_push ()

gboolean
g_mime_html_entity_decoder_push (GMimeHtmlEntityDecoder *decoder,
                                 gunichar c);

Feeds a character reference, starting with '&'.

Parameters

decoder

an entity decoder

 

c

the next Unicode scalar

 

Returns

TRUE if c was consumed, or FALSE if it was refused


g_mime_html_entity_decoder_get_value ()

const char *
g_mime_html_entity_decoder_get_value (GMimeHtmlEntityDecoder *decoder);

Parameters

decoder

an entity decoder

 

Returns

the decoded value, valid until the next push, reset, or value call on decoder .

[transfer none]


g_mime_html_entity_decoder_get_attribute_value ()

const char *
g_mime_html_entity_decoder_get_attribute_value
                               (GMimeHtmlEntityDecoder *decoder,
                                gunichar next);

Applies the character-reference rules for attribute values.

Parameters

decoder

an entity decoder

 

next

the following Unicode scalar, or zero at end of input

 

Returns

the decoded value, valid until the next push, reset, or value call on decoder .

[transfer none]


g_mime_html_entity_decoder_reset ()

void
g_mime_html_entity_decoder_reset (GMimeHtmlEntityDecoder *decoder);

Clears the accumulated character reference and invalidates borrowed decoded values. The next character pushed must be an ampersand.

Parameters

decoder

a GMimeHtmlEntityDecoder

 

Types and Values

GMimeHtmlEntityDecoder

typedef struct _GMimeHtmlEntityDecoder GMimeHtmlEntityDecoder;

An incremental decoder for named and numeric HTML character references.