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

U_STABLE void U_EXPORT2 ucal_setAttribute ( UCalendar cal,
UCalendarAttribute  attr,
int32_t  newValue 
)

Set 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:
cal The UCalendar to set.
attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK, or UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
newValue The new value of attr.
See also:
ucal_getAttribute ICU 2.0

Definition at line 289 of file ucal.cpp.

References UCAL_FIRST_DAY_OF_WEEK, UCAL_LENIENT, and UCAL_MINIMAL_DAYS_IN_FIRST_WEEK.

{

    switch(attr) {
  case UCAL_LENIENT:
      ((Calendar*)cal)->setLenient((UBool)newValue);
      break;

  case UCAL_FIRST_DAY_OF_WEEK:
      ((Calendar*)cal)->setFirstDayOfWeek((UCalendarDaysOfWeek)newValue);
      break;

  case UCAL_MINIMAL_DAYS_IN_FIRST_WEEK:
      ((Calendar*)cal)->setMinimalDaysInFirstWeek((uint8_t)newValue);
      break;
    }
}


Generated by  Doxygen 1.6.0   Back to index