13 |
using namespace std; |
using namespace std; |
14 |
|
|
15 |
|
|
16 |
|
StationInfo::StationInfo(std::string c, std::string n) |
17 |
|
{ |
18 |
|
code = Util::str_characters(c); |
19 |
|
name = Util::str_characters(n); |
20 |
|
} |
21 |
|
|
22 |
|
|
23 |
TogPlugin::TogPlugin() |
TogPlugin::TogPlugin() |
24 |
: Plugin("tog", "Henter tog info fra bane.dk") |
: Plugin("tog", "Henter tog info fra bane.dk") |
25 |
{ |
{ |
26 |
_stationInfo["ar"] = StationInfo("AR","�rhus"); |
_stationInfo["ar"] = StationInfo("AR","Århus"); |
27 |
_stationInfo["la"] = StationInfo("LG","Lang�"); |
_stationInfo["la"] = StationInfo("LG","Langå"); |
28 |
_stationInfo["ul"] = StationInfo("UP","Ulstrup"); |
_stationInfo["ul"] = StationInfo("UP","Ulstrup"); |
29 |
_stationInfo["bj"] = StationInfo("BJ","Bjerringbro"); |
_stationInfo["bj"] = StationInfo("BJ","Bjerringbro"); |
30 |
_stationInfo["vi"] = StationInfo("VG","Viborg"); |
_stationInfo["vi"] = StationInfo("VG","Viborg"); |
31 |
_stationInfo["ho"] = StationInfo("H�","H�jslev"); |
_stationInfo["ho"] = StationInfo("HØ","Højslev"); |
32 |
_stationInfo["sk"] = StationInfo("SK","Skive"); |
_stationInfo["sk"] = StationInfo("SK","Skive"); |
33 |
} |
} |
34 |
|
|
71 |
if (data == "") |
if (data == "") |
72 |
{ |
{ |
73 |
modem.SendSms(sms.GetSender(), "Usage: tog <stationskode>\ntog list - liste over stationer", false); |
modem.SendSms(sms.GetSender(), "Usage: tog <stationskode>\ntog list - liste over stationer", false); |
74 |
return; |
return; |
75 |
} |
} |
76 |
|
|
77 |
if (data == "list") |
if (data == "list") |
94 |
{ |
{ |
95 |
infos = GetTrainInfo( code , "" ); |
infos = GetTrainInfo( code , "" ); |
96 |
} |
} |
97 |
catch(std::exception& e) |
catch (std::exception& e) |
98 |
{ |
{ |
99 |
modem.SendSms(sms.GetSender(), e.what(), false ); |
modem.SendSms(sms.GetSender(), e.what(), false ); |
100 |
return; |
return; |