Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
Time Enumerations

Enumerations for time-related concepts. More...

Enumerations

enum  time_shield::FormatType { time_shield::UPPERCASE_NAME = 0 , time_shield::SHORT_NAME , time_shield::FULL_NAME }
 Enumeration of the format options for representing a weekday or month. More...
 
enum  time_shield::Weekday {
  time_shield::SUN = 0 , time_shield::MON , time_shield::TUE , time_shield::WED ,
  time_shield::THU , time_shield::FRI , time_shield::SAT
}
 Enumeration of the days of the week. More...
 
enum  time_shield::Month {
  time_shield::JAN = 1 , time_shield::FEB , time_shield::MAR , time_shield::APR ,
  time_shield::MAY , time_shield::JUN , time_shield::JUL , time_shield::AUG ,
  time_shield::SEP , time_shield::OCT , time_shield::NOV , time_shield::DEC
}
 Enumeration of the months of the year. More...
 
enum  time_shield::TimeZone {
  time_shield::GMT , time_shield::UTC , time_shield::EET , time_shield::CET ,
  time_shield::WET , time_shield::EEST , time_shield::CEST , time_shield::WEST ,
  time_shield::UNKNOWN
}
 Enumeration of the time zones. More...
 
enum  time_shield::MoonPhase {
  time_shield::WAXING_CRESCENT , time_shield::FIRST_QUARTER , time_shield::WAXING_GIBBOUS , time_shield::FULL_MOON ,
  time_shield::WANING_GIBBOUS , time_shield::LAST_QUARTER , time_shield::WANING_CRESCENT , time_shield::NEW_MOON
}
 Enumeration of the moon phases. More...
 
enum  time_shield::TimeFormatType {
  time_shield::ISO8601_WITH_TZ , time_shield::ISO8601_NO_TZ , time_shield::MQL5_FULL , time_shield::MQL5_DATE_ONLY ,
  time_shield::MQL5_TIME_ONLY , time_shield::AMERICAN_MONTH_DAY , time_shield::EUROPEAN_MONTH_DAY , time_shield::AMERICAN_TIME ,
  time_shield::EUROPEAN_TIME
}
 Enumeration of time format types. More...
 

Functions

const char * time_shield::to_cstr (Weekday value, FormatType format=UPPERCASE_NAME)
 Converts a Weekday enum value to a string.
 
const std::string & time_shield::to_str (Weekday value, FormatType format=UPPERCASE_NAME)
 Converts a Weekday enum value to a string.
 
const char * time_shield::to_cstr (Month value, FormatType format=UPPERCASE_NAME)
 Converts a Month enum value to a string.
 
const std::string & time_shield::to_str (Month value, FormatType format=UPPERCASE_NAME)
 Converts a Month enum value to a string.
 
const char * time_shield::to_cstr (TimeZone value, FormatType format=UPPERCASE_NAME)
 Converts a TimeZone enum value to a string.
 
const std::string & time_shield::to_str (TimeZone value, FormatType format=UPPERCASE_NAME)
 Converts a TimeZone enum value to a string.
 

Detailed Description

Enumerations for time-related concepts.

This group contains various enums that represent time-related concepts such as weekdays, months, time zones, and formatting options.

Key Features:

Example Usage:

std::cout << time_shield::to_cstr(weekday, time_shield::FormatType::FULL_NAME); // "Monday"
const char * to_cstr(Weekday value, FormatType format=UPPERCASE_NAME)
Converts a Weekday enum value to a string.
Definition enums.hpp:55
@ FULL_NAME
Full name.
Definition enums.hpp:36
@ MON
Monday.
Definition enums.hpp:42

Enumeration Type Documentation

◆ FormatType

Enumeration of the format options for representing a weekday or month.

Enumerator
UPPERCASE_NAME 

Uppercase short name.

SHORT_NAME 

Short name.

FULL_NAME 

Full name.

Definition at line 33 of file enums.hpp.

◆ Month

Enumeration of the months of the year.

Enumerator
JAN 

January.

FEB 

February.

MAR 

March.

APR 

April.

MAY 

May.

JUN 

June.

JUL 

July.

AUG 

August.

SEP 

September.

OCT 

October.

NOV 

November.

DEC 

December.

Definition at line 103 of file enums.hpp.

◆ MoonPhase

Enumeration of the moon phases.

Enumerator
WAXING_CRESCENT 

Waxing Crescent Moon.

FIRST_QUARTER 

First Quarter Moon.

WAXING_GIBBOUS 

