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;
76 : magnitude(0.0), latit(0.0), longit(0.0),
77 location(
""), title(
""), url(
""), time(
""),
78 year(0), month(0), day(0), hour(0), minu(0), sec(0),
83 const string& location,
const string& title,
const string& url,
const string& time)
84 : magnitude(magnitude), latit(latit), longit(longit),
85 location(location), title(title), url(url), time(time),
86 year(0), month(0), day(0), hour(0), minu(0), sec(0),
91 : magnitude(eq->magnitude), latit(eq->latit), longit(eq->longit),
92 location(eq->location), title(eq->title), url(eq->url), time(eq->time),
93 year(0), month(0), day(0), hour(0), minu(0), sec(0),
160 string date_str =
" " + mstr + to_string(day) +
" " + to_string(year) +
161 " " + to_string(hour) +
":" + to_string(minu) +
":" + to_string(sec);
175 date_correct =
false;
245 return (
float) this->latit;
261 return (
float) longit;
269 this->longit = longit;
287 this->location = location;
331 return this->magnitude;
339 this->magnitude = magnitude;
float getLongit() const
get longitude of quake location
Definition: EarthquakeUSGS.h:260
int getSeconds() const
get seconds of quake
Definition: EarthquakeUSGS.h:233
int getMinutes() const
get minutes of quake
Definition: EarthquakeUSGS.h:223
string getLocation() const
get quake location.
Definition: EarthquakeUSGS.h:278
EarthquakeUSGS()
Definition: EarthquakeUSGS.h:75
string getTitle() const
get quake title
Definition: EarthquakeUSGS.h:296
EarthquakeUSGS(double magnitude, double longit, double latit, const string &location, const string &title, const string &url, const string &time)
Definition: EarthquakeUSGS.h:82
string getTime() const
return the epoch time of the quake
Definition: EarthquakeUSGS.h:103
float getLatit() const
get latitude of quake
Definition: EarthquakeUSGS.h:244
int getYear() const
get year of quake
Definition: EarthquakeUSGS.h:183
void setLongit(float longit)
set longitude of quake location
Definition: EarthquakeUSGS.h:268
int getMonth() const
get month of quake
Definition: EarthquakeUSGS.h:193
void setLocation(string location)
set quake location (string)
Definition: EarthquakeUSGS.h:286
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:322
int getHour() const
get hour of quake
Definition: EarthquakeUSGS.h:213
void setLatit(float latit)
set latitude
Definition: EarthquakeUSGS.h:252
void setMagnitude(double magnitude)
set quake magnitude
Definition: EarthquakeUSGS.h:338
int getDay() const
get day of quake
Definition: EarthquakeUSGS.h:203
string getDateStr() const
returns the real date in a string format
Definition: EarthquakeUSGS.h:113
void setTime(const string &tm)
set epoch time
Definition: EarthquakeUSGS.h:172
void setTitle(const string &title)
set quake title
Definition: EarthquakeUSGS.h:304
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:312
double getMagnitude() const
get quake magnitude
Definition: EarthquakeUSGS.h:330
EarthquakeUSGS(const EarthquakeUSGS *eq)
Definition: EarthquakeUSGS.h:90