Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
85 lines (72 loc) · 2.22 KB

File metadata and controls

85 lines (72 loc) · 2.22 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef USER_NAME_H
#define USER_NAME_H
#include <string>
#include <vector>
#include "json.hpp"
using json = nlohmann::json;
class user_name
{
protected:
std::string id; // 用户id
std::string password; // 密码
std::string nickname; // 昵称
std::string brithday; // 出生日期
std::string registrationTime; // 注册时间
std::string location; // 所在地
std::vector<std::string> friends; // 好友列表
std::vector<std::string> groups; // 群列表
public:
user_name();
user_name(std::string id, std::string nickname, std::string brithday, std::string regTime, std::string location, std::string password);
~user_name();
std::string getId() const;
std::vector<std::string> getFrds() const;
std::vector<std::string> getGrps() const;
std::string getPassword() const;
const std::string getNickname() const;
std::string getBirth() const;
std::string getReg() const;
std::string getLocal() const;
std::vector<std::string> &giveFrds();
std::vector<std::string> &giveGrps();
void setNickName(const std::string &newName);
void setPassword(const std::string &newPswd);
// void setRegsTime(const std::string& regTime);
void setBirthday(const std::string &newBirth);
void setLocation(const std::string &newLocal);
void addFriend(const std::string &friendId);
void delFriend(const std::string &friendId);
void creatGroup();
void delGroup();
void joinGroup(const std::string &GroupId);
void leaveGroup(const std::string &GroupId);
// 序列化json
virtual json toJson() const;
// 从json反序列化
virtual void fromJson(const json &j);
};
class vxUser_name : public user_name
{
private:
std::string linkQQ; // qqid
public:
vxUser_name() {};
vxUser_name(std::string id, std::string nickname, std::string brithday, std::string regTime, std::string location, std::string password);
json toJson() const override;
void fromJson(const json &j) override;
void linkToQQ(const std::string qqid);
std::string &giveQQ();
};
namespace std
{
template <>
struct hash<user_name>
{
std::size_t operator()(const user_name &user)
const
{
return hash<std::string>()(user.getId());
}
};
}
#endif // USER_NAME_H
Morty Proxy This is a proxified and sanitized view of the page, visit original site.