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

Header file with time-related validation functions. More...

#include "config.hpp"
#include "types.hpp"
#include "constants.hpp"
#include "time_zone_struct.hpp"

Go to the source code of this file.

Namespaces

namespace  time_shield
 Main namespace for the Time Shield library.
 

Macros

#define _TIME_SHIELD_VALIDATION_HPP_INCLUDED
 

Functions

template<class T = year_t>
constexpr const bool time_shield::is_leap_year_date (T year) noexcept
 Checks if the given year is a leap year.
 
template<class T = year_t>
constexpr const bool time_shield::check_leap_year (T year) noexcept
 Alias for is_leap_year_date function.
 
template<class T = year_t>
constexpr const bool time_shield::leap_year (T year) noexcept
 Alias for is_leap_year_date function.
 
TIME_SHIELD_CONSTEXPR const bool time_shield::is_leap_year_ts (ts_t ts)
 Checks if the given year is a leap year.
 
TIME_SHIELD_CONSTEXPR const bool time_shield::leap_year_ts (ts_t ts)
 Alias for is_leap_year_ts function.
 
TIME_SHIELD_CONSTEXPR const bool time_shield::check_leap_year_ts (ts_t ts)
 Alias for is_leap_year_ts function.
 
TIME_SHIELD_CONSTEXPR const bool time_shield::is_leap_year (ts_t ts)
 Alias for is_leap_year_ts function.
 
template<class T = int>
TIME_SHIELD_CONSTEXPR const bool time_shield::is_valid_time_zone (T hour, T min) noexcept
 Check if the time zone is valid.
 
template<class T = int>
TIME_SHIELD_CONSTEXPR bool time_shield::is_valid_tz (T hour, T min)
 Alias for is_valid_time_zone function.
 
template<class T = TimeZoneStruct>
TIME_SHIELD_CONSTEXPR const bool time_shield::is_valid_time_zone_offset (const T &time_zone) noexcept
 Check if the time zone is valid.
 
template<class T = TimeZoneStruct>
TIME_SHIELD_CONSTEXPR const bool time_shield::is_valid_time_zone (const T &time_zone)
 Alias for is_valid_time_zone_offset function.
 
template<class T = TimeZoneStruct>
TIME_SHIELD_CONSTEXPR const bool time_shield::is_valid_tz (const T &time_zone)
 Alias for is_valid_time_zone_offset function.
 
template<class T1 = int, class T2 = int>
TIME_SHIELD_CONSTEXPR const bool time_shield::is_valid_time (T1 hour, T1 min, T1 sec, T2 ms=0) noexcept
 Checks the correctness of the specified time.
 
template<class T >
TIME_SHIELD_CONSTEXPR const bool time_shield::is_valid_time (const T &time) noexcept
 Checks the correctness of the specified time.
 
template<class T1 = year_t, class T2 = int>
TIME_SHIELD_CONSTEXPR const bool time_shield::is_valid_date (T1 year, T2 month, T2 day) noexcept
 Checks the correctness of the specified date.
 
template<class T >
TIME_SHIELD_CONSTEXPR const bool time_shield::is_valid_date (const T &date) noexcept
 Checks the correctness of the specified date.
 
template<class T1 = year_t, class T2 = int, class T3 = int>
TIME_SHIELD_CONSTEXPR const bool time_shield::is_valid_date_time (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0, T3 ms=0) noexcept
 Checks the correctness of a date and time.
 
template<class T >
TIME_SHIELD_CONSTEXPR const bool time_shield::is_valid_date_time (const T &date_time) noexcept
 Checks the correctness of a date and time.
 
TIME_SHIELD_CONSTEXPR const bool time_shield::is_day_off (ts_t ts) noexcept
 Check if a given timestamp corresponds to a weekend day (Saturday or Sunday).
 
TIME_SHIELD_CONSTEXPR const bool time_shield::is_weekend (ts_t ts) noexcept
 Alias for is_day_off function.
 
template<class T = uday_t>
TIME_SHIELD_CONSTEXPR bool time_shield::is_day_off_unix_day (T unix_day) noexcept
 Check if a given day (since Unix epoch) corresponds to a weekend day (Saturday or Sunday). This function checks if the given day (number of days since Unix epoch) falls on a weekend day, which is either Saturday or Sunday.
 
template<class T = uday_t>
TIME_SHIELD_CONSTEXPR bool time_shield::is_weekend_unix_day (T unix_day) noexcept
 Alias for is_day_off_unix_day function.
 

Detailed Description

Header file with time-related validation functions.

This file contains functions for validating dates, times, and timestamps.

Definition in file validation.hpp.

Macro Definition Documentation

◆ _TIME_SHIELD_VALIDATION_HPP_INCLUDED

#define _TIME_SHIELD_VALIDATION_HPP_INCLUDED

Definition at line 7 of file validation.hpp.