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

int32_t Calendar::get ( UCalendarDateFields  field,
UErrorCode status 
) const [inherited]

Gets the value for a given time field. Recalculate the current time field values if the time value has been changed by a call to setTime(). Return zero for unset fields if any fields have been explicitly set by a call to set(). To force a recomputation of all fields regardless of the previous state, call complete(). This method is semantically const, but may alter the object in memory.

Parameters:
field The given time field.
status Fill-in parameter which receives the status of the operation.
Returns:
The value for the given time field, or zero if the field is unset, and set() has been called for any other field. ICU 2.6.

Definition at line 1036 of file calendar.cpp.

References Calendar::fFields, and U_SUCCESS.

{
    // field values are only computed when actually requested; for more on when computation
    // of various things happens, see the "data flow in Calendar" description at the top
    // of this file
    if (U_SUCCESS(status)) ((Calendar*)this)->complete(status); // Cast away const
    return U_SUCCESS(status) ? fFields[field] : 0;
}


Generated by  Doxygen 1.6.0   Back to index