|
Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
|
Line-oriented parsing. More...
Go to the source code of this file.
Enumerations | |
| enum | icalparser_ctrl { ICALPARSER_CTRL_KEEP , ICALPARSER_CTRL_OMIT , ICALPARSER_CTRL_ERROR } |
| Defines how to handle invalid CONTROL characters in content lines. More... | |
| enum | icalparser_state { ICALPARSER_ERROR , ICALPARSER_SUCCESS , ICALPARSER_BEGIN_COMP , ICALPARSER_END_COMP , ICALPARSER_IN_PROGRESS } |
| Represents the current state of the parser. More... | |
Functions | |
| icalcomponent * | icalparser_add_line (icalparser *parser, char *line) |
| Adds a single line to be parsed by the icalparser. | |
| icalcomponent * | icalparser_clean (icalparser *parser) |
| Cleans out an icalparser and returns whatever it has parsed so far. | |
| void | icalparser_free (icalparser *parser) |
| Frees an icalparser object. | |
| enum icalparser_ctrl | icalparser_get_ctrl (void) |
| Get the current parser setting how to handle CONTROL characters. | |
| char * | icalparser_get_line (icalparser *parser, icalparser_line_gen_func line_gen_func) |
| Given a line generator function, returns a single iCal content line. | |
| icalparser_state | icalparser_get_state (const icalparser *parser) |
| Returns current state of the icalparser. | |
| icalparser * | icalparser_new (void) |
| Creates a new icalparser. | |
| icalcomponent * | icalparser_parse (icalparser *parser, icalparser_line_gen_func line_gen_func) |
| Message oriented parsing. | |
| icalcomponent * | icalparser_parse_string (const char *str) |
| Parses a string and returns the parsed icalcomponent. | |
| void | icalparser_set_ctrl (enum icalparser_ctrl ctrl) |
| Set the parser setting how to handle CONTROL characters. | |
| void | icalparser_set_gen_data (icalparser *parser, void *data) |
| Sets the data that icalparser_parse will give to the line_gen_func as the parameter 'd'. | |
| char * | icalparser_string_line_generator (char *out, size_t buf_size, void *d) |
Line-oriented parsing.
This file provides methods to parse iCalendar-formatted data into the structures provided by this library.
Definition in file icalparser.h.
| enum icalparser_ctrl |
Defines how to handle invalid CONTROL characters in content lines.
Definition at line 305 of file icalparser.h.
| enum icalparser_state |
Represents the current state of the parser.
Definition at line 39 of file icalparser.h.
| icalcomponent * icalparser_add_line | ( | icalparser * | parser, |
| char * | line ) |
Adds a single line to be parsed by the icalparser.
| parser | The parser to use |
| line | A string representing a single line of RFC5545-formatted iCalendar data |
Definition at line 650 of file icalparser.c.
| icalcomponent * icalparser_clean | ( | icalparser * | parser | ) |
Cleans out an icalparser and returns whatever it has parsed so far.
| parser | The icalparser to clean |
This will parse components even if it hasn't encountered a proper END tag for it yet and return them, as well as clearing any intermediate state resulting from being in the middle of parsing something so the parser can be used to parse something new.
Definition at line 1231 of file icalparser.c.
| void icalparser_free | ( | icalparser * | parser | ) |
Frees an icalparser object.
| parser | The icalparser to be freed. |
Definition at line 112 of file icalparser.c.
| enum icalparser_ctrl icalparser_get_ctrl | ( | void | ) |
Get the current parser setting how to handle CONTROL characters.
Definition at line 1360 of file icalparser.c.
| char * icalparser_get_line | ( | icalparser * | parser, |
| icalparser_line_gen_func | line_gen_func ) |
Given a line generator function, returns a single iCal content line.
| parser | The parser object to use |
| line_gen_func | The function to use for reading data |
This function uses the supplied line_gen_func to read data in, until it has read a full line, and returns the full line. It includes any continuation lines, which start with a space after a newline. To supply arbitrary data (as the parameter d) to your line_gen_func, call icalparser_set_gen_data().
Definition at line 437 of file icalparser.c.
| icalparser_state icalparser_get_state | ( | const icalparser * | parser | ) |
Returns current state of the icalparser.
| parser | The (valid, non-NULL) parser object |
icalparser_free(parser);
Definition at line 1226 of file icalparser.c.
| icalparser * icalparser_new | ( | void | ) |
Creates a new icalparser.
Definition at line 89 of file icalparser.c.
| icalcomponent * icalparser_parse | ( | icalparser * | parser, |
| icalparser_line_gen_func | line_gen_func ) |
Message oriented parsing.
| parser | The parser to use |
| line_gen_func | A function that returns one content line per invocation |
Reads an icalcomponent using the supplied line_gen_func, returning the parsed component (or NULL on error).
Definition at line 588 of file icalparser.c.
| icalcomponent * icalparser_parse_string | ( | const char * | str | ) |
Parses a string and returns the parsed icalcomponent.
| str | The iCal formatted data to be parsed |
Definition at line 1331 of file icalparser.c.
| void icalparser_set_ctrl | ( | enum icalparser_ctrl | ctrl | ) |
Set the parser setting how to handle CONTROL characters.
| ctrl | The setting to use |
Definition at line 1365 of file icalparser.c.
| void icalparser_set_gen_data | ( | icalparser * | parser, |
| void * | data ) |
Sets the data that icalparser_parse will give to the line_gen_func as the parameter 'd'.
| parser | The icalparser this applies to |
| data | The pointer which will be passed to the line_gen_func as argument d |
If you use any of the icalparser_parser() or icalparser_get_line() functions, the line_gen_func that they expect has a third void *d argument. This function sets what will be passed to your line_gen_function as such argument.
Definition at line 129 of file icalparser.c.
| char * icalparser_string_line_generator | ( | char * | out, |
| size_t | buf_size, | ||
| void * | d ) |
A callback function to use by icalparser_get_line.
| out | a pointer to a char string to hold the concatenated output data |
| buf_size | is the length of out |
| d | is a pointer to the input data |
out. Definition at line 1266 of file icalparser.c.