Coverage Report

Created: 2026-02-10 07:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/poppler/glib/poppler-date.cc
Line
Count
Source
1
/* poppler-date.cc: glib interface to poppler
2
 *
3
 * Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; either version 2, or (at your option)
8
 * any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
18
 */
19
20
#include <goo/glibc.h>
21
#include <DateInfo.h>
22
23
#include "poppler-date.h"
24
25
/**
26
 * poppler_date_parse:
27
 * @date: string to parse
28
 * @timet: an uninitialized #time_t
29
 *
30
 * Parses a PDF format date string and converts it to a #time_t. Returns #FALSE
31
 * if the parsing fails or the input string is not a valid PDF format date string
32
 *
33
 * Return value: #TRUE, if @timet was set
34
 *
35
 * Since: 0.12
36
 **/
37
gboolean poppler_date_parse(const gchar *date, time_t *timet)
38
0
{
39
0
    time_t t;
40
0
    GooString dateString(date);
41
0
    t = dateStringToTime(&dateString);
42
0
    if (t == (time_t)-1) {
43
0
        return FALSE;
44
0
    }
45
46
0
    *timet = t;
47
    return TRUE;
48
0
}