mastodon-cpp  0.15.1
account.hpp
1 /* This file is part of mastodon-cpp.
2  * Copyright © 2018 tastytea <tastytea@tastytea.de>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef MASTODON_CPP_EASY_ACCOUNT_HPP
18 #define MASTODON_CPP_EASY_ACCOUNT_HPP
19 
20 #include <string>
21 #include <cstdint>
22 #include <chrono>
23 
24 // If we are compiling mastodon-cpp, use another include path
25 #ifdef MASTODON_CPP
26  #include "mastodon-cpp.hpp"
27  #include "easy/easy.hpp"
28 #else
29  #include <mastodon-cpp/mastodon-cpp.hpp>
30  #include <mastodon-cpp/easy/easy.hpp>
31 #endif
32 
33 using std::string;
34 using std::uint_fast64_t;
35 using std::chrono::system_clock;
36 
37 namespace Mastodon
38 {
42  class Easy::Account : public Easy::Entity
43  {
44  public:
50  explicit Account(const string &json);
51 
55  Account();
56 
63  const string acct() const;
64 
68  const string avatar() const;
69 
73  const string avatar_static() const;
74 
78  const system_clock::time_point created_at() const;
79 
83  const string display_name() const;
84 
88  const uint_fast64_t followers_count() const;
89 
93  const uint_fast64_t following_count() const;
94 
98  const string header() const;
99 
103  const string header_static() const;
104 
108  const uint_fast64_t id() const;
109 
113  const bool locked() const;
114 
118  const bool has_moved() const;
119 
124  const Account moved() const;
125 
129  const string note() const;
130 
134  const string note_plain() const;
135 
139  const visibility_type privacy() const;
140 
144  const bool sensitive() const;
145 
149  const uint_fast64_t statuses_count() const;
150 
154  const string url() const;
155 
159  const string username() const;
160 };
161 }
162 
163 #endif // MASTODON_CPP_EASY_ACCOUNT_HPP
const string avatar() const
Returns URL of avatar.
Definition: account.cpp:36
const uint_fast64_t statuses_count() const
Returns number of statuses.
Definition: account.cpp:138
const string header() const
Returns URL of header image.
Definition: account.cpp:66
const system_clock::time_point created_at() const
Returns time of creation.
Definition: account.cpp:46
const string avatar_static() const
Returns URL of static avatar.
Definition: account.cpp:41
const visibility_type privacy() const
Returns default privacy of new toots.
Definition: account.cpp:117
const string note_plain() const
Returns plaintext version of note.
Definition: account.cpp:112
const string acct() const
Returns username.
Definition: account.cpp:31
const bool has_moved() const
Returns true if the account has been moved.
Definition: account.cpp:86
const uint_fast64_t followers_count() const
Returns number of followers.
Definition: account.cpp:56
const string note() const
Returns note.
Definition: account.cpp:107
const string header_static() const
Returns URL of static header image.
Definition: account.cpp:71
visibility_type
Describes visibility of toots.
Definition: easy.hpp:61
const uint_fast64_t id() const
Returns account-ID.
Definition: account.cpp:76
const string username() const
Returns username (without )
Definition: account.cpp:148
const bool locked() const
Returns true if the account is locked.
Definition: account.cpp:81
const string display_name() const
Returns display name.
Definition: account.cpp:51
Class to hold accounts.
Definition: account.hpp:42
const Account moved() const
If the owner decided to switch accounts, new account is in this attribute.
Definition: account.cpp:96
const bool sensitive() const
Returns if media is marked as sensitive by default.
Definition: account.cpp:133
Definition: mastodon-cpp.hpp:51
Base class for all entities.
Definition: easy.hpp:225
const uint_fast64_t following_count() const
Returns number of people this account follows.
Definition: account.cpp:61
Account()
Constructs an empty Account object.
Definition: account.cpp:27
const string url() const
Returns URL of the profile.
Definition: account.cpp:143