The datetime.h
File Reference
Included Headers
Enumerations Index
enum class | DateTimeType { ... } |
Functions Index
constexpr const char * | SF_bit2str (int bitNumber) |
Helper function that returns the name related one of the SF bits. More... | |
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. More... | |
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. More... | |
std::tm | getCurrentDateTime () |
Returns the filled in std::tm for the current date and time. More... | |
QCString | yearToString () |
Returns the current year as a string. More... | |
QCString | dateToString (DateTimeType includeTime) |
Returns the current date, when includeTime is set also the time is provided. More... | |
Variables Index
constexpr int | SF_Date = 1<<0 |
Date and time related functions. More... | |
constexpr int | SF_Time = 1<<1 |
a time is presenting in the format string More... | |
constexpr int | SF_Seconds = 1<<2 |
the seconds are presenting in the format string More... | |
constexpr int | SF_NumBits = 3 |
number of bits in SF vector More... | |
Enumerations
DateTimeType
| strong |
Definition at line 38 of file datetime.h.
Functions
dateTimeFromString()
|
Returns the filled in std::tm for a given string representing a date and/or time.
- Parameters
-
[in] spec The string representation of the date and/or time Possible formats:
- the empty string: the current date and time is returned
- YYYY-MM-DD HH:MM:SS: the date and time are fully specified
- YYYY-MM-DD HH:MM: the date and time without seconds
- YYYY-MM-DD: the date without time
- HH:MM:SS: the time with seconds but without date
- HH:MM: the time without seconds and without date
[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.
- Returns
An empty string if the spec has a supported format, or an error message if the format is invalid.
Declaration at line 60 of file datetime.h, 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.
dateToString()
|
Returns the current date, when includeTime is set also the time is provided.
- Parameters
-
[in] includeTime include the time in the output
Declaration at line 81 of file datetime.h, definition at line 63 of file datetime.cpp.
References getCurrentDateTime and theTranslator.
Referenced by RTFGenerator::endIndexSection, ManGenerator::endTitleHead, recordMetadata, substituteKeywords, substituteLatexKeywords and writeDefaultStyleSheet.
formatDateTime()
|
Return a string representation for a given std::tm value that is formatted according to the pattern given by a format.
- Parameters
-
[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.
Declaration at line 70 of file datetime.h, 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.
getCurrentDateTime()
|
Returns the filled in std::tm for the current date and time.
Declaration at line 73 of file datetime.h, definition at line 30 of file datetime.cpp.
References FALSE, Portable::getenv, QCString::isEmpty, QCString::toUInt64, TRUE and warn_uncond.
Referenced by dateTimeFromString, dateToRTFDateString, dateToString and yearToString.
SF_bit2str()
| constexpr |
Helper function that returns the name related one of the SF bits.
Used for generating warnings.
- Parameters
-
[in] bitNumber bit value in range [0..SF_NumBits) for which to return the string value.
Definition at line 32 of file datetime.h.
Reference SF_NumBits.
Referenced by DocPara::handleShowDate.
yearToString()
|
Returns the current year as a string.
Declaration at line 76 of file datetime.h, definition at line 76 of file datetime.cpp.
References getCurrentDateTime and QCString::setNum.
Referenced by substituteKeywords.
Variables
SF_Date
| 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.
SF_NumBits
| constexpr |
number of bits in SF vector
Definition at line 27 of file datetime.h.
Referenced by DocPara::handleShowDate and SF_bit2str.
SF_Seconds
| constexpr |
the seconds are presenting in the format string
Definition at line 26 of file datetime.h.
Referenced by dateTimeFromString and formatDateTime.
SF_Time
| constexpr |
a time is presenting in the format string
Definition at line 25 of file datetime.h.
Referenced by dateTimeFromString and formatDateTime.
Generated via doxygen2docusaurus by Doxygen 1.14.0.