#include #include #include "Sms.h" #include "util.h" #include "SmsPdu.h" std::string SMS::ExtractCommand() { unsigned int pos = message.find(" "); std::string result; if (pos == std::string::npos) result = message; else result = message.substr(0, pos); return Util::str_trim(result); } std::string SMS::ExtractParameters() { unsigned int pos = message.find(" "); if (pos == std::string::npos) return ""; else { pos++; std::string data = message.substr(pos, message.length()-pos ); data = Util::str_trim(data); return data; } } SMS::SMS() { } SMS::SMS(std::string _index, std::string _sender, std::string _message, std::string _timestamp) : sms_index(_index), sender(_sender), message(_message), timestamp(_timestamp) { }