ost::Time(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– ost::Time(3) β€” the girlies' guide to integer time πŸ’–

okay so bestie, you've landed on the manual page for ost::Time, part of the Library Functions Manual β€” and honestly? it's giving "time is just a number and I can prove it." no cap. let's get into it πŸ’…


✨ NAME ✨

ost::Time β€” the Time class uses a integer representation of the current time. that's it, that's the whole vibe πŸ•βœ¨


🌸 SYNOPSIS 🌸

#include <numbers.h>

lowkey important: Inherited by ost::Datetime. so Datetime is literally the child of Time. generational. πŸ‘‘

πŸŽ€ Public Member Functions

Time (time_t tm)
Time (tm *dt)
Time (char *str, size_t size=0)
Time (int hour, int minute, int second)
Time ()
virtual ~Time ()
long getValue (void) const
int getHour (void) const
int getMinute (void) const
int getSecond (void) const
char * getTime (char *buffer) const
time_t getTime (void) const
tm * getTime (tm *buf) const
void setTime (char *str, size_t size=0)
bool isValid (void) const
operator long ()
String operator() () const
Time & operator++ ()
Time & operator-- ()
Time & operator+= (const int val)
Time & operator-= (const int val)
int operator== (const Time &time)
int operator!= (const Time &time)
int operator< (const Time &time)
int operator<= (const Time &time)
int operator> (const Time &time)
int operator>= (const Time &time)
bool operator! () const

πŸ¦‹ Protected Member Functions

void toSeconds (int hour, int minute, int second)
void fromSeconds (char *buf) const
virtual void update (void)

🌈 Protected Attributes

long seconds

πŸ’œ Friends

Time operator+ (const Time &time1, const Time &time2)
Time operator- (const Time &time1, const Time &time2)
Time operator+ (const Time &time, const int val)
Time operator- (const Time &time, const int val)
Time operator+ (const int val, const Time &time)
Time operator- (const int val, const Time &time)

⭐ Detailed Description ⭐

The Time class uses a integer representation of the current time.

This is then manipulated in several forms and may be exported as needed. πŸ’«

it's literally integer-based time class energy and I'm obsessed. 🫢

🧚 Author

Marcelo Dalmas mad@brasmap.com.br


πŸ’… Constructor & Destructor Documentation πŸ’…

  • ost::Time::Time (time_t tm) β€” constructor, taking a time_t.
  • ost::Time::Time (tm * dt) β€” constructor, taking a tm *.
  • ost::Time::Time (char * str, size_t size = 0) β€” constructor from a string, with size defaulting to 0.
  • ost::Time::Time (int hour, int minute, int second) β€” constructor from an hour, a minute and a second.
  • ost::Time::Time () β€” the no-argument constructor, default queen. πŸ’–
  • virtual ost::Time::~Time () [virtual] β€” the virtual destructor. she cleans up after herself, as she should. ✨

πŸ”₯ Member Function Documentation πŸ”₯

  • void ost::Time::fromSeconds (char * buf) const [protected] β€” protected, takes a char * buf.
  • int ost::Time::getHour (void) const β€” hands you the hour as an int.
  • int ost::Time::getMinute (void) const β€” hands you the minute as an int.
  • int ost::Time::getSecond (void) const β€” hands you the second as an int.
  • char* ost::Time::getTime (char * buffer) const β€” gives you the time as a char*, written into buffer.
  • tm* ost::Time::getTime (tm * buf) const β€” gives you the time as a tm*, written into buf.
  • time_t ost::Time::getTime (void) const β€” gives you the time as a time_t.
  • long ost::Time::getValue (void) const β€” gives you the value as a long.
  • bool ost::Time::isValid (void) const β€” tells you whether it's valid, as a bool. vibe check, but make it a return value. βœ…
  • ost::Time::operator long () [inline] β€” inline conversion operator to long.
  • bool ost::Time::operator! () const [inline] β€” inline ! operator, returns a bool.
  • int ost::Time::operator!= (const Time & time) β€” inequality, returns an int.
  • String ost::Time::operator() () const β€” the call operator, returns a String. she's callable and she's a string. versatile. πŸ’…
  • Time& ost::Time::operator++ () β€” prefix increment, returns a Time&.
  • Time& ost::Time::operator+= (const int val) β€” adds val to yourself, returns a Time&.
  • Time& ost::Time::operator-- () β€” prefix decrement, returns a Time&.
  • Time& ost::Time::operator-= (const int val) β€” subtracts val, returns a Time&.
  • int ost::Time::operator< (const Time & time) β€” less-than, returns an int.
  • int ost::Time::operator<= (const Time & time) β€” less-than-or-equal, returns an int.
  • int ost::Time::operator== (const Time & time) β€” equality, returns an int.
  • int ost::Time::operator> (const Time & time) β€” greater-than, returns an int.
  • int ost::Time::operator>= (const Time & time) β€” greater-than-or-equal, returns an int.
  • void ost::Time::setTime (char * str, size_t size = 0) β€” sets the time from a string, with size defaulting to 0.
  • void ost::Time::toSeconds (int hour, int minute, int second) [protected] β€” protected; takes an hour, a minute and a second.
  • virtual void ost::Time::update (void) [protected], [virtual] β€” protected and virtual. the customizable core update moment ✨

these ones are friends, so they get access to the inner circle πŸ”

  • Time operator+ (const int val, const Time & time) [friend] β€” int plus Time, returns a Time.
  • Time operator+ (const Time & time, const int val) [friend] β€” Time plus int, returns a Time.
  • Time operator+ (const Time & time1, const Time & time2) [friend] β€” Time plus Time, returns a Time.
  • Time operator- (const int val, const Time & time) [friend] β€” int minus Time, returns a Time.
  • Time operator- (const Time & time, const int val) [friend] β€” Time minus int, returns a Time.
  • Time operator- (const Time & time1, const Time & time2) [friend] β€” Time minus Time, returns a Time.

πŸ’€ Member Data Documentation πŸ’€

  • long ost::Time::seconds [protected] β€” the protected long named seconds. that's where the whole integer-time situation lives, bestie. πŸ•°οΈ

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for GNU CommonC++ from the source code.

so yes, a robot wrote the original and I rewrote it with the group chat energy it deserved. no cap. πŸ˜­πŸ’–


sign-off time πŸŽ€ this little masterpiece came from GNU CommonC++, dated Sun Dec 27 2020, and it lives at ost::Time(3). periodt. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from