Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
icalrestriction.h File Reference

Functions to check if an icalcomponent meets the restrictions imposed by the standard. More...

Go to the source code of this file.

Typedefs

typedef enum icalrestriction_kind icalrestriction_kind
 The kinds of icalrestrictions there are.

Enumerations

enum  icalrestriction_kind {
  ICAL_RESTRICTION_NONE = 0 , ICAL_RESTRICTION_ZERO , ICAL_RESTRICTION_ONE , ICAL_RESTRICTION_ZEROPLUS ,
  ICAL_RESTRICTION_ONEPLUS , ICAL_RESTRICTION_ZEROORONE , ICAL_RESTRICTION_ONEEXCLUSIVE , ICAL_RESTRICTION_ONEMUTUAL ,
  ICAL_RESTRICTION_UNKNOWN
}
 The kinds of icalrestrictions there are. More...

Functions

bool icalrestriction_check (icalcomponent *comp)
 Checks if a given VCALENDAR meets all the restrictions imposed by the standard.
bool icalrestriction_compare (icalrestriction_kind restr, int count)
 Checks if the given count is in accordance with the given restriction, restr.

Detailed Description

Functions to check if an icalcomponent meets the restrictions imposed by the standard.

Typedef Documentation

◆ icalrestriction_kind

The kinds of icalrestrictions there are.

These must stay in this order for icalrestriction_compare to work

Enumeration Type Documentation

◆ icalrestriction_kind

The kinds of icalrestrictions there are.

These must stay in this order for icalrestriction_compare to work

Enumerator
ICAL_RESTRICTION_NONE 

No restriction.

ICAL_RESTRICTION_ZERO 

Zero.

ICAL_RESTRICTION_ONE 

One.

ICAL_RESTRICTION_ZEROPLUS 

Zero or more.

ICAL_RESTRICTION_ONEPLUS 

One or more.

ICAL_RESTRICTION_ZEROORONE 

Zero or one.

ICAL_RESTRICTION_ONEEXCLUSIVE 

Zero or one, exclusive with another property.

ICAL_RESTRICTION_ONEMUTUAL 

Zero or one, mutual with another property.

ICAL_RESTRICTION_UNKNOWN 

Unknown.

Function Documentation

◆ icalrestriction_check()

bool icalrestriction_check ( icalcomponent * comp)

Checks if a given VCALENDAR meets all the restrictions imposed by the standard.

Parameters
compThe VCALENDAR component to check
Returns
true if the restrictions are met, false if not
Error handling
Returns false and sets icalerrno if NULL is passed as comp, or if the component is not a VCALENDAR.
Example
icalcomponent *component = // ...
// check component
assert(icalrestriction_check(component) == true);
bool icalrestriction_check(icalcomponent *comp)
Checks if a given VCALENDAR meets all the restrictions imposed by the standard.

◆ icalrestriction_compare()

bool icalrestriction_compare ( icalrestriction_kind restr,
int count )

Checks if the given count is in accordance with the given restriction, restr.

Parameters
restrThe restriction to apply to the count
countThe amount present that is to be checked against the restriction
Returns
true if the restriction is met, false if not
Example
assert(icalrestriction_compare(ICALRESTRICTION_ONEPLUS, 5) == true);
assert(icalrestriction_compare(ICALRESTRICTION_NONE, 3) == false);
bool icalrestriction_compare(icalrestriction_kind restr, int count)
Checks if the given count is in accordance with the given restriction, restr.