Stores metadata about a token within a datetime format.
| 187 | |
| 188 | /// Stores metadata about a token within a datetime format. |
| 189 | struct DateTimeFormatToken { |
| 190 | /// Indicates the type of datetime format token. |
| 191 | DateTimeFormatTokenType type; |
| 192 | /// The position of where this token is supposed to start in the datetime string |
| 193 | /// to be parsed. |
| 194 | int pos; |
| 195 | /// The length of the token. |
| 196 | int len; |
| 197 | /// A pointer to the beginning of this token in the format string. |
| 198 | const char* val; |
| 199 | /// True if FM modifier is active for this token. This overrides the FX modifier active |
| 200 | /// for the whole format. |
| 201 | bool fm_modifier; |
| 202 | |
| 203 | /// True if this is a text token that is surrounded by escaped double quotes making the |
| 204 | /// content of the token double-escaped. |
| 205 | bool is_double_escaped; |
| 206 | |
| 207 | /// Helper for fast div/modulo on FRACTION and YEAR tokens. |
| 208 | int divisor; |
| 209 | |
| 210 | DateTimeFormatToken(DateTimeFormatTokenType type, int pos, int len, const char* val) |
| 211 | : type(type), |
| 212 | pos(pos), |
| 213 | len(len), |
| 214 | val(val), |
| 215 | fm_modifier(false), |
| 216 | is_double_escaped(false), |
| 217 | divisor(1000000000) {} |
| 218 | }; |
| 219 | |
| 220 | /// Holds metadata about the datetime format. In the format parsing process the members of |
| 221 | /// this struct are populated gradually as the process advances. After the parsing process |
no outgoing calls
no test coverage detected