Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
0
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;
}
Ejemplo n.º 4
0
void decodeTimestamp(IBPP::Timestamp& ts, const ISC_TIMESTAMP& isc_ts)
{
    decodeDate(ts, isc_ts.timestamp_date);
    decodeTime(ts, isc_ts.timestamp_time);
}