Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/vcl/source/pdf/   (LibreOffice Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 2 kB image not shown  

Quelle  PDFiumTools.cxx

  Sprache: C
 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 */


#include <vcl/filter/PDFiumLibrary.hxx>

namespace vcl::pdf
{
OUString convertPdfDateToISO8601(std::u16string_view rInput)
{
    if (rInput.size() < 6)
        return {};

    std::u16string_view prefix = rInput.substr(02);
    if (prefix != u"D:")
        return {};

    std::u16string_view sYear = rInput.substr(24);

    std::u16string_view sMonth(u"01");
    if (rInput.size() >= 8)
        sMonth = rInput.substr(62);

    std::u16string_view sDay(u"01");
    if (rInput.size() >= 10)
        sDay = rInput.substr(82);

    std::u16string_view sHours(u"00");
    if (rInput.size() >= 12)
        sHours = rInput.substr(102);

    std::u16string_view sMinutes(u"00");
    if (rInput.size() >= 14)
        sMinutes = rInput.substr(122);

    std::u16string_view sSeconds(u"00");
    if (rInput.size() >= 16)
        sSeconds = rInput.substr(142);

    OUString sTimeZoneMark(u"Z"_ustr);
    if (rInput.size() >= 17)
        sTimeZoneMark = rInput.substr(161);

    std::u16string_view sTimeZoneHours(u"00");
    std::u16string_view sTimeZoneMinutes(u"00");
    if ((sTimeZoneMark == "+" || sTimeZoneMark == "-") && rInput.size() >= 22)
    {
        std::u16string_view sTimeZoneSeparator = rInput.substr(191);
        if (sTimeZoneSeparator == u"'")
        {
            sTimeZoneHours = rInput.substr(172);
            sTimeZoneMinutes = rInput.substr(202);
        }
    }

    OUString sTimeZoneString;
    if (sTimeZoneMark == "+" || sTimeZoneString == "-")
        sTimeZoneString = sTimeZoneMark + sTimeZoneHours + ":" + sTimeZoneMinutes;
    else if (sTimeZoneMark == "Z")
        sTimeZoneString = sTimeZoneMark;

    return OUString::Concat(sYear) + "-" + sMonth + "-" + sDay + "T" + sHours + ":" + sMinutes + ":"
           + sSeconds + sTimeZoneString;
}
// end vcl::pdf

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5 in Prozent
C=93 H=95 G=93

¤ Dauer der Verarbeitung: 0.15 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.