--- smsdaemon/SmsPdu.h 2008/12/07 20:18:20 148 +++ smsdaemon/SmsPdu.h 2008/12/18 06:53:29 196 @@ -12,8 +12,34 @@ int len; }; + +struct SmsPart +{ + std::string message; + std::string sender; + short group,count,id; + + bool operator<(const SmsPart& p2) const + { + return (id < p2.id); + } + bool operator==(const SmsPart& p2) const + { + return (message==p2.message && sender==p2.sender && group==p2.group && count==p2.count && id==p2.id); + } + +}; + namespace SmsPdu { +//public section: + std::vector CreateSmsPdu(std::string to, std::string message, bool allowMultipart); + + SMS ParseSmsPdu(std::string pdu); + +//private section: + + SmsPart ParseSmsPduWorker(std::string pdu); std::string EncodePhonenr(std::string input); std::string DecodePhonenr(std::string input); @@ -24,9 +50,6 @@ std::vector Encode7to8bit(std::string str, int shift_start); std::string Decode8to7bit( std::vector input, int shift_start ); - std::vector CreateSmsPdu(std::string to, std::string message, bool allowMultipart); - - SMS ParseSmsPdu(std::string pdu); } #endif // __SMSPDU_H__