Doxygen
|
Go to the source code of this file.
Enumerations | |
enum class | DateTimeType { DateTime , Date , Time } |
Functions | |
constexpr const char * | SF_bit2str (int bitNumber) |
Helper function that returns the name related one of the SF bits. | |
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. | |
std::tm | getCurrentDateTime () |
Returns the filled in std::tm for the current date and time. | |
QCString | yearToString () |
Returns the current year as a string. | |
QCString | dateToString (DateTimeType includeTime) |
Returns the current date, when includeTime is set also the time is provided. | |
Variables | |
constexpr int | SF_Date = 1<<0 |
Date and time related functions. | |
constexpr int | SF_Time = 1<<1 |
a time is presenting in the format string | |
constexpr int | SF_Seconds = 1<<2 |
the seconds are presenting in the format string | |
constexpr int | SF_NumBits = 3 |
number of bits in SF vector | |
|
strong |
Enumerator | |
---|---|
DateTime | |
Date | |
Time |
Definition at line 38 of file datetime.h.
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().
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().
|
constexpr |
Helper function that returns the name related one of the SF bits.
Used for generating warnings.
[in] | bitNumber | bit value in range [0..SF_NumBits) for which to return the string value. |
Definition at line 32 of file datetime.h.
References SF_NumBits.
Referenced by DocPara::handleShowDate().
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().
|
constexpr |
Date and time related functions.
a date is presenting in the format string
Definition at line 24 of file datetime.h.
Referenced by dateTimeFromString(), and formatDateTime().
|
constexpr |
number of bits in SF vector
Definition at line 27 of file datetime.h.
Referenced by DocPara::handleShowDate(), and SF_bit2str().
|
constexpr |
the seconds are presenting in the format string
Definition at line 26 of file datetime.h.
Referenced by dateTimeFromString(), and formatDateTime().
|
constexpr |
a time is presenting in the format string
Definition at line 25 of file datetime.h.
Referenced by dateTimeFromString(), and formatDateTime().