## ICalParser ICalParser |

## Synopsis

    #include <i-cal-component>

    #define             I_CAL_PARSER_TYPE
    struct              ICalParser;
    struct              ICalParserClass;
    enum                ICalParserState;
    ICalParser *        i_cal_parser_new_full               (icalparser *native,
                                                             GObject *owner);
    ICalParser *        i_cal_parser_new                    (void);
    ICalComponent *     i_cal_parser_add_line               (ICalParser *parser,
                                                             gchar *str);
    ICalComponent *     i_cal_parser_clean                  (ICalParser *parser);
    ICalParserState     i_cal_parser_get_state              (ICalParser *parser);
    void                i_cal_parser_free                   (ICalParser *parser);
    ICalComponent *     i_cal_parser_parse                  (ICalParser *parser,
                                                             gchar* (*func) (gchar *,size_t,void *));
    void                i_cal_parser_set_gen_data           (ICalParser *parser,
                                                             void *data);
    ICalComponent *     i_cal_parser_parse_string           (const gchar *str);
    gchar *             i_cal_parser_get_line               (ICalParser *parser,
                                                             gchar* (*func) (gchar *,size_t,void *));
    gchar *             i_cal_parser_string_line_generator  (gchar *out,
                                                             size_t buf_size,
                                                             void *d);

## Object Hierarchy

      GObject
       +----ICalObject
             +----ICalParser

## Description

## Details

### I_CAL_PARSER_TYPE

    #define             I_CAL_PARSER_TYPE

### struct ICalParser

    struct ICalParser;

This is the ICalParser instance.

### struct ICalParserClass

    struct ICalParserClass {
    };

This is the ICalParser class.

### enum ICalParserState

    typedef enum {
    	I_CAL_PARSER_ERROR = ICALPARSER_ERROR,
    	I_CAL_PARSER_SUCCESS = ICALPARSER_SUCCESS,
    	I_CAL_PARSER_BEGIN_COMP = ICALPARSER_BEGIN_COMP,
    	I_CAL_PARSER_END_COMP = ICALPARSER_END_COMP,
    	I_CAL_PARSER_IN_PROGRESS = ICALPARSER_IN_PROGRESS
    } ICalParserState;

`I_CAL_PARSER_ERROR` |
`I_CAL_PARSER_SUCCESS` |
`I_CAL_PARSER_BEGIN_COMP` |
`I_CAL_PARSER_END_COMP` |
`I_CAL_PARSER_IN_PROGRESS` |

### i_cal_parser_new_full ()

    ICalParser *        i_cal_parser_new_full               (icalparser *native,
                                                             GObject *owner);

Create a new libical-glib object from the native libical object and the owner.

`native` : | The native libical object.
`owner` : | The parent.
Returns : | The newly create libical-glib object. [transfer full]

Since 1.0

### i_cal_parser_new ()

    ICalParser *        i_cal_parser_new                    (void);

Create a default ICalParser.

Returns : | The newly created ICalParser. [transfer full]

Since 1.0

### i_cal_parser_add_line ()

    ICalComponent *     i_cal_parser_add_line               (ICalParser *parser,
                                                             gchar *str);

Add a line at one time into the ICalParser until the parsing is complete and ICalComponent will be returned.

`parser` : | The ICalParser used to parse the string into the ICalComponent. [in][transfer full]
`str` : | A line of string representation of the ICalComponent. [allow-none][transfer none]
Returns : | The complete ICalComponent. [allow-none][transfer full]

Since 1.0

### i_cal_parser_clean ()

    ICalComponent *     i_cal_parser_clean                  (ICalParser *parser);

We won't get a clean exit if some components did not have an "END" tag. Clear off any component that may be left in the list

`parser` : | The parser to be cleaned and queried.
Returns : | The root ICalComponent in `parser`. [allow-none][transfer full]

Since 1.0

### i_cal_parser_get_state ()

    ICalParserState     i_cal_parser_get_state              (ICalParser *parser);

Get the state of the target parser.

`parser` : | The ICalParser to be queried.
Returns : | The parser state stored in the ICalParser.

Since 1.0

### i_cal_parser_free ()

    void                i_cal_parser_free                   (ICalParser *parser);

Free a ICalParser.

`parser` : | The ICalParser to be freed.

Since 1.0

### i_cal_parser_parse ()

    ICalComponent *     i_cal_parser_parse                  (ICalParser *parser,
                                                             gchar* (*func) (gchar *,size_t,void *));

icalparser_parse takes a string that holds the text ( in RFC 2445 format ) and returns a pointer to an icalcomponent. The caller owns the memory. line_gen_func is a pointer to a function that returns one content line per invocation

`parser` : | The parser used to parse the string and output the ICalComponent.
`func` : | The function used to parse.
Returns : | The component output by the parser. [transfer full]

Since 1.0

### i_cal_parser_set_gen_data ()

    void                i_cal_parser_set_gen_data           (ICalParser *parser,
                                                             void *data);

Set the data that icalparser_parse will give to the line_gen_func as the parameter 'd'

`parser` : | The parser
`data` : | Set the data that icalparser_parse will give to the line_gen_func as the parameter 'd'

Since 1.0

### i_cal_parser_parse_string ()

    ICalComponent *     i_cal_parser_parse_string           (const gchar *str);

Parse the string into a ICalComponent.

`str` : | The string to be parsed
Returns : | The ICalComponent parsed from str. [transfer full]

Since 1.0

### i_cal_parser_get_line ()

    gchar *             i_cal_parser_get_line               (ICalParser *parser,
                                                             gchar* (*func) (gchar *,size_t,void *));

Given a line generator function, return a single iCal content line.

`parser` : | The parser to be queried.
`func` : | A line generator function.
Returns : | A single iCal content line. [transfer full]

Since 1.0

### i_cal_parser_string_line_generator ()

    gchar *             i_cal_parser_string_line_generator  (gchar *out,
                                                             size_t buf_size,
                                                             void *d);

The string line generator used as line_gen_func

`out` : | The input.
`buf_size` : | The size of the buffer.
`d` : | The data to be supplied.
Returns : | The generated line. [transfer full]

Since 1.0