:right-sidebar: True Parser =================================================================== .. currentmodule:: gi.repository.ICalGLib .. class:: Parser(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.ICalGLib.Object`, :class:`~gi.repository.GObject.Object` This is the ICalParser instance. Constructors ------------ .. rst-class:: interim-class .. class:: Parser :no-index: .. classmethod:: new() -> ~gi.repository.ICalGLib.Parser Creates a default :obj:`~gi.repository.ICalGLib.Parser`\. .. versionadded:: 1.0 Methods ------- .. rst-class:: interim-class .. class:: Parser :no-index: .. method:: add_line(str: str | None = None) -> ~gi.repository.ICalGLib.Component | None Add a line at one time into the :obj:`~gi.repository.ICalGLib.Parser` until the parsing is complete and :obj:`~gi.repository.ICalGLib.Component` will be returned. .. versionadded:: 1.0 :param str: A line of string representation of the :obj:`~gi.repository.ICalGLib.Component` .. method:: clean() -> ~gi.repository.ICalGLib.Component | None 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. .. versionadded:: 1.0 .. method:: free() -> None Frees a :obj:`~gi.repository.ICalGLib.Parser`\. .. versionadded:: 1.0 .. method:: get_line(func: ~collections.abc.Callable[[list[int], ~typing.Any], str], user_data: ~typing.Any = None) -> str Given a line generator function, returns a single iCal content line. .. versionadded:: 1.0 :param func: A line generator function :param user_data: The data given to ``func`` .. method:: get_state() -> ~gi.repository.ICalGLib.ParserState Gets the state of the target parser. .. versionadded:: 1.0 .. method:: parse(func: ~collections.abc.Callable[[list[int], ~typing.Any], str], user_data: ~typing.Any = None) -> ~gi.repository.ICalGLib.Component icalparser_parse takes a string that holds the text ( in RFC 2445 format ) and returns a pointer to an :obj:`~gi.repository.ICalGLib.Component`\. The caller owns the memory. ``func`` is a pointer to a function that returns one content line per invocation. .. versionadded:: 1.0 :param func: The function used to parse :param user_data: The data given to ``func`` .. classmethod:: parse_string() -> ~gi.repository.ICalGLib.Component Parses the string into a :obj:`~gi.repository.ICalGLib.Component`\. .. versionadded:: 1.0