ICalParser: libical-glib Reference Manual

## ICalParser ICalParser |

## Functions

gchar * | (*ICalParserLineGenFunc) ()
ICalParser * | i_cal_parser_new ()
ICalComponent * | i_cal_parser_add_line ()
ICalComponent * | i_cal_parser_clean ()
ICalParserState | i_cal_parser_get_state ()
void | i_cal_parser_free ()
ICalComponent * | i_cal_parser_parse ()
ICalComponent * | i_cal_parser_parse_string ()
gchar * | i_cal_parser_get_line ()

## Types and Values

| ICalParser
struct | ICalParserClass
enum | ICalParserState

## Object Hierarchy

        GObject
        ╰── ICalObject
            ╰── ICalParser

## Description

## Functions

### ICalParserLineGenFunc ()

    gchar *
    (*ICalParserLineGenFunc) (gchar *bytes,
                              size_t size,
                              gpointer user_data);

#### Parameters

bytes | the bytes to process. | [array length=size][element-type gchar]
size | the length of the bytes array |
user_data | the user data |

#### Returns

One content line per invocation

### 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.

#### Parameters

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

#### Parameters

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.

#### Parameters

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.

#### Parameters

parser | The ICalParser to be freed. |

Since: 1.0

### i_cal_parser_parse ()

    ICalComponent *
    i_cal_parser_parse (ICalParser *parser,
                        ICalParserLineGenFunc func,
                        gpointer user_data);

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. `func` is a pointer to a function that returns one content line per invocation

#### Parameters

parser | The parser used to parse the string and output the ICalComponent. |
func | The function used to parse. | [scope call]
user_data | The data given to `func` . | [closure]

#### Returns

The component output by the parser.

[transfer full]

Since: 1.0

### i_cal_parser_parse_string ()

    ICalComponent *
    i_cal_parser_parse_string (const gchar *str);

Parse the string into a ICalComponent.

#### Parameters

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,
                           ICalParserLineGenFunc func,
                           gpointer user_data);

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

#### Parameters

parser | The parser to be queried. |
func | A line generator function. | [scope call]
user_data | The data given to `func` . | [closure]

#### Returns

A single iCal content line.

[transfer full]

Since: 1.0

## Types and Values

### ICalParser

    typedef struct _ICalParser ICalParser;

This is the ICalParser instance.

### struct ICalParserClass

    struct ICalParserClass {
    };

This is the ICalParser class.

### enum ICalParserState

#### Members

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