1 #ifndef EARTHQUAKEUSGS_H
3 #define EARTHQUAKEUSGS_H
39 mutable int year, month, day, hour, minu, sec;
40 mutable bool date_correct;
45 void gmtime_r(time_t* eq_time,
struct tm *eqt)
const {
46 gmtime_s(eqt, eq_time);
55 void getDate ()
const {
61 long epoch_time = std::stol(getTime());
62 time_t eq_time = epoch_time / 1000;
67 struct tm *eqt = &reqt;
68 gmtime_r(&eq_time, eqt);
70 year = eqt->tm_year + 1900;
86 : magnitude(0.0), latit(0.0), longit(0.0),
87 location(
""), title(
""), url(
""), time(
""),
88 year(0), month(0), day(0), hour(0), minu(0), sec(0),
104 const string& location,
const string& title,
const string& url,
const string& time)
105 : magnitude(magnitude), latit(latit), longit(longit),
106 location(location), title(title), url(url), time(time),
107 year(0), month(0), day(0), hour(0), minu(0), sec(0),
108 date_correct(false) {
112 : magnitude(eq->magnitude), latit(eq->latit), longit(eq->longit),
113 location(eq->location), title(eq->title), url(eq->url), time(eq->time),
114 year(0), month(0), day(0), hour(0), minu(0), sec(0),
115 date_correct(false) {
180 string date_str =
" " + mstr + to_string(day) +
" " + to_string(year) +
181 " " + to_string(hour) +
":" + to_string(minu) +
":" + to_string(sec);
195 date_correct =
false;
265 return (
float) this->latit;
281 return (
float) longit;
289 this->longit = longit;
307 this->location = location;
351 return this->magnitude;
359 this->magnitude = magnitude;
Class that hold earthquake data, for use with USGIS retrieved quake data.
Definition: EarthquakeUSGS.h:28
int getMonth() const
get month of quake
Definition: EarthquakeUSGS.h:213
int getMinutes() const
get minutes of quake
Definition: EarthquakeUSGS.h:243
EarthquakeUSGS()
Definition: EarthquakeUSGS.h:85
EarthquakeUSGS(const EarthquakeUSGS *eq)
Definition: EarthquakeUSGS.h:111
EarthquakeUSGS(double magnitude, double longit, double latit, const string &location, const string &title, const string &url, const string &time)
Definition: EarthquakeUSGS.h:103
string getTitle() const
get quake title
Definition: EarthquakeUSGS.h:316
int getHour() const
get hour of quake
Definition: EarthquakeUSGS.h:233
int getYear() const
get year of quake
Definition: EarthquakeUSGS.h:203
string getLocation() const
get quake location.
Definition: EarthquakeUSGS.h:298
int getDay() const
get day of quake
Definition: EarthquakeUSGS.h:223
void setLatit(float latit)
set latitude
Definition: EarthquakeUSGS.h:272
string getDateStr() const
returns the real date in a string format
Definition: EarthquakeUSGS.h:133
void setLongit(float longit)
set longitude of quake location
Definition: EarthquakeUSGS.h:288
void setLocation(string location)
set quake location (string)
Definition: EarthquakeUSGS.h:306
void setTitle(const string &title)
set quake title
Definition: EarthquakeUSGS.h:324
string getTime() const
return the epoch time of the quake
Definition: EarthquakeUSGS.h:124
float getLongit() const
get longitude of quake location
Definition: EarthquakeUSGS.h:280
string getUrl() const
get quake url
Definition: EarthquakeUSGS.h:332
void setMagnitude(double magnitude)
set quake magnitude
Definition: EarthquakeUSGS.h:358
float getLatit() const
get latitude of quake
Definition: EarthquakeUSGS.h:264
double getMagnitude() const
get quake magnitude
Definition: EarthquakeUSGS.h:350
void setUrl(const string &url)
set quake url
Definition: EarthquakeUSGS.h:342
void setTime(const string &tm)
set epoch time
Definition: EarthquakeUSGS.h:192
int getSeconds() const
get seconds of quake
Definition: EarthquakeUSGS.h:253
Support for drawing Bar charts.
Definition: alltypes.h:4