Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE int32_t U_EXPORT2 ucal_getAttribute ( const UCalendar cal,
UCalendarAttribute  attr 
)

Get a numeric attribute associated with a UCalendar. Numeric attributes include the first day of the week, or the minimal numbers of days in the first week of the month.

Parameters:
calThe UCalendar to query.
attrThe desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK, or UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
Returns:
The value of attr.
See also:
ucal_setAttribute ICU 2.0

Definition at line 265 of file ucal.cpp.

References UCAL_FIRST_DAY_OF_WEEK, UCAL_LENIENT, and UCAL_MINIMAL_DAYS_IN_FIRST_WEEK.

{

    switch(attr) {
  case UCAL_LENIENT:
      return ((Calendar*)cal)->isLenient();

  case UCAL_FIRST_DAY_OF_WEEK:
      return ((Calendar*)cal)->getFirstDayOfWeek();

  case UCAL_MINIMAL_DAYS_IN_FIRST_WEEK:
      return ((Calendar*)cal)->getMinimalDaysInFirstWeek();

  default:
      break;
    }
    return -1;
}

Generated by  Doxygen 1.6.0   Back to index