Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
time_shield::detail::format_parse Namespace Reference

Classes

struct  FormatParseState

Functions

FormatParseState create_format_parse_state () noexcept
TIME_SHIELD_CONSTEXPR bool is_ascii_digit (char c) noexcept
bool match_literal (const char *&p, const char *end, char expected) noexcept
bool match_literal (const char *&p, const char *end, const char *literal) noexcept
bool parse_exact_2digits (const char *&p, const char *end, int &out) noexcept
bool parse_unsigned_digits (const char *&p, const char *end, int min_digits, int max_digits, int64_t &out) noexcept
bool parse_signed_digits (const char *&p, const char *end, int min_digits, int max_digits, int64_t &out) noexcept
bool parse_space_padded_2digits (const char *&p, const char *end, int &out) noexcept
bool parse_meridiem (const char *&p, const char *end, bool uppercase, bool &is_pm) noexcept
bool match_name_token (const char *&p, const char *end, const char *const *names, std::size_t count, int index_base, int &out) noexcept
bool parse_month_token (const char *&p, const char *end, FormatType format, int &month) noexcept
bool parse_weekday_token (const char *&p, const char *end, FormatType format, int &weekday) noexcept
bool parse_tz_offset_token (const char *&p, const char *end, TimeZoneStruct &tz) noexcept
 Parse z timezone token in compact or extended ISO-style form.
bool assign_int_field (bool &has_field, int &field, int value) noexcept
bool assign_year_field (bool &has_field, year_t &field, year_t value) noexcept
bool has_iso_week_date_fields (const FormatParseState &state) noexcept
bool has_gregorian_date_fields (const FormatParseState &state) noexcept
int last_two_digits_of_year (year_t year) noexcept
bool resolve_day_of_year (year_t year, int day_of_year, int &month, int &day) noexcept
int compute_day_of_year (year_t year, int month, int day) noexcept
bool parse_compact_extended_year (const char *&p, const char *end, year_t &out) noexcept
bool parse_format_sequence (const char *&p, const char *end, const char *format_data, std::size_t format_size, FormatParseState &state) noexcept
bool parse_format_token (const char *&p, const char *end, char token, std::size_t repeat_count, FormatParseState &state) noexcept
bool validate_weekday_constraints (const FormatParseState &state, const DateTimeStruct &dt) noexcept
bool resolve_time_fields (const FormatParseState &state, int &hour, int &minute, int &second, int &millisecond) noexcept
bool finalize_calendar_state (FormatParseState &state, DateTimeStruct &out_dt, TimeZoneStruct &out_tz) noexcept
bool finalize_format_parse_state (FormatParseState &state, DateTimeStruct &out_dt, TimeZoneStruct &out_tz) noexcept
bool try_parse_format_core (const char *data, std::size_t length, const char *format, std::size_t format_length, DateTimeStruct &out_dt, TimeZoneStruct &out_tz) noexcept

Function Documentation

◆ assign_int_field()

bool time_shield::detail::format_parse::assign_int_field ( bool & has_field,
int & field,
int value )
inlinenoexcept

Definition at line 329 of file time_format_parser.hpp.

◆ assign_year_field()

bool time_shield::detail::format_parse::assign_year_field ( bool & has_field,
year_t & field,
year_t value )
inlinenoexcept

Definition at line 338 of file time_format_parser.hpp.

◆ compute_day_of_year()

int time_shield::detail::format_parse::compute_day_of_year ( year_t year,
int month,
int day )
inlinenoexcept

Definition at line 395 of file time_format_parser.hpp.

◆ create_format_parse_state()

FormatParseState time_shield::detail::format_parse::create_format_parse_state ( )
inlinenoexcept

Definition at line 74 of file time_format_parser.hpp.

◆ finalize_calendar_state()

bool time_shield::detail::format_parse::finalize_calendar_state ( FormatParseState & state,
DateTimeStruct & out_dt,
TimeZoneStruct & out_tz )
inlinenoexcept

Definition at line 831 of file time_format_parser.hpp.

◆ finalize_format_parse_state()

bool time_shield::detail::format_parse::finalize_format_parse_state ( FormatParseState & state,
DateTimeStruct & out_dt,
TimeZoneStruct & out_tz )
inlinenoexcept

Definition at line 947 of file time_format_parser.hpp.

◆ has_gregorian_date_fields()

bool time_shield::detail::format_parse::has_gregorian_date_fields ( const FormatParseState & state)
inlinenoexcept

Definition at line 353 of file time_format_parser.hpp.

◆ has_iso_week_date_fields()

bool time_shield::detail::format_parse::has_iso_week_date_fields ( const FormatParseState & state)
inlinenoexcept

Definition at line 347 of file time_format_parser.hpp.

◆ is_ascii_digit()

TIME_SHIELD_CONSTEXPR bool time_shield::detail::format_parse::is_ascii_digit ( char c)
inlinenoexcept

