AceTime  0.1
Date and time classes for Arduino that supports the TZ DAtabase, and a system clock synchronized from an NTP server or an RTC chip.
Public Member Functions | Static Public Attributes | List of all members
ace_time::common::DateStrings Class Reference

Class that translates a numeric month (1-12) or weekDay (1-7) into a human readable string. More...

#include <DateStrings.h>

Public Member Functions

const char * monthLongString (uint8_t month) const
 Return the long month name. More...
 
const char * monthShortString (uint8_t month) const
 Return the short month name. More...
 
const char * weekDayLongString (uint8_t weekDay) const
 Return the short weekDay name. More...
 
const char * weekDayShortString (uint8_t weekDay) const
 Return the short weekDay name. More...
 

Static Public Attributes

static const uint8_t kBufferSize = 10
 Length of the longest month or week name, including the '\0' terminator.
 
static const uint8_t kShortNameLength = 3
 Number of prefix characters to use to create a short name. More...
 

Detailed Description

Class that translates a numeric month (1-12) or weekDay (1-7) into a human readable string.

Both long and short versions can be retrieved. The object uses an internal char[] buffer to store the result strings, so the strings must be used before DateStrings object is destroyed. This also means that the object is not thread-safe but Arduino boards are single-threaded currently so we don't have to worry about this.

Inspired by the DateStrings.cpp file in https://github.com/PaulStoffregen/Time/blob/master/DateStrings.cpp.

Definition at line 22 of file DateStrings.h.

Member Function Documentation

const char* ace_time::common::DateStrings::monthLongString ( uint8_t  month) const
inline

Return the long month name.

0=Error, 1=January, 12=December.

Definition at line 33 of file DateStrings.h.

const char* ace_time::common::DateStrings::monthShortString ( uint8_t  month) const
inline

Return the short month name.

0=Err, 1=Jan, 12=Dec.

Definition at line 40 of file DateStrings.h.

const char* ace_time::common::DateStrings::weekDayLongString ( uint8_t  weekDay) const
inline

Return the short weekDay name.

0=Error, 1=Monday, 7=Sunday.

Definition at line 48 of file DateStrings.h.

const char* ace_time::common::DateStrings::weekDayShortString ( uint8_t  weekDay) const
inline

Return the short weekDay name.

0=Err, 1=Mon, 7=Sun.

Definition at line 55 of file DateStrings.h.

Member Data Documentation

const uint8_t ace_time::common::DateStrings::kShortNameLength = 3
static

Number of prefix characters to use to create a short name.

Definition at line 30 of file DateStrings.h.


The documentation for this class was generated from the following files: