#include<iostream>
#include<string.h>
#include<fstream>
using namespace std;
string GetLastKey(string key = "")
{
char str[1024];
strcpy(str, key.c_str());
const char *split = "=";
char *temp;
temp = strtok(str, split);
temp = strtok(NULL,split);
key = temp;
return key;
}
string GetKey(string key = "")
{
char str[1024];
strcpy(str, key.c_str());
const char *split = ";";
char *temp;
temp = strtok(str, split);
key = temp;
return GetLastKey(key);
}
void SplitConfig(string con = "")
{
string sms_ice = strstr(con.c_str(), "ICE");
string sms_ice_key = GetKey(sms_ice);
cout<<sms_ice_key<<endl;
}
void ReadConfig()
{
ifstream ifs;
ifs.open("./config.sms", ios::out);
string str = "";
string connect = "";
while(!ifs.eof())
{
ifs>>str;
connect = connect + " " + str;
}
ifs.close();
//cout<<connect<<endl;
SplitConfig(connect);
}
int main(void)
{
ReadConfig();
}