Scid  4.7.0
Macros | Functions | Variables
date.h File Reference
#include "common.h"
#include <algorithm>
#include <cstdlib>
Include dependency graph for date.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DATE_MAKE(y, m, d)   (((y) << YEAR_SHIFT) | ((m) << MONTH_SHIFT) | (d))
 

Functions

uint date_GetYear (dateT date)
 
uint date_GetMonth (dateT date)
 
uint date_GetDay (dateT date)
 
uint date_GetMonthDay (dateT date)
 
void date_DecodeToString (dateT date, char *str)
 
dateT date_EncodeFromString (const char *str)
 
dateT date_parsePGNTag (const char *str, size_t len)
 Creates a dateT object from a PGN tag value string. More...
 
dateT date_parsePGNTag (std::pair< const char *, const char *> str)
 

Variables

const dateT ZERO_DATE = 0
 
const uint YEAR_SHIFT = 9
 
const uint MONTH_SHIFT = 5
 
const uint DAY_SHIFT = 0
 
const uint YEAR_MAX = 2047
 

Macro Definition Documentation

◆ DATE_MAKE

#define DATE_MAKE (   y,
  m,
 
)    (((y) << YEAR_SHIFT) | ((m) << MONTH_SHIFT) | (d))

Definition at line 45 of file date.h.

Function Documentation

◆ date_DecodeToString()

void date_DecodeToString ( dateT  date,
char *  str 
)
inline

Definition at line 87 of file date.h.

◆ date_EncodeFromString()

dateT date_EncodeFromString ( const char *  str)
inline

Definition at line 127 of file date.h.

◆ date_GetDay()

uint date_GetDay ( dateT  date)
inline

Definition at line 70 of file date.h.

◆ date_GetMonth()

uint date_GetMonth ( dateT  date)
inline

Definition at line 61 of file date.h.

◆ date_GetMonthDay()

uint date_GetMonthDay ( dateT  date)
inline

Definition at line 79 of file date.h.

◆ date_GetYear()

uint date_GetYear ( dateT  date)
inline

Definition at line 52 of file date.h.

◆ date_parsePGNTag() [1/2]

dateT date_parsePGNTag ( const char *  str,
size_t  len 
)
inline

Creates a dateT object from a PGN tag value string.

"The Date tag value field always uses a standard ten character format: "YYYY.MM.DD". If the any of the digit fields are not known, then question marks are used in place of the digits."

Parameters
strpointer to the memory containing the tag value.
lenlength of the tag value.
Returns
the dateT object corresponding to str.

Definition at line 166 of file date.h.

◆ date_parsePGNTag() [2/2]

dateT date_parsePGNTag ( std::pair< const char *, const char *>  str)
inline

Definition at line 193 of file date.h.

Variable Documentation

◆ DAY_SHIFT

const uint DAY_SHIFT = 0

Definition at line 39 of file date.h.

◆ MONTH_SHIFT

const uint MONTH_SHIFT = 5

Definition at line 38 of file date.h.

◆ YEAR_MAX

const uint YEAR_MAX = 2047

Definition at line 43 of file date.h.

◆ YEAR_SHIFT

const uint YEAR_SHIFT = 9

Definition at line 37 of file date.h.

◆ ZERO_DATE

const dateT ZERO_DATE = 0

Definition at line 35 of file date.h.