1 #ifndef EARTHQUAKEUSGS_H 3 #define EARTHQUAKEUSGS_H 40 mutable int year, month, day, hour, minu, sec;
41 mutable bool date_correct;
46 void gmtime_r(time_t* eq_time,
struct tm *eqt)
const {
47 gmtime_s(eqt, eq_time);
56 void getDate ()
const {
62 long epoch_time = std::stol(getTime());
63 time_t eq_time = epoch_time / 1000;
68 struct tm *eqt = &reqt;
69 gmtime_r(&eq_time, eqt);
71 year = eqt->tm_year + 1900;
87 : magnitude(0.0), latit(0.0), longit(0.0),
88 location(
""), title(
""), url(
""), time(
""),
89 year(0), month(0), day(0), hour(0), minu(0), sec(0),
105 const string& location,
const string& title,
const string& url,
const string& time)
106 : magnitude(magnitude), latit(latit), longit(longit),
107 location(location), title(title), url(url), time(time),
108 year(0), month(0), day(0), hour(0), minu(0), sec(0),
109 date_correct(false) {
113 : magnitude(eq->magnitude), latit(eq->latit), longit(eq->longit),
114 location(eq->location), title(eq->title), url(eq->url), time(eq->time),
115 year(0), month(0), day(0), hour(0), minu(0), sec(0),
116 date_correct(false) {
182 string date_str =
" " + mstr + to_string(day) +
" " + to_string(year) +
183 " " + to_string(hour) +
":" + to_string(minu) +
":" + to_string(sec);
197 date_correct =
false;
267 return (
float) this->latit;
283 return (
float) longit;
291 this->longit = longit;
309 this->location = location;
353 return this->magnitude;
361 this->magnitude = magnitude;
float getLongit() const
get longitude of quake location
Definition: EarthquakeUSGS.h:282
int getSeconds() const
get seconds of quake
Definition: EarthquakeUSGS.h:255
int getMinutes() const
get minutes of quake
Definition: EarthquakeUSGS.h:245
string getLocation() const
get quake location.
Definition: EarthquakeUSGS.h:300
EarthquakeUSGS()
Definition: EarthquakeUSGS.h:86
string getTitle() const
get quake title
Definition: EarthquakeUSGS.h:318
EarthquakeUSGS(double magnitude, double longit, double latit, const string &location, const string &title, const string &url, const string &time)
Definition: EarthquakeUSGS.h:104
string getTime() const
return the epoch time of the quake
Definition: EarthquakeUSGS.h:125
float getLatit() const
get latitude of quake
Definition: EarthquakeUSGS.h:266
int getYear() const
get year of quake
Definition: EarthquakeUSGS.h:205
void setLongit(float longit)
set longitude of quake location
Definition: EarthquakeUSGS.h:290
int getMonth() const
get month of quake
Definition: EarthquakeUSGS.h:215
void setLocation(string location)
set quake location (string)
Definition: EarthquakeUSGS.h:308
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:344
int getHour() const
get hour of quake
Definition: EarthquakeUSGS.h:235
void setLatit(float latit)
set latitude
Definition: EarthquakeUSGS.h:274
void setMagnitude(double magnitude)
set quake magnitude
Definition: EarthquakeUSGS.h:360
int getDay() const
get day of quake
Definition: EarthquakeUSGS.h:225
string getDateStr() const
returns the real date in a string format
Definition: EarthquakeUSGS.h:135
void setTime(const string &tm)
set epoch time
Definition: EarthquakeUSGS.h:194
void setTitle(const string &title)
set quake title
Definition: EarthquakeUSGS.h:326
Class that hold earthquake data, for use with USGIS retrieved quake data.
Definition: EarthquakeUSGS.h:29
string getUrl() const
get quake url
Definition: EarthquakeUSGS.h:334
double getMagnitude() const
get quake magnitude
Definition: EarthquakeUSGS.h:352
EarthquakeUSGS(const EarthquakeUSGS *eq)
Definition: EarthquakeUSGS.h:112