44 #ifndef CCXX_NUMBERS_H_
45 #define CCXX_NUMBERS_H_
47 #ifndef CCXX_THREAD_H_
51 #ifndef CCXX_MISSING_H_
55 #ifndef CCXX_STRCHAR_H_
59 #ifndef CCXX_STRING_H_
63 #ifndef CCXX_THREAD_H_
69 #ifdef CCXX_NAMESPACES
97 Number(
char *buffer,
unsigned size);
99 void setValue(
long value);
103 long getValue()
const;
106 {
return getValue();};
109 {
return getValue();};
114 long operator=(
const long value);
115 long operator+=(
const long value);
116 long operator-=(
const long value);
119 int operator==(
const Number &num);
120 int operator!=(
const Number &num);
121 int operator<(
const Number &num);
122 int operator<=(
const Number &num);
123 int operator>(
const Number &num);
124 int operator>=(
const Number &num);
126 friend long operator+(
const Number &num,
const long val);
127 friend long operator+(
const long val,
const Number &num);
128 friend long operator-(
const Number &num,
long val);
129 friend long operator-(
const long val,
const Number &num);
135 ZNumber(
char *buf,
unsigned size);
136 void setValue(
long value);
137 long operator=(
long value);
154 void toJulian(
long year,
long month,
long day);
155 void fromJulian(
char *buf)
const;
161 virtual void update(
void);
167 Date(
char *str,
size_t size = 0);
168 Date(
int year,
unsigned month,
unsigned day);
172 int getYear(
void)
const;
173 unsigned getMonth(
void)
const;
174 unsigned getDay(
void)
const;
175 unsigned getDayOfWeek(
void)
const;
176 char *getDate(
char *buffer)
const;
177 time_t getDate(
void)
const;
178 time_t getDate(tm *buf)
const;
179 long getValue(
void)
const;
180 void setDate(
const char *str,
size_t size = 0);
181 bool isValid(
void)
const;
183 friend Date operator+(
const Date &date,
const long val);
184 friend Date operator-(
const Date &date,
const long val);
185 friend Date operator+(
const long val,
const Date &date);
186 friend Date operator-(
const long val,
const Date &date);
188 operator long()
const
189 {
return getValue();};
191 String operator()()
const;
194 Date& operator+=(
const long val);
195 Date& operator-=(
const long val);
196 int operator==(
const Date &date);
197 int operator!=(
const Date &date);
198 int operator<(
const Date &date);
199 int operator<=(
const Date &date);
200 int operator>(
const Date &date);
201 int operator>=(
const Date &date);
203 {
return !isValid();};
221 void toSeconds(
int hour,
int minute,
int second);
222 void fromSeconds(
char *buf)
const;
223 virtual void update(
void);
228 Time(
char *str,
size_t size = 0);
229 Time(
int hour,
int minute,
int second);
233 long getValue(
void)
const;
234 int getHour(
void)
const;
235 int getMinute(
void)
const;
236 int getSecond(
void)
const;
237 char *getTime(
char *buffer)
const;
238 time_t getTime(
void)
const;
239 tm *getTime(tm *buf)
const;
240 void setTime(
char *str,
size_t size = 0);
241 bool isValid(
void)
const;
243 friend Time operator+(
const Time &time1,
const Time &time2);
244 friend Time operator-(
const Time &time1,
const Time &time2);
245 friend Time operator+(
const Time &time,
const int val);
246 friend Time operator-(
const Time &time,
const int val);
247 friend Time operator+(
const int val,
const Time &time);
248 friend Time operator-(
const int val,
const Time &time);
251 {
return getValue();};
253 String operator()()
const;
256 Time& operator+=(
const int val);
257 Time& operator-=(
const int val);
258 int operator==(
const Time &time);
259 int operator!=(
const Time &time);
260 int operator<(
const Time &time);
261 int operator<=(
const Time &time);
262 int operator>(
const Time &time);
263 int operator>=(
const Time &time);
265 {
return !isValid();};
283 Datetime(
const char *str,
size_t size = 0);
284 Datetime(
int year,
unsigned month,
unsigned day,
int hour,
int minute,
int second);
288 char *getDatetime(
char *buffer)
const;
289 time_t getDatetime(
void)
const;
290 bool isValid(
void)
const;
304 bool operator!()
const;
306 String strftime(
const char *format)
const;
319 {fromJulian(buffer);};
326 #ifdef CCXX_NAMESPACES
Common C++ generic string class.
The Time class uses a integer representation of the current time.
The Datetime class uses a julian date representation of the current year, month, and day and a intege...
substitute functions which may be missing in target platform libc.
const char * getBuffer() const
This is a generic and portable string class.
A number class that manipulates a string buffer that is also a date.
Synchronization and threading services.
Common and portable character string related functions.
The Date class uses a julian date representation of the current year, month, and day.
A number manipulation class.
void update(void)
A method to use to "post" any changed values when shadowing a mixed object class. ...