Waxing Gibbous Moon.

FULL_MOON 

Full Moon.

WANING_GIBBOUS 

Waning Gibbous Moon.

LAST_QUARTER 

Last Quarter Moon.

WANING_CRESCENT 

Waning Crescent Moon.

NEW_MOON 

New Moon.

Definition at line 252 of file enums.hpp.

◆ TimeFormatType

Enumeration of time format types.

Enumerator
ISO8601_WITH_TZ 

ISO8601 format with time zone (e.g., "2024-06-06T12:30:45+03:00")

ISO8601_NO_TZ 

ISO8601 format without time zone (e.g., "2024-06-06T12:30:45")

MQL5_FULL 

MQL5 time format (e.g., "2024.06.06 12:30:45")

MQL5_DATE_ONLY 

MQL5 date format (e.g., "2024.06.06")

MQL5_TIME_ONLY 

MQL5 time format (e.g., "12:30:45")

AMERICAN_MONTH_DAY 

American date format (e.g., "06/06/2024")

EUROPEAN_MONTH_DAY 

European date format (e.g., "06.06.2024")

AMERICAN_TIME 

American time format (e.g., "12:30 PM")

EUROPEAN_TIME 

European time format (e.g., "12:30")

Definition at line 264 of file enums.hpp.

◆ TimeZone

Enumeration of the time zones.

Enumerator
GMT 

Greenwich Mean Time.

UTC 

Coordinated Universal Time.

EET 

Eastern European Time.

CET 

Central European Time.

WET 

Western European Time.

EEST 

Eastern European Summer Time.

CEST 

Central European Summer Time.

WEST 

Western European Summer Time.

UNKNOWN 

Unknown Time Zone.

Definition at line 183 of file enums.hpp.

◆ Weekday

Enumeration of the days of the week.

Enumerator
SUN 

Sunday.

MON 

Monday.

TUE 

Tuesday.

WED 

Wednesday.

THU 

Thursday.

FRI 

Friday.

SAT 

Saturday.

Definition at line 40 of file enums.hpp.

Function Documentation

◆ to_cstr() [1/3]

const char * time_shield::to_cstr ( Month value,
FormatType format = UPPERCASE_NAME )

Converts a Month enum value to a string.

Parameters
valueThe Month enum value to convert.
formatThe format to use for the string representation (default is UPPERCASE_NAME).
Returns
A const char* pointing to the string representation of the month.

Definition at line 123 of file enums.hpp.

◆ to_cstr() [2/3]

const char * time_shield::to_cstr ( TimeZone value,
FormatType format = UPPERCASE_NAME )

Converts a TimeZone enum value to a string.

Parameters
valueThe TimeZone enum value to convert.
formatThe format to use for the string representation (default is UPPERCASE_NAME).
Returns
A const char* pointing to the string representation of the time zone.

Definition at line 200 of file enums.hpp.

◆ to_cstr() [3/3]

const char * time_shield::to_cstr ( Weekday value,
FormatType format = UPPERCASE_NAME )

Converts a Weekday enum value to a string.

Parameters
valueThe Weekday enum value to convert.
formatThe format to use for the string representation (default is UPPERCASE_NAME).
Returns
A const char* pointing to the string representation of the day.

Definition at line 55 of file enums.hpp.

◆ to_str() [1/3]

const std::string & time_shield::to_str ( Month value,
FormatType format = UPPERCASE_NAME )

Converts a Month enum value to a string.

Parameters
valueThe Month enum value to convert.
formatThe format to use for the string representation (default is UPPERCASE_NAME).
Returns
A const std::string& pointing to the string representation of the month.

Definition at line 155 of file enums.hpp.

◆ to_str() [2/3]

const std::string & time_shield::to_str ( TimeZone value,
FormatType format = UPPERCASE_NAME )

Converts a TimeZone enum value to a string.

Parameters
valueThe TimeZone enum value to convert.
formatThe format to use for the string representation (default is UPPERCASE_NAME).
Returns
A const std::string& pointing to the string representation of the time zone.

Definition at line 228 of file enums.hpp.

◆ to_str() [3/3]

const std::string & time_shield::to_str ( Weekday value,
FormatType format = UPPERCASE_NAME )

Converts a Weekday enum value to a string.

Parameters
valueThe Weekday enum value to convert.
formatThe format to use for the string representation (default is UPPERCASE_NAME).
Returns
A const std::string& pointing to the string representation of the day.

Definition at line 81 of file enums.hpp.