## GrssFeedFormatter GrssFeedFormatter — abstract class to format feeds in plain rappresentation |

## Functions

void | grss_feed_formatter_set_channel ()
GrssFeedChannel * | grss_feed_formatter_get_channel ()
void | grss_feed_formatter_add_item ()
void | grss_feed_formatter_add_items ()
GList * | grss_feed_formatter_get_items ()
void | grss_feed_formatter_reset ()
gchar * | grss_feed_formatter_format ()

## Types and Values

#define | GRSS_FEED_FORMATTER_TYPE

## Object Hierarchy

        GObject
        ╰── GrssFeedFormatter
            ├── GrssFeedAtomFormatter
            ╰── GrssFeedRssFormatter

## Description

GrssFeedFormatter is a class abstracting the ability to format a GrssFeedChannel and related GrssFeedItems into a plain text string, usually in XML. Subclasses implement the effective required format (e.g. RSS, Atom...)

## Functions

### grss_feed_formatter_set_channel ()

    void
    grss_feed_formatter_set_channel (GrssFeedFormatter *formatter,
                                     GrssFeedChannel *channel);

Inits the GrssFeedFormatter with the given `channel` . A GrssFeedFormatter can format a single GrssFeedChannel each time, but may be reused by calling `grss_feed_formatter_reset()`

#### Parameters

formatter | a GrssFeedFormatter. |
channel | the reference GrssFeedChannel for the `formatter` . |

### grss_feed_formatter_get_channel ()

    GrssFeedChannel *
    grss_feed_formatter_get_channel (GrssFeedFormatter *formatter);

Gets the current GrssFeedChannel assigned to the `formatter` .

#### Parameters

formatter | a GrssFeedFormatter. |

#### Returns

a GrssFeedChannel, or `NULL` if none has been assigned.

[transfer none]

### grss_feed_formatter_add_item ()

    void
    grss_feed_formatter_add_item (GrssFeedFormatter *formatter,
                                  GrssFeedItem *item);

Adds a single GrssFeedItem in the `formatter` .

#### Parameters

formatter | a GrssFeedFormatter. |
item | a GrssFeedItem to add into the `formatter` . |

### grss_feed_formatter_add_items ()

    void
    grss_feed_formatter_add_items (GrssFeedFormatter *formatter,
                                   GList *items);

Adds a list of GrssFeedItems in the `formatter` .

#### Parameters

formatter | a GrssFeedFormatter. |
items | a list of GrssFeedItems to add into the `formatter` . | [element-type GrssFeedItem]

### grss_feed_formatter_get_items ()

    GList *
    grss_feed_formatter_get_items (GrssFeedFormatter *formatter);

Gets the current GrssFeedItems assigned to the `formatter` .

#### Parameters

formatter | a GrssFeedFormatter. |

#### Returns

a list of GrssFeedItems, or `NULL` if none has been assigned.

[element-type GrssFeedItem][transfer none]

### grss_feed_formatter_reset ()

    void
    grss_feed_formatter_reset (GrssFeedFormatter *formatter);

Resets the status of the GrssFeedFormatter, cleaning up the assigned GrssFeedChannel and related GrssFeedItems. This way `formatter` is ready to be used again with new data.

#### Parameters

formatter | a GrssFeedFormatter. |

### grss_feed_formatter_format ()

    gchar *
    grss_feed_formatter_format (GrssFeedFormatter *formatter);

Formats the assigned GrssFeedChannel and GrssFeedItems into a plain text string, accordly to the current GrssFeedFormatter instance.

#### Parameters

formatter | a GrssFeedFormatter. |

#### Returns

a string containing the plain text rappresentation of the given channel containing the given items.

[transfer full]

## Types and Values

### GRSS_FEED_FORMATTER_TYPE

    #define GRSS_FEED_FORMATTER_TYPE		(grss_feed_formatter_get_type())