void EraRules::getStartDate(int32_t eraIdx, int32_t (&fields)[3], UErrorCode& status) const { if(U_FAILURE(status)) { return; } if (eraIdx < 0 || eraIdx >= numEras) { status = U_ILLEGAL_ARGUMENT_ERROR; return; } decodeDate(startDates[eraIdx], fields); }
void VCalParser::readEvent() { //qDebug() << "[calendar] reading event"; //QTime time; QString key, val; TEvent event; //time.start(); while( key != "END" && !atEnd ) { key = readKey(); val = readValue(); if( key == "UID" ) event.setUid(val); else if( key == "DESCRIPTION") event.setDescription(val); else if( key == "SUMMARY") event.setSummary(val); else if( key == "LOCATION") event.setLocation(val); else if( key == "LAST-MODIFIED")event.setLastModified(decodeDate(val)); else if( key == "CLASS") event.setClass(val); else if( key == "STATUS") event.setStatus(val); else if( key == "DTSTART" || key == "DTSTART;VALUE=DATE") { if( val.size() > 1 ) event.setStart(decodeDate(val)); } else if( key == "DTEND" || key == "DTEND;VALUE=DATE") { if( val.size() > 1 ) event.setEnd(decodeDate(val)); } // event is in the future if(event.getStart() > QDateTime::currentDateTime()) { if(event < nextEvent) nextEvent = event; } } m_events.append(event); }
int32_t EraRules::getStartYear(int32_t eraIdx, UErrorCode& status) const { int year = MAX_INT32; // bogus value if(U_FAILURE(status)) { return year; } if (eraIdx < 0 || eraIdx >= numEras) { status = U_ILLEGAL_ARGUMENT_ERROR; return year; } int fields[3]; decodeDate(startDates[eraIdx], fields); year = fields[0]; return year; }
void decodeTimestamp(IBPP::Timestamp& ts, const ISC_TIMESTAMP& isc_ts) { decodeDate(ts, isc_ts.timestamp_date); decodeTime(ts, isc_ts.timestamp_time); }