Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: sms_message.h

Issue 6612044: Added an SmsMessage class, and code for parsing a PDU to an SMS message. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cromo.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Makefile ('k') | sms_message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CROMO_SMS_MESSAGE_H_
6 #define CROMO_SMS_MESSAGE_H_
7
8 #include <base/basictypes.h>
9 #include <string>
10
11 // Simple class that represents SMS messages and their
12 // metadata.
13 class SmsMessage {
14 public:
15 // Create an SMS message from a PDU (Protocol Description Unit)
16 // as documented in 3GPP 23.040. Text of the message is represented
17 // in the GSM 7 alphabet as documented in 3GPP 23.038,
18 static SmsMessage* CreateMessage(const uint8_t* pdu, size_t pdu_len);
19
20 std::string& smsc_address() { return smsc_address_; }
21 std::string& sender_address() { return sender_address_; }
22 std::string& timestamp() { return timestamp_; }
23 // Return the body of the SMS message as a UTF-8 encoded string
24 std::string& text() { return text_; }
25
26 private:
27 SmsMessage() {} // disallow no-arg constructor invocation
28
29 SmsMessage(std::string& smsc_address,
30 std::string& sender_address,
31 std::string& timestamp,
32 std::string& text) :
33 smsc_address_(smsc_address),
34 sender_address_(sender_address),
35 timestamp_(timestamp),
36 text_(text) {}
37
38 std::string smsc_address_;
39 std::string sender_address_;
40 std::string timestamp_;
41 std::string text_;
42
43 DISALLOW_COPY_AND_ASSIGN(SmsMessage);
44 };
45
46 #endif // CROMO_SMS_MESSAGE_H_
OLDNEW
« no previous file with comments | « Makefile ('k') | sms_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698