1 |
#include "TogPlugin.h" |
#include "TogPlugin.h" |
2 |
#include "IGsmModem.h" |
#include "ISmsTransceiver.h" |
3 |
#include "Sms.h" |
#include "Sms.h" |
4 |
|
|
5 |
#include "TrainInfo.h" |
#include "TrainInfo.h" |
6 |
#include "util.h" |
#include "Util.h" |
7 |
|
|
8 |
#include <iostream> |
#include <iostream> |
9 |
#include <sstream> |
#include <sstream> |
10 |
|
|
11 |
#include "common.h" |
#include "Common.h" |
12 |
|
|
13 |
using namespace std; |
using namespace std; |
14 |
|
|
16 |
TogPlugin::TogPlugin() |
TogPlugin::TogPlugin() |
17 |
: Plugin("tog", "Henter tog info fra bane.dk") |
: Plugin("tog", "Henter tog info fra bane.dk") |
18 |
{ |
{ |
19 |
_stationInfo["ar"] = StationInfo("AR","Århus"); |
_stationInfo["ar"] = StationInfo("AR","�rhus"); |
20 |
_stationInfo["la"] = StationInfo("LG","Langå"); |
_stationInfo["la"] = StationInfo("LG","Lang�"); |
21 |
_stationInfo["ul"] = StationInfo("UP","Ulstrup"); |
_stationInfo["ul"] = StationInfo("UP","Ulstrup"); |
22 |
_stationInfo["bj"] = StationInfo("BJ","Bjerringbro"); |
_stationInfo["bj"] = StationInfo("BJ","Bjerringbro"); |
23 |
_stationInfo["vi"] = StationInfo("VG","Viborg"); |
_stationInfo["vi"] = StationInfo("VG","Viborg"); |
24 |
_stationInfo["ho"] = StationInfo("HØ","Højslev"); |
_stationInfo["ho"] = StationInfo("H�","H�jslev"); |
25 |
_stationInfo["sk"] = StationInfo("SK","Skive"); |
_stationInfo["sk"] = StationInfo("SK","Skive"); |
26 |
} |
} |
27 |
|
|
54 |
return os.str(); |
return os.str(); |
55 |
} |
} |
56 |
|
|
57 |
void TogPlugin::Execute(IGsmModem& modem, SMS& sms) |
void TogPlugin::Execute(ISmsTransceiver& modem, SMS& sms) |
58 |
{ |
{ |
59 |
string data = sms.ExtractParameters(); |
string data = sms.ExtractParameters(); |
60 |
|
|
|
data = Util::str_gsm2latin(data);; |
|
61 |
data = Util::str_tolower(data); |
data = Util::str_tolower(data); |
62 |
|
|
63 |
|
|