Bridges-C++  3.4.4
Bridges(C++ API)
Public Member Functions | List of all members
bridges::dataset::Reddit Class Reference

#include <Reddit.h>

Detailed Description

An object to represent a Reddit post, used along with the Reddit data source.

This is a convenience class provided for users who wish to use this data source as part of their application. It provides an API that makes it easy to access the attributes of this data set.

The Reddit object is typically not created by a student but rather obtained from calling bridges::DataSource::getRedditData().

Refer to tutorial for example of using this feature: https://bridgesuncc.github.io/tutorials/Data_Reddit.html

Author
Erik Saule
Date
7/12/22

Public Member Functions

 Reddit ()=default
 
std::string getID () const
 
void setID (std::string i)
 
std::string getTitle () const
 
void setTitle (std::string titl)
 
std::string getAuthor () const
 
void setAuthor (string auth)
 
int getScore () const
 
void setScore (int sc)
 
float getVoteRatio () const
 ratio of upvotes to downvotes of the reddit post More...
 
void setVoteRatio (float vr)
 
int getCommentCount () const
 number of comments of the reddit post More...
 
void setCommentCount (int cnt)
 
std::string getSubreddit () const
 name of the subreddit the post appeared in More...
 
void setSubreddit (std::string sr)
 
int getPostTime () const
 time the post was made (UNIX time) More...
 
void setPostTime (int pt)
 
std::string getURL () const
 URL associated with the post. More...
 
void setURL (std::string u)
 
std::string getText () const
 returns the text of the reddit post. More...
 
void setText (std::string txt)
 

Constructor & Destructor Documentation

◆ Reddit()

bridges::dataset::Reddit::Reddit ( )
default

Member Function Documentation

◆ getAuthor()

std::string bridges::dataset::Reddit::getAuthor ( ) const
inline
    @brief return the author of the reddit post
Returns
author's username

◆ getCommentCount()

int bridges::dataset::Reddit::getCommentCount ( ) const
inline

number of comments of the reddit post

Returns
number of comments

◆ getID()

std::string bridges::dataset::Reddit::getID ( ) const
inline
    @brief return id of the reddit post
Returns
id

◆ getPostTime()

int bridges::dataset::Reddit::getPostTime ( ) const
inline

time the post was made (UNIX time)

Returns
unix time

◆ getScore()

int bridges::dataset::Reddit::getScore ( ) const
inline
    @brief return the score (upvotes - downvotes) of the reddit post
Returns
score (upvotes - downvotes)

◆ getSubreddit()

std::string bridges::dataset::Reddit::getSubreddit ( ) const
inline

name of the subreddit the post appeared in

Returns
subreddit name

◆ getText()

std::string bridges::dataset::Reddit::getText ( ) const
inline

returns the text of the reddit post.

The text of the reddit post. Often in markdown format.

The text could be empty if the reddit post is just a link to a video or an article

Returns
full text of the reddit post

◆ getTitle()

std::string bridges::dataset::Reddit::getTitle ( ) const
inline
    @brief return the title of the reddit post
Returns
title

◆ getURL()

std::string bridges::dataset::Reddit::getURL ( ) const
inline

URL associated with the post.

This could be the url of the reddit post itself or the URL of an associated article/video

Returns
URL

◆ getVoteRatio()

float bridges::dataset::Reddit::getVoteRatio ( ) const
inline

ratio of upvotes to downvotes of the reddit post

Returns
vote ratio

◆ setAuthor()

void bridges::dataset::Reddit::setAuthor ( string  auth)
inline

◆ setCommentCount()

void bridges::dataset::Reddit::setCommentCount ( int  cnt)
inline

◆ setID()

void bridges::dataset::Reddit::setID ( std::string  i)
inline

◆ setPostTime()

void bridges::dataset::Reddit::setPostTime ( int  pt)
inline

◆ setScore()

void bridges::dataset::Reddit::setScore ( int  sc)
inline

◆ setSubreddit()

void bridges::dataset::Reddit::setSubreddit ( std::string  sr)
inline

◆ setText()

void bridges::dataset::Reddit::setText ( std::string  txt)
inline

◆ setTitle()

void bridges::dataset::Reddit::setTitle ( std::string  titl)
inline

◆ setURL()

void bridges::dataset::Reddit::setURL ( std::string  u)
inline

◆ setVoteRatio()

void bridges::dataset::Reddit::setVoteRatio ( float  vr)
inline

The documentation for this class was generated from the following file: