コード例 #1
0
char* icaldurationtype_as_ical_string(struct icaldurationtype d) 
{
	char *buf;
	buf = icaldurationtype_as_ical_string_r(d);
	icalmemory_add_tmp_buffer(buf);
	return buf;
}
コード例 #2
0
char* icalperiodtype_as_ical_string_r(struct icalperiodtype p)
{

    const char* start;
    const char* end;

    char *buf;
    size_t buf_size = 40;
    char* buf_ptr = 0;

    buf = (char*)icalmemory_new_buffer(buf_size);
    buf_ptr = buf;


    start = icaltime_as_ical_string_r(p.start);
    icalmemory_append_string(&buf, &buf_ptr, &buf_size, start);
    icalmemory_free_buffer(start);

    if(!icaltime_is_null_time(p.end)) {
        end = icaltime_as_ical_string_r(p.end);
    } else {
        end = icaldurationtype_as_ical_string_r(p.duration);
    }

    icalmemory_append_char(&buf, &buf_ptr, &buf_size, '/');

    icalmemory_append_string(&buf, &buf_ptr, &buf_size, end);
    icalmemory_free_buffer(end);

    return buf;
}
コード例 #3
0
ファイル: IcalDuration.hpp プロジェクト: greyson/ics2rem
 std::string asIcalString() {
    char * temp = icaldurationtype_as_ical_string_r( *this );
    std::string retval( temp );
    free( temp );
    return retval;
 }