Definition at line 117 of file time_format_parser.hpp.

◆ last_two_digits_of_year()

int time_shield::detail::format_parse::last_two_digits_of_year ( year_t year)
inlinenoexcept

Definition at line 362 of file time_format_parser.hpp.

◆ match_literal() [1/2]

bool time_shield::detail::format_parse::match_literal ( const char *& p,
const char * end,
char expected )
inlinenoexcept

Definition at line 121 of file time_format_parser.hpp.

◆ match_literal() [2/2]

bool time_shield::detail::format_parse::match_literal ( const char *& p,
const char * end,
const char * literal )
inlinenoexcept

Definition at line 129 of file time_format_parser.hpp.

◆ match_name_token()

bool time_shield::detail::format_parse::match_name_token ( const char *& p,
const char * end,
const char *const * names,
std::size_t count,
int index_base,
int & out )
inlinenoexcept

Definition at line 232 of file time_format_parser.hpp.

◆ parse_compact_extended_year()

bool time_shield::detail::format_parse::parse_compact_extended_year ( const char *& p,
const char * end,
year_t & out )
inlinenoexcept

Definition at line 404 of file time_format_parser.hpp.

◆ parse_exact_2digits()

bool time_shield::detail::format_parse::parse_exact_2digits ( const char *& p,
const char * end,
int & out )
inlinenoexcept

Definition at line 143 of file time_format_parser.hpp.

◆ parse_format_sequence()

bool time_shield::detail::format_parse::parse_format_sequence ( const char *& p,
const char * end,
const char * format_data,
std::size_t format_size,
FormatParseState & state )
inlinenoexcept

Definition at line 727 of file time_format_parser.hpp.

◆ parse_format_token()

bool time_shield::detail::format_parse::parse_format_token ( const char *& p,
const char * end,
char token,
std::size_t repeat_count,
FormatParseState & state )
inlinenoexcept

Definition at line 460 of file time_format_parser.hpp.

◆ parse_meridiem()

bool time_shield::detail::format_parse::parse_meridiem ( const char *& p,
const char * end,
bool uppercase,
bool & is_pm )
inlinenoexcept

Definition at line 207 of file time_format_parser.hpp.

◆ parse_month_token()

bool time_shield::detail::format_parse::parse_month_token ( const char *& p,
const char * end,
FormatType format,
int & month )
inlinenoexcept

Definition at line 261 of file time_format_parser.hpp.

◆ parse_signed_digits()

bool time_shield::detail::format_parse::parse_signed_digits ( const char *& p,
const char * end,
int min_digits,
int max_digits,
int64_t & out )
inlinenoexcept

Definition at line 174 of file time_format_parser.hpp.

◆ parse_space_padded_2digits()

bool time_shield::detail::format_parse::parse_space_padded_2digits ( const char *& p,
const char * end,
int & out )
inlinenoexcept

Definition at line 195 of file time_format_parser.hpp.

◆ parse_tz_offset_token()

bool time_shield::detail::format_parse::parse_tz_offset_token ( const char *& p,
const char * end,
TimeZoneStruct & tz )
inlinenoexcept

Parse z timezone token in compact or extended ISO-style form.

Supported forms are +HHMM, -HHMM, +HH:MM, and -HH:MM.

Definition at line 310 of file time_format_parser.hpp.

◆ parse_unsigned_digits()

bool time_shield::detail::format_parse::parse_unsigned_digits ( const char *& p,
const char * end,
int min_digits,
int max_digits,
int64_t & out )
inlinenoexcept

Definition at line 152 of file time_format_parser.hpp.

◆ parse_weekday_token()

bool time_shield::detail::format_parse::parse_weekday_token ( const char *& p,
const char * end,
FormatType format,
int & weekday )
inlinenoexcept

Definition at line 286 of file time_format_parser.hpp.

◆ resolve_day_of_year()

bool time_shield::detail::format_parse::resolve_day_of_year ( year_t year,
int day_of_year,
int & month,
int & day )
inlinenoexcept

Definition at line 367 of file time_format_parser.hpp.

◆ resolve_time_fields()

bool time_shield::detail::format_parse::resolve_time_fields ( const FormatParseState & state,
int & hour,
int & minute,
int & second,
int & millisecond )
inlinenoexcept

Definition at line 802 of file time_format_parser.hpp.

◆ try_parse_format_core()

bool time_shield::detail::format_parse::try_parse_format_core ( const char * data,
std::size_t length,
const char * format,
std::size_t format_length,
DateTimeStruct & out_dt,
TimeZoneStruct & out_tz )
inlinenoexcept

Definition at line 979 of file time_format_parser.hpp.

◆ validate_weekday_constraints()

bool time_shield::detail::format_parse::validate_weekday_constraints ( const FormatParseState & state,
const DateTimeStruct & dt )
inlinenoexcept

Definition at line 780 of file time_format_parser.hpp.