Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
time_parser.hpp File Reference

Header file with functions for parsing dates and times in ISO8601 format and converting them to various timestamp formats. More...

#include "enums.hpp"
#include "constants.hpp"
#include "date_time_struct.hpp"
#include "time_zone_struct.hpp"
#include "validation.hpp"
#include "time_conversions.hpp"
#include <regex>
#include <algorithm>
#include <locale>
#include <array>
#include <stdexcept>

Go to the source code of this file.

Namespaces

namespace  time_shield
 Main namespace for the Time Shield library.
 

Macros

#define _TIME_SHIELD_TIME_PARSER_HPP_INCLUDED
 

Functions

template<class T = Month>
const T time_shield::get_month_number (const std::string &month)
 Get the month number by name.
 
template<class T = Month>
const T time_shield::month_of_year (const std::string &month)
 Alias for get_month_number function.
 
template<class T = Month>
const bool time_shield::try_get_month_number (const std::string &month, T &value)
 Get the month number by name, with output parameter.
 
template<class T = Month>
const bool time_shield::get_month_number (const std::string &month, T &value)
 Alias for try_get_month_number function.
 
template<class T = Month>
const bool time_shield::month_of_year (const std::string &month, T &value)
 Alias for try_get_month_number function.
 
const bool time_shield::parse_time_zone (const std::string &tz_str, TimeZoneStruct &tz)
 Parse a time zone string into a TimeZoneStruct.
 
const bool time_shield::parse_tz (const std::string &tz_str, TimeZoneStruct &tz)
 Alias for parse_time_zone function.
 
const bool time_shield::parse_iso8601 (const std::string &input, DateTimeStruct &dt, TimeZoneStruct &tz)
 Parse a date and time string in ISO8601 format.
 
const bool time_shield::str_to_ts (const std::string &str, ts_t &ts)
 Convert an ISO8601 string to a timestamp (ts_t).
 
const bool time_shield::str_to_ts_ms (const std::string &str, ts_ms_t &ts)
 Convert an ISO8601 string to a millisecond timestamp (ts_ms_t).
 
const bool time_shield::str_to_fts (const std::string &str, fts_t &ts)
 Convert an ISO8601 string to a floating-point timestamp (fts_t).
 
const ts_t time_shield::ts (const std::string &str)
 Convert an ISO8601 string to a timestamp (ts_t).
 
const ts_ms_t time_shield::ts_ms (const std::string &str)
 Convert an ISO8601 string to a millisecond timestamp (ts_ms_t).
 
const fts_t time_shield::fts (const std::string &str)
 Convert an ISO8601 string to a floating-point timestamp (fts_t).
 
const ts_t time_shield::ts (const char *str)
 Convert an ISO8601 C-style string to a timestamp (ts_t).
 
const ts_ms_t time_shield::ts_ms (const char *str)
 Convert an ISO8601 C-style string to a millisecond timestamp (ts_ms_t).
 
const fts_t time_shield::fts (const char *str)
 Convert an ISO8601 C-style string to a floating-point timestamp (fts_t).
 

Detailed Description

Header file with functions for parsing dates and times in ISO8601 format and converting them to various timestamp formats.

This file contains functions for parsing ISO8601 date and time strings, extracting month numbers from month names, and converting parsed date and time information to different timestamp formats.

Definition in file time_parser.hpp.

Macro Definition Documentation

◆ _TIME_SHIELD_TIME_PARSER_HPP_INCLUDED

#define _TIME_SHIELD_TIME_PARSER_HPP_INCLUDED

Definition at line 8 of file time_parser.hpp.