Added get methods to User class
This commit is contained in:
		
							parent
							
								
									14f40d257d
								
							
						
					
					
						commit
						fc91e260d2
					
				| @ -10,6 +10,11 @@ namespace Telegram { | |||||||
|   public: |   public: | ||||||
|     User(Json::Value); |     User(Json::Value); | ||||||
| 
 | 
 | ||||||
|  | 	Json::Int64 getId(); | ||||||
|  | 	std::string getFirstName(); | ||||||
|  | 	std::string getLastName(); | ||||||
|  | 	std::string getUserName(); | ||||||
|  | 
 | ||||||
|   private: |   private: | ||||||
|     Json::Int64 id; |     Json::Int64 id; | ||||||
|     std::string first_name; |     std::string first_name; | ||||||
|  | |||||||
							
								
								
									
										24
									
								
								src/User.cc
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								src/User.cc
									
									
									
									
									
								
							| @ -1,5 +1,8 @@ | |||||||
| #include "Telegram/User.h" | #include "Telegram/User.h" | ||||||
| 
 | 
 | ||||||
|  | /**
 | ||||||
|  |  * Constructor of class User | ||||||
|  |  */ | ||||||
| Telegram::User::User(Json::Value json) { | Telegram::User::User(Json::Value json) { | ||||||
| 
 | 
 | ||||||
|   this->id = json["id"].asUInt64(); |   this->id = json["id"].asUInt64(); | ||||||
| @ -7,3 +10,24 @@ Telegram::User::User(Json::Value json) { | |||||||
|   this->last_name = json["last_name"].asString(); |   this->last_name = json["last_name"].asString(); | ||||||
|   this->username = json["username"].asString(); |   this->username = json["username"].asString(); | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | // Getter
 | ||||||
|  | Json::Int64 Telegram::User::getId() { | ||||||
|  | 
 | ||||||
|  | 	return(this->id); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | std::string Telegram::User::getFirstName() { | ||||||
|  | 
 | ||||||
|  | 	return(this->first_name); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | std::string Telegram::User::getLastName() { | ||||||
|  | 
 | ||||||
|  | 	return(this->last_name); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | std::string Telegram::User::getUserName() { | ||||||
|  | 
 | ||||||
|  | 	return(this->username); | ||||||
|  | } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user