Bridges-C++ 3.5.0-dev1
Bridges(C++ API)
Loading...
Searching...
No Matches
Reddit.h
Go to the documentation of this file.
1#ifndef REDDIT_H
2#define REDDIT_H
3
4#include <string>
5
6using std::string;
7
8namespace bridges {
9 namespace dataset {
10
28 class Reddit {
29
30 private:
31 std::string id, title, author, subreddit, url, text;
32 int score, comment_count, post_time;
33 float vote_ratio;
34
35 public:
36 Reddit() = default;
37
43 std::string getID() const {
44 return id;
45 }
46
47 void setID(std::string i) {
48 id = i;
49 }
50
56 std::string getTitle() const {
57 return title;
58 }
59
60 void setTitle(std::string titl) {
61 title = titl;
62 }
63
69 std::string getAuthor() const {
70 return author;
71 }
72
73 void setAuthor(string auth) {
74 author = auth;
75 }
76
82 int getScore() const {
83 return score;
84 }
85
86 void setScore(int sc) {
87 score = sc;
88 }
89
95 float getVoteRatio() const {
96 return vote_ratio;
97 }
98
99 void setVoteRatio(float vr) {
100 vote_ratio = vr;
101 }
102
108 int getCommentCount() const {
109 return comment_count;
110 }
111
112 void setCommentCount(int cnt) {
113 comment_count = cnt;
114 }
115
121 std::string getSubreddit() const {
122 return subreddit;
123 }
124
125 void setSubreddit(std::string sr) {
126 subreddit = sr;
127 }
128
134 int getPostTime() const {
135 return post_time;
136 }
137
138 void setPostTime(int pt) {
139 post_time = pt;
140 }
141
150 std::string getURL() const {
151 return url;
152 }
153
154 void setURL(std::string u) {
155 url = u;
156 }
157
168 std::string getText() const {
169 return text;
170 }
171
172 void setText(std::string txt) {
173 text = txt;
174 }
175 };
176 };
177};
178#endif
An object to represent a Reddit post, used along with the Reddit data source.
Definition Reddit.h:28
std::string getTitle() const
Definition Reddit.h:56
void setURL(std::string u)
Definition Reddit.h:154
int getCommentCount() const
number of comments of the reddit post
Definition Reddit.h:108
std::string getURL() const
URL associated with the post.
Definition Reddit.h:150
void setAuthor(string auth)
Definition Reddit.h:73
void setScore(int sc)
Definition Reddit.h:86
std::string getID() const
Definition Reddit.h:43
std::string getText() const
returns the text of the reddit post.
Definition Reddit.h:168
int getScore() const
Definition Reddit.h:82
std::string getSubreddit() const
name of the subreddit the post appeared in
Definition Reddit.h:121
void setSubreddit(std::string sr)
Definition Reddit.h:125
float getVoteRatio() const
ratio of upvotes to downvotes of the reddit post
Definition Reddit.h:95
void setPostTime(int pt)
Definition Reddit.h:138
void setTitle(std::string titl)
Definition Reddit.h:60
void setVoteRatio(float vr)
Definition Reddit.h:99
int getPostTime() const
time the post was made (UNIX time)
Definition Reddit.h:134
std::string getAuthor() const
Definition Reddit.h:69
void setCommentCount(int cnt)
Definition Reddit.h:112
void setText(std::string txt)
Definition Reddit.h:172
void setID(std::string i)
Definition Reddit.h:47
Support for drawing Bar charts.
Definition alltypes.h:4