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

Annotation of /smsdaemon/Sms.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 196 - (hide annotations) (download)
Thu Dec 18 06:53:29 2008 UTC (15 years, 5 months ago) by torben
File size: 781 byte(s)
Make pretty

astyle -t -b -N

1 torben 26
2     #include <string>
3     #include <vector>
4    
5     #include "Sms.h"
6 torben 158 #include "Util.h"
7 torben 75 #include "SmsPdu.h"
8 torben 26
9    
10 torben 75
11 torben 142 std::string SMS::ExtractCommand()
12 torben 26 {
13 torben 142 unsigned int pos = message.find(" ");
14 torben 26
15 torben 78 std::string result;
16    
17 torben 26 if (pos == std::string::npos)
18 torben 142 result = message;
19 torben 26 else
20 torben 142 result = message.substr(0, pos);
21 torben 78
22     return Util::str_trim(result);
23 torben 26 }
24    
25 torben 142 std::string SMS::ExtractParameters()
26 torben 26 {
27 torben 142 unsigned int pos = message.find(" ");
28 torben 26
29     if (pos == std::string::npos)
30     return "";
31     else
32     {
33     pos++;
34 torben 196
35 torben 142 std::string data = message.substr(pos, message.length()-pos );
36 torben 26
37 torben 39 data = Util::str_trim(data);
38 torben 26 return data;
39     }
40     }
41    
42     SMS::SMS()
43     {
44     }
45    
46 torben 142 SMS::SMS(std::string _index, std::string _sender, std::string _message, std::string _timestamp)
47 torben 196 : sms_index(_index), sender(_sender), message(_message), timestamp(_timestamp)
48 torben 26 {
49     }

  ViewVC Help
Powered by ViewVC 1.1.20