/[projects]/smsdaemon/Sms.cpp
ViewVC logotype

Diff of /smsdaemon/Sms.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 39 by torben, Tue Jun 10 20:28:42 2008 UTC revision 75 by torben, Fri Jun 13 10:10:06 2008 UTC
# Line 2  Line 2 
2  #include <string>  #include <string>
3  #include <vector>  #include <vector>
4    
 #include <iostream>  
5  #include "Sms.h"  #include "Sms.h"
6  #include "util.h"  #include "util.h"
7    #include "SmsPdu.h"
8    
9    
10    
11  std::string GetSmsCommand(SMS& sms)  std::string GetSmsCommand(SMS& sms)
# Line 81  SMS SMS::FromRawString(const std::string Line 82  SMS SMS::FromRawString(const std::string
82          return newsms;          return newsms;
83  }  }
84    
85    SMS SMS::FromPduString(const std::string& input)
86    {
87            std::string smsline = input.substr(7, input.length() -7); //strip "+CMGL: "    
88    
89            std::vector<std::string> lines = Util::str_split(smsline, "\r\n");
90            std::vector<std::string> fields = Util::str_split(lines[0],",");
91    
92            SMS newsms = SmsPdu::ParseSmsPdu(lines[1]);
93    
94            newsms.sms_index = fields[0];
95    
96            return newsms;
97    }
98    
99    

Legend:
Removed from v.39  
changed lines
  Added in v.75

  ViewVC Help
Powered by ViewVC 1.1.20