ost::Time(3)
π 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 atime_t.ost::Time::Time (tm * dt)β constructor, taking atm *.ost::Time::Time (char * str, size_t size = 0)β constructor from a string, withsizedefaulting to0.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 achar * buf.int ost::Time::getHour (void) constβ hands you the hour as anint.int ost::Time::getMinute (void) constβ hands you the minute as anint.int ost::Time::getSecond (void) constβ hands you the second as anint.char* ost::Time::getTime (char * buffer) constβ gives you the time as achar*, written intobuffer.tm* ost::Time::getTime (tm * buf) constβ gives you the time as atm*, written intobuf.time_t ost::Time::getTime (void) constβ gives you the time as atime_t.long ost::Time::getValue (void) constβ gives you the value as along.bool ost::Time::isValid (void) constβ tells you whether it's valid, as abool. vibe check, but make it a return value. βost::Time::operator long () [inline]β inline conversion operator tolong.bool ost::Time::operator! () const [inline]β inline!operator, returns abool.int ost::Time::operator!= (const Time & time)β inequality, returns anint.String ost::Time::operator() () constβ the call operator, returns aString. she's callable and she's a string. versatile. πTime& ost::Time::operator++ ()β prefix increment, returns aTime&.Time& ost::Time::operator+= (const int val)β addsvalto yourself, returns aTime&.Time& ost::Time::operator-- ()β prefix decrement, returns aTime&.Time& ost::Time::operator-= (const int val)β subtractsval, returns aTime&.int ost::Time::operator< (const Time & time)β less-than, returns anint.int ost::Time::operator<= (const Time & time)β less-than-or-equal, returns anint.int ost::Time::operator== (const Time & time)β equality, returns anint.int ost::Time::operator> (const Time & time)β greater-than, returns anint.int ost::Time::operator>= (const Time & time)β greater-than-or-equal, returns anint.void ost::Time::setTime (char * str, size_t size = 0)β sets the time from a string, withsizedefaulting to0.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 β¨
π«Ά Friends And Related Function Documentation π«Ά
these ones are friends, so they get access to the inner circle π
Time operator+ (const int val, const Time & time) [friend]βintplusTime, returns aTime.Time operator+ (const Time & time, const int val) [friend]βTimeplusint, returns aTime.Time operator+ (const Time & time1, const Time & time2) [friend]βTimeplusTime, returns aTime.Time operator- (const int val, const Time & time) [friend]βintminusTime, returns aTime.Time operator- (const Time & time, const int val) [friend]βTimeminusint, returns aTime.Time operator- (const Time & time1, const Time & time2) [friend]βTimeminusTime, returns aTime.
π Member Data Documentation π
long ost::Time::seconds [protected]β the protectedlongnamedseconds. 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
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms