diff options
Diffstat (limited to 'src/user.h')
-rw-r--r-- | src/user.h | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/user.h b/src/user.h index ef7d72e..acd62d0 100644 --- a/src/user.h +++ b/src/user.h | |||
@@ -6,56 +6,64 @@ | |||
6 | #include <cassert> | 6 | #include <cassert> |
7 | 7 | ||
8 | namespace twitter { | 8 | namespace twitter { |
9 | 9 | ||
10 | class client; | 10 | class client; |
11 | 11 | ||
12 | typedef unsigned long long user_id; | 12 | typedef unsigned long long user_id; |
13 | 13 | ||
14 | class user { | 14 | class user { |
15 | public: | 15 | public: |
16 | 16 | ||
17 | user() {} | 17 | user() {} |
18 | user(std::string data); | 18 | user(std::string data); |
19 | 19 | ||
20 | user_id getID() const | 20 | user_id getID() const |
21 | { | 21 | { |
22 | assert(_valid); | 22 | assert(_valid); |
23 | 23 | ||
24 | return _id; | 24 | return _id; |
25 | } | 25 | } |
26 | 26 | ||
27 | std::string getScreenName() const | 27 | std::string getScreenName() const |
28 | { | 28 | { |
29 | assert(_valid); | 29 | assert(_valid); |
30 | 30 | ||
31 | return _screen_name; | 31 | return _screen_name; |
32 | } | 32 | } |
33 | 33 | ||
34 | std::string getName() const | 34 | std::string getName() const |
35 | { | 35 | { |
36 | assert(_valid); | 36 | assert(_valid); |
37 | 37 | ||
38 | return _name; | 38 | return _name; |
39 | } | 39 | } |
40 | 40 | ||
41 | bool isProtected() const | ||
42 | { | ||
43 | assert(_valid); | ||
44 | |||
45 | return _protected; | ||
46 | } | ||
47 | |||
41 | bool operator==(const user& other) const | 48 | bool operator==(const user& other) const |
42 | { | 49 | { |
43 | return _id == other._id; | 50 | return _id == other._id; |
44 | } | 51 | } |
45 | 52 | ||
46 | bool operator!=(const user& other) const | 53 | bool operator!=(const user& other) const |
47 | { | 54 | { |
48 | return _id != other._id; | 55 | return _id != other._id; |
49 | } | 56 | } |
50 | 57 | ||
51 | private: | 58 | private: |
52 | 59 | ||
53 | bool _valid = false; | 60 | bool _valid = false; |
54 | user_id _id; | 61 | user_id _id; |
55 | std::string _screen_name; | 62 | std::string _screen_name; |
56 | std::string _name; | 63 | std::string _name; |
64 | bool _protected = false; | ||
57 | }; | 65 | }; |
58 | 66 | ||
59 | }; | 67 | }; |
60 | 68 | ||
61 | #endif /* end of include guard: USER_H_BF3AB38C */ | 69 | #endif /* end of include guard: USER_H_BF3AB38C */ |