Doxygen
|
#include <cstdlib>
#include <chrono>
#include <memory>
#include <array>
#include <functional>
#include "regex.h"
#include "datetime.h"
#include "config.h"
#include "portable.h"
#include "language.h"
#include "message.h"
#include "growbuf.h"
Go to the source code of this file.
Classes | |
struct | SpecFormat |
struct | DateTimeField |
Typedefs | |
using | TMFieldAssigner = std::function< void(std::tm &,int value) > |
Functions | |
std::tm | getCurrentDateTime () |
Returns the filled in std::tm for the current date and time. | |
QCString | dateToString (DateTimeType includeTime) |
Returns the current date, when includeTime is set also the time is provided. | |
QCString | yearToString () |
Returns the current year as a string. | |
static void | determine_weekday (std::tm &tm) |
QCString | dateTimeFromString (const QCString &spec, std::tm &dt, int &format) |
Returns the filled in std::tm for a given string representing a date and/or time. | |
QCString | formatDateTime (const QCString &format, const std::tm &dt, int &formatUsed) |
Return a string representation for a given std::tm value that is formatted according to the pattern given by a format. | |
Variables | |
static std::array | g_specFormats |
static std::array | g_assignValues |
using TMFieldAssigner = std::function< void(std::tm &,int value) > |
Definition at line 90 of file datetime.cpp.
Returns the filled in std::tm for a given string representing a date and/or time.
[in] | spec | The string representation of the date and/or time Possible formats:
|
[out] | dt | The corresponding datetime value. |
[out] | format | The parts that have been found in spec; a bitwise or of SF_Date , SF_Time and SF_Seconds . |
Definition at line 134 of file datetime.cpp.
References DateTimeField::assigner, determine_weekday(), g_assignValues, g_specFormats, getCurrentDateTime(), QCString::isEmpty(), reg::match(), DateTimeField::maxVal, DateTimeField::minVal, DateTimeField::name, SF_Date, SF_Seconds, SF_Time, QCString::sprintf(), and QCString::str().
Referenced by DocPara::handleShowDate(), and showDate().
QCString dateToString | ( | DateTimeType | includeTime | ) |
Returns the current date, when includeTime
is set also the time is provided.
[in] | includeTime | include the time in the output |
Definition at line 63 of file datetime.cpp.
References getCurrentDateTime(), and theTranslator.
Referenced by RTFGenerator::endIndexSection(), ManGenerator::endTitleHead(), recordMetadata(), substituteHtmlKeywords(), substituteKeywords(), substituteLatexKeywords(), and HtmlGenerator::writeLogoAsString().
|
static |
Definition at line 121 of file datetime.cpp.
Referenced by dateTimeFromString().
Return a string representation for a given std::tm value that is formatted according to the pattern given by a format.
[in] | format | the string used for format the date and time, e.g. Y-m-d |
[in] | dt | the date and time value to fill in |
[out] | formatUsed | A bitwise OR of SF_Date , SF_Time and SF_Seconds representing the the types of markers found in the format string. |
Definition at line 175 of file datetime.cpp.
References GrowBuf::addChar(), GrowBuf::addInt(), GrowBuf::addStr(), QCString::data(), GrowBuf::get(), SF_Date, SF_Seconds, SF_Time, and theTranslator.
Referenced by DocPara::handleShowDate(), and showDate().
std::tm getCurrentDateTime | ( | ) |
Returns the filled in std::tm for the current date and time.
Definition at line 30 of file datetime.cpp.
References FALSE, Portable::getenv(), QCString::isEmpty(), qPrint(), QCString::toUInt64(), TRUE, and warn_uncond.
Referenced by dateTimeFromString(), dateToRTFDateString(), dateToString(), and yearToString().
QCString yearToString | ( | ) |
Returns the current year as a string.
Definition at line 76 of file datetime.cpp.
References getCurrentDateTime(), and QCString::setNum().
Referenced by substituteKeywords().
|
static |
Definition at line 110 of file datetime.cpp.
Referenced by dateTimeFromString().
|
static |
Definition at line 100 of file datetime.cpp.
Referenced by dateTimeFromString().