about summary refs log tree commit diff stats
path: root/src/tweet.h
blob: 74d73d2be3ab971947f733329ccd19ab7f32fc93 (plain) (blame)
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
#ifndef TWEET_H_CE980721
#define TWEET_H_CE980721

#include <string>
#include "user.h"
#include <vector>
#include <utility>

namespace twitter {
  
  typedef unsigned long long tweet_id;
  
  class tweet {
    public:
      tweet();
      tweet(std::string data);
      tweet(const tweet& other);
      tweet(tweet&& other);
      ~tweet();
      
      tweet& operator=(tweet other);
      friend void swap(tweet& first, tweet& second);
      
      tweet_id getID() const;
      std::string getText() const;
      const user& getAuthor() const;
      bool isRetweet() const;
      tweet getRetweet() const;
      std::vector<std::pair<user_id, std::string>> getMentions() const;
      std::string getURL() const;
      
      operator bool() const;
      
    private:
      bool _valid;
      tweet_id _id;
      std::string _text;
      user _author;
      bool _is_retweet = false;
      tweet* _retweeted_status = nullptr;
      std::vector<std::pair<user_id, std::string>> _mentions;
  };
  
};

#endif /* end of include guard: TWEET_H_CE980721 */