1 #ifndef EARTHQUAKEUSGS_H 3 #define EARTHQUAKEUSGS_H 32 mutable int year, month, day, hour, minu, sec;
33 mutable bool date_correct;
38 void gmtime_r(time_t* eq_time,
struct tm *eqt)
const {
39 gmtime_s(eqt, eq_time);
48 void getDate ()
const {
54 long epoch_time = std::stol(getTime());
55 time_t eq_time = epoch_time / 1000;
60 struct tm *eqt = &reqt;
61 gmtime_r(&eq_time, eqt);
63 year = eqt->tm_year + 1900;
79 : magnitude(0.0), latit(0.0), longit(0.0),
80 location(
""), title(
""), url(
""), time(
""),
81 year(0), month(0), day(0), hour(0), minu(0), sec(0),
97 const string& location,
const string& title,
const string& url,
const string& time)
98 : magnitude(magnitude), latit(latit), longit(longit),
99 location(location), title(title), url(url), time(time),
100 year(0), month(0), day(0), hour(0), minu(0), sec(0),
101 date_correct(false) {
105 : magnitude(eq->magnitude), latit(eq->latit), longit(eq->longit),
106 location(eq->location), title(eq->title), url(eq->url), time(eq->time),
107 year(0), month(0), day(0), hour(0), minu(0), sec(0),
108 date_correct(false) {
174 string date_str =
" " + mstr + to_string(day) +
" " + to_string(year) +
175 " " + to_string(hour) +
":" + to_string(minu) +
":" + to_string(sec);
189 date_correct =
false;
259 return (
float) this->latit;
275 return (
float) longit;
283 this->longit = longit;
301 this->location = location;
345 return this->magnitude;
353 this->magnitude = magnitude;
float getLongit() const
get longitude of quake location
Definition: EarthquakeUSGS.h:274
int getSeconds() const
get seconds of quake
Definition: EarthquakeUSGS.h:247
int getMinutes() const
get minutes of quake
Definition: EarthquakeUSGS.h:237
string getLocation() const
get quake location.
Definition: EarthquakeUSGS.h:292
EarthquakeUSGS()
Definition: EarthquakeUSGS.h:78
string getTitle() const
get quake title
Definition: EarthquakeUSGS.h:310
EarthquakeUSGS(double magnitude, double longit, double latit, const string &location, const string &title, const string &url, const string &time)
Definition: EarthquakeUSGS.h:96
string getTime() const
return the epoch time of the quake
Definition: EarthquakeUSGS.h:117
float getLatit() const
get latitude of quake
Definition: EarthquakeUSGS.h:258
int getYear() const
get year of quake
Definition: EarthquakeUSGS.h:197
void setLongit(float longit)
set longitude of quake location
Definition: EarthquakeUSGS.h:282
int getMonth() const
get month of quake
Definition: EarthquakeUSGS.h:207
void setLocation(string location)
set quake location (string)
Definition: EarthquakeUSGS.h:300
these methods convert byte arrays in to base64 codes and are used in BRIDGES to represent the color a...
Definition: alltypes.h:4
void setUrl(const string &url)
set quake url
Definition: EarthquakeUSGS.h:336
int getHour() const
get hour of quake
Definition: EarthquakeUSGS.h:227
void setLatit(float latit)
set latitude
Definition: EarthquakeUSGS.h:266
void setMagnitude(double magnitude)
set quake magnitude
Definition: EarthquakeUSGS.h:352
int getDay() const
get day of quake
Definition: EarthquakeUSGS.h:217
string getDateStr() const
returns the real date in a string format
Definition: EarthquakeUSGS.h:127
void setTime(const string &tm)
set epoch time
Definition: EarthquakeUSGS.h:186
void setTitle(const string &title)
set quake title
Definition: EarthquakeUSGS.h:318
Class that hold earthquake data, for use with USGIS retrieved quake data.
Definition: EarthquakeUSGS.h:21
string getUrl() const
get quake url
Definition: EarthquakeUSGS.h:326
double getMagnitude() const
get quake magnitude
Definition: EarthquakeUSGS.h:344
EarthquakeUSGS(const EarthquakeUSGS *eq)
Definition: EarthquakeUSGS.h:104