From 971004573bef50d0633a83bde08660b086c8a7b5 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 27 Jan 2019 04:52:37 +0100 Subject: [PATCH] 2019-01-27 --- docs/account_8hpp_source.html | 6 +- docs/all_8hpp_source.html | 2 +- docs/annotated.html | 2 +- docs/application_8hpp_source.html | 2 +- docs/attachment_8hpp_source.html | 6 +- docs/card_8hpp_source.html | 2 +- docs/classMastodon_1_1API-members.html | 2 +- docs/classMastodon_1_1API.html | 2 +- .../classMastodon_1_1API_1_1http-members.html | 2 +- docs/classMastodon_1_1API_1_1http.html | 2 +- docs/classMastodon_1_1Easy-members.html | 4 +- docs/classMastodon_1_1Easy.html | 22 +++---- ...ssMastodon_1_1Easy_1_1Account-members.html | 4 +- docs/classMastodon_1_1Easy_1_1Account.html | 16 ++--- ..._1_1Easy_1_1Account_1_1Source-members.html | 2 +- ...Mastodon_1_1Easy_1_1Account_1_1Source.html | 2 +- ...stodon_1_1Easy_1_1Application-members.html | 2 +- .../classMastodon_1_1Easy_1_1Application.html | 2 +- ...astodon_1_1Easy_1_1Attachment-members.html | 4 +- docs/classMastodon_1_1Easy_1_1Attachment.html | 16 ++--- ...classMastodon_1_1Easy_1_1Card-members.html | 2 +- docs/classMastodon_1_1Easy_1_1Card.html | 2 +- ...ssMastodon_1_1Easy_1_1Context-members.html | 2 +- docs/classMastodon_1_1Easy_1_1Context.html | 2 +- ...lassMastodon_1_1Easy_1_1Emoji-members.html | 2 +- docs/classMastodon_1_1Easy_1_1Emoji.html | 2 +- ...assMastodon_1_1Easy_1_1Entity-members.html | 2 +- docs/classMastodon_1_1Easy_1_1Entity.html | 4 +- ...sMastodon_1_1Easy_1_1Instance-members.html | 2 +- docs/classMastodon_1_1Easy_1_1Instance.html | 2 +- ...classMastodon_1_1Easy_1_1Link-members.html | 10 ++-- docs/classMastodon_1_1Easy_1_1Link.html | 52 ++++++++--------- ...classMastodon_1_1Easy_1_1List-members.html | 4 +- docs/classMastodon_1_1Easy_1_1List.html | 16 ++--- ...ssMastodon_1_1Easy_1_1Mention-members.html | 4 +- docs/classMastodon_1_1Easy_1_1Mention.html | 16 ++--- ...todon_1_1Easy_1_1Notification-members.html | 4 +- ...classMastodon_1_1Easy_1_1Notification.html | 16 ++--- ...n_1_1Easy_1_1PushSubscription-members.html | 4 +- ...sMastodon_1_1Easy_1_1PushSubscription.html | 16 ++--- ...todon_1_1Easy_1_1Relationship-members.html | 4 +- ...classMastodon_1_1Easy_1_1Relationship.html | 16 ++--- ...assMastodon_1_1Easy_1_1Report-members.html | 4 +- docs/classMastodon_1_1Easy_1_1Report.html | 16 ++--- ...ssMastodon_1_1Easy_1_1Results-members.html | 2 +- docs/classMastodon_1_1Easy_1_1Results.html | 2 +- ...assMastodon_1_1Easy_1_1Status-members.html | 10 ++-- docs/classMastodon_1_1Easy_1_1Status.html | 58 +++++++++---------- .../classMastodon_1_1Easy_1_1Tag-members.html | 2 +- docs/classMastodon_1_1Easy_1_1Tag.html | 2 +- ...don_1_1Easy_1_1Tag_1_1History-members.html | 2 +- ...assMastodon_1_1Easy_1_1Tag_1_1History.html | 2 +- docs/classes.html | 2 +- docs/context_8hpp_source.html | 2 +- .../dir_68267d1309a1af8e8297ef4c3efbcdba.html | 2 +- .../dir_9d328871126a6a5820f3cd5c0c41741e.html | 2 +- .../dir_da61e3e9a357748887e3ca8d7c5a0c16.html | 2 +- .../dir_e526f556af6ddef7955f0f6556f0f4d0.html | 2 +- docs/easy_8hpp_source.html | 18 +++--- docs/emoji_8hpp_source.html | 2 +- docs/example01_dump_json_8cpp-example.html | 2 +- .../example02_parse_account_8cpp-example.html | 2 +- docs/example03_mastocron_8cpp-example.html | 2 +- ...ple04_update_credentials_8cpp-example.html | 2 +- ...xample05_follow_unfollow_8cpp-example.html | 2 +- ...ample06_toot_delete-toot_8cpp-example.html | 2 +- docs/example07_register_app_8cpp-example.html | 2 +- .../example08_rate_limiting_8cpp-example.html | 2 +- .../example09_streaming_api_8cpp-example.html | 2 +- docs/example10_simplify_8cpp-example.html | 2 +- docs/example11_post_media_8cpp-example.html | 2 +- ...xample12_easy_laststatus_8cpp-example.html | 4 +- docs/example13_easy_stream_8cpp-example.html | 2 +- .../example14_easy_treeview_8cpp-example.html | 4 +- docs/example15_proxy_8cpp-example.html | 2 +- ...example16_account_fields_8cpp-example.html | 2 +- docs/examples.html | 2 +- docs/files.html | 2 +- docs/functions.html | 2 +- docs/functions_b.html | 2 +- docs/functions_c.html | 2 +- docs/functions_d.html | 2 +- docs/functions_e.html | 2 +- docs/functions_enum.html | 2 +- docs/functions_f.html | 2 +- docs/functions_func.html | 2 +- docs/functions_func_b.html | 2 +- docs/functions_func_c.html | 2 +- docs/functions_func_d.html | 2 +- docs/functions_func_e.html | 2 +- docs/functions_func_f.html | 2 +- docs/functions_func_g.html | 4 +- docs/functions_func_h.html | 2 +- docs/functions_func_i.html | 24 ++++---- docs/functions_func_j.html | 2 +- docs/functions_func_l.html | 2 +- docs/functions_func_m.html | 4 +- docs/functions_func_n.html | 4 +- docs/functions_func_p.html | 4 +- docs/functions_func_r.html | 2 +- docs/functions_func_s.html | 4 +- docs/functions_func_t.html | 2 +- docs/functions_func_u.html | 2 +- docs/functions_func_v.html | 2 +- docs/functions_func_w.html | 2 +- docs/functions_g.html | 4 +- docs/functions_h.html | 2 +- docs/functions_i.html | 24 ++++---- docs/functions_j.html | 2 +- docs/functions_l.html | 2 +- docs/functions_m.html | 4 +- docs/functions_n.html | 4 +- docs/functions_p.html | 4 +- docs/functions_r.html | 2 +- docs/functions_s.html | 4 +- docs/functions_t.html | 2 +- docs/functions_type.html | 2 +- docs/functions_u.html | 2 +- docs/functions_v.html | 2 +- docs/functions_w.html | 2 +- docs/hierarchy.html | 2 +- docs/index.html | 3 +- docs/instance_8hpp_source.html | 2 +- docs/list_8hpp_source.html | 6 +- docs/macros_8hpp_source.html | 2 +- docs/mastodon-cpp_8hpp_source.html | 2 +- docs/mention_8hpp_source.html | 6 +- docs/notification_8hpp_source.html | 6 +- docs/pushsubscription_8hpp_source.html | 8 +-- docs/relationship_8hpp_source.html | 6 +- docs/report_8hpp_source.html | 8 +-- docs/results_8hpp_source.html | 2 +- docs/status_8hpp_source.html | 10 ++-- docs/tag_8hpp_source.html | 2 +- 134 files changed, 336 insertions(+), 335 deletions(-) diff --git a/docs/account_8hpp_source.html b/docs/account_8hpp_source.html index 578c898..3003a93 100644 --- a/docs/account_8hpp_source.html +++ b/docs/account_8hpp_source.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
@@ -47,7 +47,7 @@ $(function() {
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 #include <vector>
24 #include <utility>
25 
26 // If we are compiling mastodon-cpp, use another include path
27 #ifdef MASTODON_CPP
28  #include "mastodon-cpp.hpp"
29  #include "easy/easy.hpp"
30 #else
31  #include <mastodon-cpp/mastodon-cpp.hpp>
32  #include <mastodon-cpp/easy/easy.hpp>
33 #endif
34 
35 using std::string;
36 using std::uint_fast64_t;
37 using std::chrono::system_clock;
38 
39 namespace Mastodon
40 {
46  class Easy::Account : public Easy::Entity
47  {
48  public:
54  using fields_pair = std::pair<const string, const string>;
55 
63  explicit Account(const string &json);
64 
70  Account();
71 
72  virtual bool valid() const;
73 
82  const string acct() const;
83 
89  const string avatar() const;
90 
98  Account avatar(const string &avatar);
99 
105  const string avatar_static() const;
106 
112  bool bot() const;
113 
119  const system_clock::time_point created_at() const;
120 
126  const string display_name() const;
127 
133  Account display_name(const string &display_name);
134 
140  const std::vector<fields_pair> fields() const;
141 
147  Account fields(std::vector<fields_pair> &fields);
148 
154  uint_fast64_t followers_count() const;
155 
161  uint_fast64_t following_count() const;
162 
168  const string header() const;
169 
177  Account header(const string &header);
178 
184  const string header_static() const;
185 
191  uint_fast64_t id() const;
192 
198  bool locked() const;
199 
205  Account locked(const bool &locked);
206 
212  bool has_moved() const;
213 
220  const Account moved() const;
221 
227  const string note() const;
228 
234  Account note(const string &note);
235 
241  [[deprecated("Will vanish in 1.0.0. Use source() instead.")]]
242  const string note_plain() const;
243 
249  visibility_type privacy() const;
250 
256  bool sensitive() const;
257 
263  class Source : public Easy::Entity
264  {
265  public:
273  explicit Source(const string &json);
274 
280  Source();
281 
282  virtual bool valid() const;
283 
289  const std::vector<fields_pair> fields() const;
290 
296  Source fields(std::vector<fields_pair> &fields);
297 
303  const string note() const;
304 
310  Source note(const string &note);
311 
317  visibility_type privacy() const;
318 
325 
331  bool sensitive() const;
332 
338  Source sensitive(const bool &sensitive);
339  };
340 
341  const Source source() const;
342  Account source(const Source &source);
343 
349  uint_fast64_t statuses_count() const;
350 
356  const string url() const;
357 
363  const string username() const;
364 };
365 }
366 
367 #endif // MASTODON_CPP_EASY_ACCOUNT_HPP
const string avatar() const
Returns URL of avatar.
Definition: account.cpp:61
+
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 #include <vector>
24 #include <utility>
25 
26 // If we are compiling mastodon-cpp, use another include path
27 #ifdef MASTODON_CPP
28  #include "mastodon-cpp.hpp"
29  #include "easy/easy.hpp"
30 #else
31  #include <mastodon-cpp/mastodon-cpp.hpp>
32  #include <mastodon-cpp/easy/easy.hpp>
33 #endif
34 
35 using std::string;
36 using std::uint_fast64_t;
37 using std::chrono::system_clock;
38 
39 namespace Mastodon
40 {
46  class Easy::Account : public Easy::Entity
47  {
48  public:
54  using fields_pair = std::pair<const string, const string>;
55 
63  explicit Account(const string &json);
64 
70  Account();
71 
72  virtual bool valid() const;
73 
82  const string acct() const;
83 
89  const string avatar() const;
90 
98  Account avatar(const string &avatar);
99 
105  const string avatar_static() const;
106 
112  bool bot() const;
113 
119  const system_clock::time_point created_at() const;
120 
126  const string display_name() const;
127 
133  Account display_name(const string &display_name);
134 
140  const std::vector<fields_pair> fields() const;
141 
147  Account fields(std::vector<fields_pair> &fields);
148 
154  uint_fast64_t followers_count() const;
155 
161  uint_fast64_t following_count() const;
162 
168  const string header() const;
169 
177  Account header(const string &header);
178 
184  const string header_static() const;
185 
191  const string id() const;
192 
198  bool locked() const;
199 
205  Account locked(const bool &locked);
206 
212  bool has_moved() const;
213 
220  const Account moved() const;
221 
227  const string note() const;
228 
234  Account note(const string &note);
235 
241  [[deprecated("Will vanish in 1.0.0. Use source() instead.")]]
242  const string note_plain() const;
243 
249  visibility_type privacy() const;
250 
256  bool sensitive() const;
257 
263  class Source : public Easy::Entity
264  {
265  public:
273  explicit Source(const string &json);
274 
280  Source();
281 
282  virtual bool valid() const;
283 
289  const std::vector<fields_pair> fields() const;
290 
296  Source fields(std::vector<fields_pair> &fields);
297 
303  const string note() const;
304 
310  Source note(const string &note);
311 
317  visibility_type privacy() const;
318 
325 
331  bool sensitive() const;
332 
338  Source sensitive(const bool &sensitive);
339  };
340 
341  const Source source() const;
342  Account source(const Source &source);
343 
349  uint_fast64_t statuses_count() const;
350 
356  const string url() const;
357 
363  const string username() const;
364 };
365 }
366 
367 #endif // MASTODON_CPP_EASY_ACCOUNT_HPP
const string avatar() const
Returns URL of avatar.
Definition: account.cpp:61
const std::vector< fields_pair > fields() const
Returns metadata fields.
Definition: account.cpp:98
const string header() const
Returns URL of header image.
Definition: account.cpp:141
virtual bool valid() const
Returns true if the Entity holds valid data.
Definition: account.cpp:32
@@ -77,9 +77,9 @@ $(function() {
Base class for all entities.
Definition: easy.hpp:319
visibility_type privacy() const
Returns default privacy of new toots.
Definition: account.cpp:289
bool locked() const
Returns true if the account is locked.
Definition: account.cpp:162
+
const string id() const
Returns account-ID.
Definition: account.cpp:157
Class to hold source attribute.
Definition: account.hpp:263
Account()
Constructs an empty Account object.
Definition: account.cpp:28
-
uint_fast64_t id() const
Returns account-ID.
Definition: account.cpp:157
bool sensitive() const
Returns if media is marked as sensitive by default.
Definition: account.cpp:340
const string url() const
Returns URL of the profile.
Definition: account.cpp:367
bool has_moved() const
Returns true if the account has been moved.
Definition: account.cpp:173
diff --git a/docs/all_8hpp_source.html b/docs/all_8hpp_source.html index 479fcfb..bcea808 100644 --- a/docs/all_8hpp_source.html +++ b/docs/all_8hpp_source.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
diff --git a/docs/annotated.html b/docs/annotated.html index 28ce422..60518ca 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
diff --git a/docs/application_8hpp_source.html b/docs/application_8hpp_source.html index ed7376a..d102ce7 100644 --- a/docs/application_8hpp_source.html +++ b/docs/application_8hpp_source.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
diff --git a/docs/attachment_8hpp_source.html b/docs/attachment_8hpp_source.html index 946bb88..61b424d 100644 --- a/docs/attachment_8hpp_source.html +++ b/docs/attachment_8hpp_source.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
@@ -47,13 +47,12 @@ $(function() {
attachment.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_ATTACHMENT_HPP
18 #define MASTODON_CPP_EASY_ATTACHMENT_HPP
19 
20 #include <string>
21 #include <cstdint>
22 #include <chrono>
23 #include <array>
24 
25 // If we are compiling mastodon-cpp, use another include path
26 #ifdef MASTODON_CPP
27  #include "mastodon-cpp.hpp"
28  #include "easy/easy.hpp"
29 #else
30  #include <mastodon-cpp/mastodon-cpp.hpp>
31  #include <mastodon-cpp/easy/easy.hpp>
32 #endif
33 
34 using std::string;
35 using std::uint_fast64_t;
36 
37 namespace Mastodon
38 {
45  {
46  public:
54  explicit Attachment(const string &json);
55 
61  Attachment();
62 
63  virtual bool valid() const;
64 
70  double aspect() const;
71 
77  double aspect_small() const;
78 
84  uint_fast64_t bitrate() const;
85 
91  const string description() const;
92 
98  Attachment description(const string &description);
99 
105  const std::chrono::duration<double> duration() const;
106 
112  const string file() const;
113 
121  Attachment file(const string &file);
122 
130  const std::array<double, 2> focus() const;
131 
139  Attachment focus(const std::array<double, 2> &focus);
140 
146  double framerate() const;
147 
153  uint_fast64_t height() const;
154 
160  uint_fast64_t height_small() const;
161 
167  uint_fast64_t id() const;
168 
174  const string preview_url() const;
175 
181  const string remote_url() const;
182 
188  const string size() const;
189 
195  const string size_small() const;
196 
202  const string text_url() const;
203 
209  attachment_type type() const;
210 
216  const string url() const;
217 
223  uint_fast64_t width() const;
224 
230  uint_fast64_t width_small() const;
231 
232 
233  };
234 }
235 
236 #endif // MASTODON_CPP_EASY_ATTACHMENT_HPP
const string preview_url() const
Returns the URL of the preview image.
Definition: attachment.cpp:147
+
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_ATTACHMENT_HPP
18 #define MASTODON_CPP_EASY_ATTACHMENT_HPP
19 
20 #include <string>
21 #include <cstdint>
22 #include <chrono>
23 #include <array>
24 
25 // If we are compiling mastodon-cpp, use another include path
26 #ifdef MASTODON_CPP
27  #include "mastodon-cpp.hpp"
28  #include "easy/easy.hpp"
29 #else
30  #include <mastodon-cpp/mastodon-cpp.hpp>
31  #include <mastodon-cpp/easy/easy.hpp>
32 #endif
33 
34 using std::string;
35 using std::uint_fast64_t;
36 
37 namespace Mastodon
38 {
45  {
46  public:
54  explicit Attachment(const string &json);
55 
61  Attachment();
62 
63  virtual bool valid() const;
64 
70  double aspect() const;
71 
77  double aspect_small() const;
78 
84  uint_fast64_t bitrate() const;
85 
91  const string description() const;
92 
98  Attachment description(const string &description);
99 
105  const std::chrono::duration<double> duration() const;
106 
112  const string file() const;
113 
121  Attachment file(const string &file);
122 
130  const std::array<double, 2> focus() const;
131 
139  Attachment focus(const std::array<double, 2> &focus);
140 
146  double framerate() const;
147 
153  uint_fast64_t height() const;
154 
160  uint_fast64_t height_small() const;
161 
167  const string id() const;
168 
174  const string preview_url() const;
175 
181  const string remote_url() const;
182 
188  const string size() const;
189 
195  const string size_small() const;
196 
202  const string text_url() const;
203 
209  attachment_type type() const;
210 
216  const string url() const;
217 
223  uint_fast64_t width() const;
224 
230  uint_fast64_t width_small() const;
231 
232 
233  };
234 }
235 
236 #endif // MASTODON_CPP_EASY_ATTACHMENT_HPP
const string preview_url() const
Returns the URL of the preview image.
Definition: attachment.cpp:147
uint_fast64_t height_small() const
Returns the height of the preview image.
Definition: attachment.cpp:137
Attachment()
Constructs an empty Attachment object.
Definition: attachment.cpp:28
const string description() const
Returns the image description.
Definition: attachment.cpp:60
Class to hold attachments.
Definition: attachment.hpp:44
uint_fast64_t width_small() const
Returns the width of the preview image.
Definition: attachment.cpp:198
-
uint_fast64_t id() const
Returns the ID of the attachment.
Definition: attachment.cpp:142
attachment_type
Describes the attachment type.
Definition: easy.hpp:83
const string text_url() const
Returns shorter URL for the image.
Definition: attachment.cpp:167
const string size_small() const
Returns the size of the preview image.
Definition: attachment.cpp:162
@@ -66,6 +65,7 @@ $(function() {
attachment_type type() const
Returns attachment type.
Definition: attachment.cpp:172
Definition: mastodon-cpp.hpp:52
Base class for all entities.
Definition: easy.hpp:319
+
const string id() const
Returns the ID of the attachment.
Definition: attachment.cpp:142
uint_fast64_t height() const
Returns the height of the original image.
Definition: attachment.cpp:132
const string size() const
Returns the size of the original image.
Definition: attachment.cpp:157
double aspect_small() const
Aspect of preview image.
Definition: attachment.cpp:50
diff --git a/docs/card_8hpp_source.html b/docs/card_8hpp_source.html index 92ad32c..c4470a6 100644 --- a/docs/card_8hpp_source.html +++ b/docs/card_8hpp_source.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
diff --git a/docs/classMastodon_1_1API-members.html b/docs/classMastodon_1_1API-members.html index 189de6a..f385bb4 100644 --- a/docs/classMastodon_1_1API-members.html +++ b/docs/classMastodon_1_1API-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
diff --git a/docs/classMastodon_1_1API.html b/docs/classMastodon_1_1API.html index be00d3c..dfacc17 100644 --- a/docs/classMastodon_1_1API.html +++ b/docs/classMastodon_1_1API.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
diff --git a/docs/classMastodon_1_1API_1_1http-members.html b/docs/classMastodon_1_1API_1_1http-members.html index a5b742d..58a4e67 100644 --- a/docs/classMastodon_1_1API_1_1http-members.html +++ b/docs/classMastodon_1_1API_1_1http-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
diff --git a/docs/classMastodon_1_1API_1_1http.html b/docs/classMastodon_1_1API_1_1http.html index 0505e4a..66eb1b8 100644 --- a/docs/classMastodon_1_1API_1_1http.html +++ b/docs/classMastodon_1_1API_1_1http.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
diff --git a/docs/classMastodon_1_1Easy-members.html b/docs/classMastodon_1_1Easy-members.html index 4d61c92..f54ebe3 100644 --- a/docs/classMastodon_1_1Easy-members.html +++ b/docs/classMastodon_1_1Easy-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
@@ -71,7 +71,7 @@ $(function() { get_header(const string &header) constMastodon::API get_instance() constMastodon::API get_link() constMastodon::Easy - get_notifications(uint_fast16_t &error, const uint_fast16_t limit=20, const uint_fast64_t since_id=0, const uint_fast64_t max_id=0)Mastodon::Easy + get_notifications(uint_fast16_t &error, const uint_fast16_t limit=20, const string since_id=0, const string max_id=0)Mastodon::Easy get_proxy(string &proxy, string &userpw) constMastodon::API get_stream(const Mastodon::API::v1 &call, const parametermap &parameters, string &answer, std::unique_ptr< Mastodon::API::http > &ptr)Mastodon::API get_stream(const Mastodon::API::v1 &call, string &answer, std::unique_ptr< Mastodon::API::http > &ptr)Mastodon::API diff --git a/docs/classMastodon_1_1Easy.html b/docs/classMastodon_1_1Easy.html index eaa8e1c..8eb02b6 100644 --- a/docs/classMastodon_1_1Easy.html +++ b/docs/classMastodon_1_1Easy.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
@@ -296,9 +296,9 @@ Public Member Functions const Status send_toot (const Status &status, uint_fast16_t &error)  Alias for send_post() More...
  -const vector< Notificationget_notifications (uint_fast16_t &error, const uint_fast16_t limit=20, const uint_fast64_t since_id=0, const uint_fast64_t max_id=0) - Gets notifications. More...
-  +const vector< Notificationget_notifications (uint_fast16_t &error, const uint_fast16_t limit=20, const string since_id=0, const string max_id=0) + Gets notifications. More...
- Public Member Functions inherited from Mastodon::API  API (const string &instance, const string &access_token)  Constructs a new API object. More...
@@ -680,8 +680,8 @@ static const string strtim
- -

◆ get_notifications()

+ +

◆ get_notifications()

@@ -701,13 +701,13 @@ static const string strtim - const uint_fast64_t  + const string  since_id = 0, - const uint_fast64_t  + const string  max_id = 0  @@ -730,7 +730,7 @@ static const string strtim
Returns
vector of Easy::Notification.
Since
0.21.0
-
144 {
145  API::parametermap parameters;
146  string answer;
147  error = 0;
148 
149  parameters.insert({ "limit", { std::to_string(limit) } });
150  if (since_id != 0)
151  {
152  parameters.insert({ "since_id", { std::to_string(since_id) } });
153  }
154  if (max_id != 0)
155  {
156  parameters.insert({ "max_id", { std::to_string(max_id) } });
157  }
158 
159  error = API::get(Mastodon::API::v1::notifications, parameters, answer);
160 
161  if (error == 0)
162  {
163  const vector<string> &answer_v = json_array_to_vector(answer);
164  vector<Notification> notifications;
165  notifications.resize(answer_v.size());
166 
167  // Transform vector of strings to vector of Notification.
168  std::transform(answer_v.begin(), answer_v.end(), notifications.begin(),
169  [](const string s)
170  { return Notification(s); });
171 
172  return notifications;
173  }
174  else
175  {
176  ttdebug << "ERROR: Could not get notifications.\n";
177  return { Notification() };
178  }
179 }
Class to hold notifications.
Definition: notification.hpp:48
+
144 {
145  API::parametermap parameters;
146  string answer;
147  error = 0;
148 
149  parameters.insert({ "limit", { std::to_string(limit) } });
150  if (!since_id.empty())
151  {
152  parameters.insert({ "since_id", { since_id } });
153  }
154  if (!max_id.empty())
155  {
156  parameters.insert({ "max_id", { max_id } });
157  }
158 
159  error = API::get(Mastodon::API::v1::notifications, parameters, answer);
160 
161  if (error == 0)
162  {
163  const vector<string> &answer_v = json_array_to_vector(answer);
164  vector<Notification> notifications;
165  notifications.resize(answer_v.size());
166 
167  // Transform vector of strings to vector of Notification.
168  std::transform(answer_v.begin(), answer_v.end(), notifications.begin(),
169  [](const string s)
170  { return Notification(s); });
171 
172  return notifications;
173  }
174  else
175  {
176  ttdebug << "ERROR: Could not get notifications.\n";
177  return { Notification() };
178  }
179 }
Class to hold notifications.
Definition: notification.hpp:48
static const std::vector< string > json_array_to_vector(const string &json)
Turns a JSON array into a vector of strings.
Definition: easy.cpp:31
uint_fast16_t get(const Mastodon::API::v1 &call, string &answer)
Make a GET request which doesn&#39;t require parameters.
Definition: get.cpp:207
std::map< string, std::vector< string > > parametermap
Used for passing parameters.
Definition: mastodon-cpp.hpp:189
@@ -847,7 +847,7 @@ static const string strtim
Returns
The new Easy::Status
Since
0.18.1
-
32 {
33  API::parametermap parameters;
34  string answer;
35  error = 0;
36 
37  if (!status.content().empty())
38  {
39  parameters.insert({ "status", { status.content() }});
40  }
41  else
42  {
43  ttdebug << "ERROR: Easy::Status::content can not be empty.\n";
44  error = 11;
45  return Status();
46  }
47 
48  if (status.in_reply_to_id() != 0)
49  {
50  parameters.insert({ "in_reply_to_id",
51  { std::to_string(status.in_reply_to_id()) }});
52  }
53  if (status.sensitive())
54  {
55  parameters.insert({ "sensitive", { "true" }});
56  }
57  if (!status.spoiler_text().empty())
58  {
59  parameters.insert({ "spoiler_text", { status.spoiler_text() }});
60  }
61  if (status.visibility() != visibility_type::Undefined)
62  {
63  string visibility;
64  switch (status.visibility())
65  {
66  case visibility_type::Direct:
67  visibility = "direct";
68  break;
69  case visibility_type::Private:
70  visibility = "private";
71  break;
72  case visibility_type::Unlisted:
73  visibility = "unlisted";
74  break;
75  case visibility_type::Public:
76  visibility = "public";
77  break;
78  default:
79  break;
80  };
81  parameters.insert({ "visibility", { visibility }});
82  }
83  if (!status.language().empty())
84  {
85  parameters.insert({ "language", { status.language() }});
86  }
87  if (!status.media_attachments().empty())
88  {
89  std::vector<string> media_ids;
90  for (const Attachment &att : status.media_attachments())
91  {
92  API::parametermap param_att;
93  if (!att.file().empty())
94  {
95  param_att.insert({ "file", { att.file() }});
96  }
97  else
98  {
99  ttdebug << "ERROR: Easy::Attachment::file can not be empty.\n";
100  error = 11;
101  return Status();
102  }
103  if (!att.description().empty())
104  {
105  param_att.insert({ "description", { att.description() }});
106  }
107  if (!att.focus().empty())
108  {
109  param_att.insert({ "focus",
110  { std::to_string(att.focus()[0]) + ',' +
111  std::to_string(att.focus()[1]) }});
112  }
113 
114  error = post(API::v1::media, param_att, answer);
115  if (error == 0)
116  {
117  Attachment attachment(answer);
118  media_ids.push_back(std::to_string(attachment.id()));
119  }
120  else
121  {
122  ttdebug << "ERROR: Could not upload file.\n";
123  return Status();
124  }
125  }
126 
127  parameters.insert({ "media_ids", media_ids });
128  }
129 
130  error = post(API::v1::statuses, parameters, answer);
131  if (error == 0)
132  {
133  return Status(answer);
134  }
135  else
136  {
137  return Status();
138  }
139 }
bool sensitive() const
Returns true if the attachments should be hidden by default.
Definition: status.cpp:244
+
32 {
33  API::parametermap parameters;
34  string answer;
35  error = 0;
36 
37  if (!status.content().empty())
38  {
39  parameters.insert({ "status", { status.content() }});
40  }
41  else
42  {
43  ttdebug << "ERROR: Easy::Status::content can not be empty.\n";
44  error = 11;
45  return Status();
46  }
47 
48  if (!status.in_reply_to_id().empty())
49  {
50  parameters.insert({ "in_reply_to_id",
51  { status.in_reply_to_id() }});
52  }
53  if (status.sensitive())
54  {
55  parameters.insert({ "sensitive", { "true" }});
56  }
57  if (!status.spoiler_text().empty())
58  {
59  parameters.insert({ "spoiler_text", { status.spoiler_text() }});
60  }
61  if (status.visibility() != visibility_type::Undefined)
62  {
63  string visibility;
64  switch (status.visibility())
65  {
66  case visibility_type::Direct:
67  visibility = "direct";
68  break;
69  case visibility_type::Private:
70  visibility = "private";
71  break;
72  case visibility_type::Unlisted:
73  visibility = "unlisted";
74  break;
75  case visibility_type::Public:
76  visibility = "public";
77  break;
78  default:
79  break;
80  };
81  parameters.insert({ "visibility", { visibility }});
82  }
83  if (!status.language().empty())
84  {
85  parameters.insert({ "language", { status.language() }});
86  }
87  if (!status.media_attachments().empty())
88  {
89  std::vector<string> media_ids;
90  for (const Attachment &att : status.media_attachments())
91  {
92  API::parametermap param_att;
93  if (!att.file().empty())
94  {
95  param_att.insert({ "file", { att.file() }});
96  }
97  else
98  {
99  ttdebug << "ERROR: Easy::Attachment::file can not be empty.\n";
100  error = 11;
101  return Status();
102  }
103  if (!att.description().empty())
104  {
105  param_att.insert({ "description", { att.description() }});
106  }
107  if (!att.focus().empty())
108  {
109  param_att.insert({ "focus",
110  { std::to_string(att.focus()[0]) + ',' +
111  std::to_string(att.focus()[1]) }});
112  }
113 
114  error = post(API::v1::media, param_att, answer);
115  if (error == 0)
116  {
117  Attachment attachment(answer);
118  media_ids.push_back(attachment.id());
119  }
120  else
121  {
122  ttdebug << "ERROR: Could not upload file.\n";
123  return Status();
124  }
125  }
126 
127  parameters.insert({ "media_ids", media_ids });
128  }
129 
130  error = post(API::v1::statuses, parameters, answer);
131  if (error == 0)
132  {
133  return Status(answer);
134  }
135  else
136  {
137  return Status();
138  }
139 }
bool sensitive() const
Returns true if the attachments should be hidden by default.
Definition: status.cpp:244
Class to hold attachments.
Definition: attachment.hpp:44
uint_fast16_t post(const Mastodon::API::v1 &call, string &answer)
Make a POST request which doesn&#39;t require parameters.
Definition: post.cpp:140
const std::vector< Attachment > media_attachments() const
Returns the attachments.
Definition: status.cpp:162
@@ -857,7 +857,7 @@ static const string strtim
const string content() const
Returns content of status.
Definition: status.cpp:93
std::map< string, std::vector< string > > parametermap
Used for passing parameters.
Definition: mastodon-cpp.hpp:189
const string spoiler_text() const
Returns the spoiler text.
Definition: status.cpp:255
-
uint_fast64_t in_reply_to_id() const
Returns the ID of the status it replies to.
Definition: status.cpp:135
+
const string in_reply_to_id() const
Returns the ID of the status it replies to.
Definition: status.cpp:135
diff --git a/docs/classMastodon_1_1Easy_1_1Account-members.html b/docs/classMastodon_1_1Easy_1_1Account-members.html index 61ff179..3696411 100644 --- a/docs/classMastodon_1_1Easy_1_1Account-members.html +++ b/docs/classMastodon_1_1Easy_1_1Account-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
@@ -81,7 +81,7 @@ $(function() { header() constMastodon::Easy::Account header(const string &header)Mastodon::Easy::Account header_static() constMastodon::Easy::Account - id() constMastodon::Easy::Account + id() constMastodon::Easy::Account locked() constMastodon::Easy::Account locked(const bool &locked)Mastodon::Easy::Account moved() constMastodon::Easy::Account diff --git a/docs/classMastodon_1_1Easy_1_1Account.html b/docs/classMastodon_1_1Easy_1_1Account.html index ce91888..eba0c2b 100644 --- a/docs/classMastodon_1_1Easy_1_1Account.html +++ b/docs/classMastodon_1_1Easy_1_1Account.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
@@ -135,9 +135,9 @@ Public Member Functions const string header_static () const  Returns URL of static header image. More...
  -uint_fast64_t id () const - Returns account-ID. More...
-  +const string id () const + Returns account-ID. More...
+  bool locked () const  Returns true if the account is locked. More...
  @@ -655,14 +655,14 @@ std::uint_fast64_t stouint
- -

◆ id()

+ +

◆ id()

- + @@ -672,7 +672,7 @@ std::uint_fast64_t  diff --git a/docs/classMastodon_1_1Easy_1_1Account_1_1Source.html b/docs/classMastodon_1_1Easy_1_1Account_1_1Source.html index 02cb517..8a3bdcd 100644 --- a/docs/classMastodon_1_1Easy_1_1Account_1_1Source.html +++ b/docs/classMastodon_1_1Easy_1_1Account_1_1Source.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Application-members.html b/docs/classMastodon_1_1Easy_1_1Application-members.html index 7af5991..93ed5ba 100644 --- a/docs/classMastodon_1_1Easy_1_1Application-members.html +++ b/docs/classMastodon_1_1Easy_1_1Application-members.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Application.html b/docs/classMastodon_1_1Easy_1_1Application.html index 8c2fef5..f10c924 100644 --- a/docs/classMastodon_1_1Easy_1_1Application.html +++ b/docs/classMastodon_1_1Easy_1_1Application.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Attachment-members.html b/docs/classMastodon_1_1Easy_1_1Attachment-members.html index 2d7e06a..9a27518 100644 --- a/docs/classMastodon_1_1Easy_1_1Attachment-members.html +++ b/docs/classMastodon_1_1Easy_1_1Attachment-members.html @@ -19,7 +19,7 @@ @@ -77,7 +77,7 @@ $(function() { - + diff --git a/docs/classMastodon_1_1Easy_1_1Attachment.html b/docs/classMastodon_1_1Easy_1_1Attachment.html index b4c729c..3308683 100644 --- a/docs/classMastodon_1_1Easy_1_1Attachment.html +++ b/docs/classMastodon_1_1Easy_1_1Attachment.html @@ -19,7 +19,7 @@ @@ -115,9 +115,9 @@ Public Member Functions - - - + + + @@ -544,14 +544,14 @@ std::uint_fast64_t  @@ -60,18 +60,18 @@ $(function() { Public Member Functions - - - - - - - - - - - - + + + + + + + + + + + +
std::uint_fast64_t Account::id const string Account::id ( ) conststouint

Returns account-ID.

Since
before 0.11.0
-
158 {
159  return stouint64(get_string("id"));
160 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
+
158 {
159  return get_string("id");
160 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
diff --git a/docs/classMastodon_1_1Easy_1_1Account_1_1Source-members.html b/docs/classMastodon_1_1Easy_1_1Account_1_1Source-members.html index adcba36..64be4af 100644 --- a/docs/classMastodon_1_1Easy_1_1Account_1_1Source-members.html +++ b/docs/classMastodon_1_1Easy_1_1Account_1_1Source-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
get_vector(const string &key) constMastodon::Easy::Entityprotected
height() constMastodon::Easy::Attachment
height_small() constMastodon::Easy::Attachment
id() constMastodon::Easy::Attachment
id() constMastodon::Easy::Attachment
preview_url() constMastodon::Easy::Attachment
remote_url() constMastodon::Easy::Attachment
set(const string &key, const Json::Value &value)Mastodon::Easy::Entityprotected
mastodon-cpp -  0.21.0 +  0.30.0
uint_fast64_t height_small () const
 Returns the height of the preview image. More...
 
uint_fast64_t id () const
 Returns the ID of the attachment. More...
 
const string id () const
 Returns the ID of the attachment. More...
 
const string preview_url () const
 Returns the URL of the preview image. More...
 
stouint - -

◆ id()

+ +

◆ id()

- + @@ -561,7 +561,7 @@ std::uint_fast64_t  diff --git a/docs/classMastodon_1_1Easy_1_1Card.html b/docs/classMastodon_1_1Easy_1_1Card.html index 54040e9..379a6d1 100644 --- a/docs/classMastodon_1_1Easy_1_1Card.html +++ b/docs/classMastodon_1_1Easy_1_1Card.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Context-members.html b/docs/classMastodon_1_1Easy_1_1Context-members.html index 6c38b35..3f4a2c9 100644 --- a/docs/classMastodon_1_1Easy_1_1Context-members.html +++ b/docs/classMastodon_1_1Easy_1_1Context-members.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Context.html b/docs/classMastodon_1_1Easy_1_1Context.html index 89e7c89..d5aa8c4 100644 --- a/docs/classMastodon_1_1Easy_1_1Context.html +++ b/docs/classMastodon_1_1Easy_1_1Context.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Emoji-members.html b/docs/classMastodon_1_1Easy_1_1Emoji-members.html index e1af9fc..ff170f7 100644 --- a/docs/classMastodon_1_1Easy_1_1Emoji-members.html +++ b/docs/classMastodon_1_1Easy_1_1Emoji-members.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Emoji.html b/docs/classMastodon_1_1Easy_1_1Emoji.html index b40e3a0..b78b2c8 100644 --- a/docs/classMastodon_1_1Easy_1_1Emoji.html +++ b/docs/classMastodon_1_1Easy_1_1Emoji.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Entity-members.html b/docs/classMastodon_1_1Easy_1_1Entity-members.html index 3d355b2..f06b1da 100644 --- a/docs/classMastodon_1_1Easy_1_1Entity-members.html +++ b/docs/classMastodon_1_1Easy_1_1Entity-members.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Entity.html b/docs/classMastodon_1_1Easy_1_1Entity.html index 3fe74e7..ac37eb6 100644 --- a/docs/classMastodon_1_1Easy_1_1Entity.html +++ b/docs/classMastodon_1_1Easy_1_1Entity.html @@ -19,7 +19,7 @@ @@ -577,7 +577,7 @@ std::uint_fast64_t  diff --git a/docs/classMastodon_1_1Easy_1_1Instance.html b/docs/classMastodon_1_1Easy_1_1Instance.html index 34a1d56..c668d55 100644 --- a/docs/classMastodon_1_1Easy_1_1Instance.html +++ b/docs/classMastodon_1_1Easy_1_1Instance.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Link-members.html b/docs/classMastodon_1_1Easy_1_1Link-members.html index 73a558b..c8b83e4 100644 --- a/docs/classMastodon_1_1Easy_1_1Link-members.html +++ b/docs/classMastodon_1_1Easy_1_1Link-members.html @@ -19,7 +19,7 @@ @@ -51,10 +51,10 @@ $(function() {

This is the complete list of members for Mastodon::Easy::Link, including all inherited members.

std::uint_fast64_t Attachment::id const string Attachment::id ( ) conststouint

Returns the ID of the attachment.

Since
before 0.11.0
-
143 {
144  return stouint64(get_string("id"));
145 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
+
143 {
144  return get_string("id");
145 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
diff --git a/docs/classMastodon_1_1Easy_1_1Card-members.html b/docs/classMastodon_1_1Easy_1_1Card-members.html index 31fc3ec..4c4485d 100644 --- a/docs/classMastodon_1_1Easy_1_1Card-members.html +++ b/docs/classMastodon_1_1Easy_1_1Card-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
stouint

Returns true if the Entity holds valid data.

Since
before 0.11.0 (virtual since 0.18.2)
-

Implemented in Mastodon::Easy::Account::Source, Mastodon::Easy::Tag, Mastodon::Easy::Status, Mastodon::Easy::Account, Mastodon::Easy::Tag::History, Mastodon::Easy::Notification, Mastodon::Easy::Results, Mastodon::Easy::Instance, Mastodon::Easy::Attachment, Mastodon::Easy::Context, Mastodon::Easy::List, Mastodon::Easy::Mention, Mastodon::Easy::PushSubscription, Mastodon::Easy::Card, Mastodon::Easy::Relationship, Mastodon::Easy::Report, Mastodon::Easy::Application, and Mastodon::Easy::Emoji.

+

Implemented in Mastodon::Easy::Account::Source, Mastodon::Easy::Tag, Mastodon::Easy::Status, Mastodon::Easy::Account, Mastodon::Easy::Tag::History, Mastodon::Easy::Notification, Mastodon::Easy::Results, Mastodon::Easy::Instance, Mastodon::Easy::Attachment, Mastodon::Easy::Context, Mastodon::Easy::List, Mastodon::Easy::Mention, Mastodon::Easy::Card, Mastodon::Easy::PushSubscription, Mastodon::Easy::Relationship, Mastodon::Easy::Report, Mastodon::Easy::Application, and Mastodon::Easy::Emoji.

diff --git a/docs/classMastodon_1_1Easy_1_1Instance-members.html b/docs/classMastodon_1_1Easy_1_1Instance-members.html index 8413c6c..80f9bd2 100644 --- a/docs/classMastodon_1_1Easy_1_1Instance-members.html +++ b/docs/classMastodon_1_1Easy_1_1Instance-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
- - - - + + + +
Link(const string &link_header)Mastodon::Easy::Linkexplicit
max_id() constMastodon::Easy::Link
next() constMastodon::Easy::Link
prev() constMastodon::Easy::Link
since_id() constMastodon::Easy::Link
max_id() constMastodon::Easy::Link
next() constMastodon::Easy::Link
prev() constMastodon::Easy::Link
since_id() constMastodon::Easy::Link
mastodon-cpp -  0.21.0 +  0.30.0
 Link (const string &link_header)
 
uint_fast64_t next () const
 Returns max_id. More...
 
uint_fast64_t max_id () const
 Returns max_id. More...
 
uint_fast64_t prev () const
 Returns since_id. More...
 
uint_fast64_t since_id () const
 Returns since_id. More...
 
const string next () const
 Returns max_id. More...
 
const string max_id () const
 Returns max_id. More...
 
const string prev () const
 Returns since_id. More...
 
const string since_id () const
 Returns since_id. More...
 

Detailed Description

Class to hold the Link-header.

@@ -108,18 +108,18 @@ Public Member Functions
Since
before 0.11.0
-
119 : _next(0)
120 , _prev(0)
121 {
122  std::regex renext("max_id=([[:digit:]]*)");
123  std::regex reprev("since_id=([[:digit:]]*)");
124  std::smatch match;
125 
126  if (std::regex_search(link_header, match, renext))
127  {
128  _next = std::stoull(match[1].str());
129  }
130  if (std::regex_search(link_header, match, reprev))
131  {
132  _prev = std::stoull(match[1].str());
133  }
134 }
+
119 : _next()
120 , _prev()
121 {
122  std::regex renext("max_id=([[:digit:]]*)");
123  std::regex reprev("since_id=([[:digit:]]*)");
124  std::smatch match;
125 
126  if (std::regex_search(link_header, match, renext))
127  {
128  _next = match[1].str();
129  }
130  if (std::regex_search(link_header, match, reprev))
131  {
132  _prev = match[1].str();
133  }
134 }

Member Function Documentation

- -

◆ max_id()

+ +

◆ max_id()

- + @@ -132,14 +132,14 @@ Public Member Functions
142 {
143  return _next;
144 }
- -

◆ next()

+ +

◆ next()

uint_fast64_t Easy::Link::max_id const string Easy::Link::max_id ( ) const
- + @@ -152,14 +152,14 @@ Public Member Functions
137 {
138  return _next;
139 }
- -

◆ prev()

+ +

◆ prev()

uint_fast64_t Easy::Link::next const string Easy::Link::next ( ) const
- + @@ -172,14 +172,14 @@ Public Member Functions
147 {
148  return _prev;
149 }
- -

◆ since_id()

+ +

◆ since_id()

uint_fast64_t Easy::Link::prev const string Easy::Link::prev ( ) const
- + diff --git a/docs/classMastodon_1_1Easy_1_1List-members.html b/docs/classMastodon_1_1Easy_1_1List-members.html index ba6fad0..fc79c30 100644 --- a/docs/classMastodon_1_1Easy_1_1List-members.html +++ b/docs/classMastodon_1_1Easy_1_1List-members.html @@ -19,7 +19,7 @@ @@ -62,7 +62,7 @@ $(function() { - + diff --git a/docs/classMastodon_1_1Easy_1_1List.html b/docs/classMastodon_1_1Easy_1_1List.html index fef74e5..5957fbd 100644 --- a/docs/classMastodon_1_1Easy_1_1List.html +++ b/docs/classMastodon_1_1Easy_1_1List.html @@ -19,7 +19,7 @@ @@ -76,9 +76,9 @@ Public Member Functions - - - + + + @@ -198,14 +198,14 @@ std::uint_fast64_t 
uint_fast64_t Easy::Link::since_id const string Easy::Link::since_id ( ) const
mastodon-cpp -  0.21.0 +  0.30.0
get_time_point(const string &key) constMastodon::Easy::Entityprotected
get_uint64(const string &key) constMastodon::Easy::Entityprotected
get_vector(const string &key) constMastodon::Easy::Entityprotected
id() constMastodon::Easy::List
id() constMastodon::Easy::List
List(const string &json)Mastodon::Easy::Listexplicit
List()Mastodon::Easy::List
set(const string &key, const Json::Value &value)Mastodon::Easy::Entityprotected
mastodon-cpp -  0.21.0 +  0.30.0
virtual bool valid () const
 Returns true if the Entity holds valid data. More...
 
uint_fast64_t id () const
 Returns list-ID. More...
 
const string id () const
 Returns list-ID. More...
 
const string title () const
 Returns title. More...
 
stouint

Member Function Documentation

- -

◆ id()

+ +

◆ id()

- + @@ -215,7 +215,7 @@ std::uint_fast64_t  @@ -63,7 +63,7 @@ $(function() { - + diff --git a/docs/classMastodon_1_1Easy_1_1Mention.html b/docs/classMastodon_1_1Easy_1_1Mention.html index e69d5a4..2d823d7 100644 --- a/docs/classMastodon_1_1Easy_1_1Mention.html +++ b/docs/classMastodon_1_1Easy_1_1Mention.html @@ -19,7 +19,7 @@ @@ -79,9 +79,9 @@ Public Member Functions - - - + + + @@ -225,14 +225,14 @@ std::uint_fast64_t 
uint_fast64_t List::id const string List::id ( ) conststouint

Returns list-ID.

Since
before 0.11.0
-
44 {
45  return stouint64(get_string("id"));
46 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
+
44 {
45  return get_string("id");
46 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
diff --git a/docs/classMastodon_1_1Easy_1_1Mention-members.html b/docs/classMastodon_1_1Easy_1_1Mention-members.html index 765b2d8..eb8b097 100644 --- a/docs/classMastodon_1_1Easy_1_1Mention-members.html +++ b/docs/classMastodon_1_1Easy_1_1Mention-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
get_time_point(const string &key) constMastodon::Easy::Entityprotected
get_uint64(const string &key) constMastodon::Easy::Entityprotected
get_vector(const string &key) constMastodon::Easy::Entityprotected
id() constMastodon::Easy::Mention
id() constMastodon::Easy::Mention
Mention(const string &json)Mastodon::Easy::Mentionexplicit
Mention()Mastodon::Easy::Mention
set(const string &key, const Json::Value &value)Mastodon::Easy::Entityprotected
mastodon-cpp -  0.21.0 +  0.30.0
const string acct () const
 Returns acct. More...
 
uint_fast64_t id () const
 Returns account ID. More...
 
const string id () const
 Returns account ID. More...
 
const string url () const
 Returns the URL of user's profile. More...
 
stouint - -

◆ id()

+ +

◆ id()

- + @@ -242,7 +242,7 @@ std::uint_fast64_t  @@ -64,7 +64,7 @@ $(function() { - + diff --git a/docs/classMastodon_1_1Easy_1_1Notification.html b/docs/classMastodon_1_1Easy_1_1Notification.html index 29ecd1f..e3d85cf 100644 --- a/docs/classMastodon_1_1Easy_1_1Notification.html +++ b/docs/classMastodon_1_1Easy_1_1Notification.html @@ -19,7 +19,7 @@ @@ -82,9 +82,9 @@ Public Member Functions - - - + + + @@ -249,14 +249,14 @@ std::uint_fast64_t 
uint_fast64_t Mention::id const string Mention::id ( ) conststouint

Returns account ID.

Since
before 0.11.0
-
49 {
50  return stouint64(get_string("id"));
51 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
+
49 {
50  return get_string("id");
51 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
diff --git a/docs/classMastodon_1_1Easy_1_1Notification-members.html b/docs/classMastodon_1_1Easy_1_1Notification-members.html index b473d37..8781de8 100644 --- a/docs/classMastodon_1_1Easy_1_1Notification-members.html +++ b/docs/classMastodon_1_1Easy_1_1Notification-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
get_time_point(const string &key) constMastodon::Easy::Entityprotected
get_uint64(const string &key) constMastodon::Easy::Entityprotected
get_vector(const string &key) constMastodon::Easy::Entityprotected
id() constMastodon::Easy::Notification
id() constMastodon::Easy::Notification
Notification(const string &json)Mastodon::Easy::Notificationexplicit
Notification()Mastodon::Easy::Notification
set(const string &key, const Json::Value &value)Mastodon::Easy::Entityprotected
mastodon-cpp -  0.21.0 +  0.30.0
const system_clock::time_point created_at () const
 Returns time of creation. More...
 
uint_fast64_t id () const
 Returns notification ID. More...
 
const string id () const
 Returns notification ID. More...
 
const Status status () const
 Returns the Status associated with the notification, if applicable. More...
 
stouint - -

◆ id()

+ +

◆ id()

- + @@ -266,7 +266,7 @@ std::uint_fast64_t  @@ -64,7 +64,7 @@ $(function() { - + diff --git a/docs/classMastodon_1_1Easy_1_1PushSubscription.html b/docs/classMastodon_1_1Easy_1_1PushSubscription.html index e95358c..dcdbd13 100644 --- a/docs/classMastodon_1_1Easy_1_1PushSubscription.html +++ b/docs/classMastodon_1_1Easy_1_1PushSubscription.html @@ -19,7 +19,7 @@ @@ -77,9 +77,9 @@ Public Member Functions - - - + + + @@ -253,14 +253,14 @@ std::uint_fast64_t 
uint_fast64_t Notification::id const string Notification::id ( ) conststouint

Returns notification ID.

Since
before 0.11.0
-
62 {
63  return stouint64(get_string("id"));
64 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
+
62 {
63  return get_string("id");
64 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
diff --git a/docs/classMastodon_1_1Easy_1_1PushSubscription-members.html b/docs/classMastodon_1_1Easy_1_1PushSubscription-members.html index 5a46f9c..ef7052c 100644 --- a/docs/classMastodon_1_1Easy_1_1PushSubscription-members.html +++ b/docs/classMastodon_1_1Easy_1_1PushSubscription-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
get_time_point(const string &key) constMastodon::Easy::Entityprotected
get_uint64(const string &key) constMastodon::Easy::Entityprotected
get_vector(const string &key) constMastodon::Easy::Entityprotected
id() constMastodon::Easy::PushSubscription
id() constMastodon::Easy::PushSubscription
PushSubscription(const string &json)Mastodon::Easy::PushSubscriptionexplicit
PushSubscription()Mastodon::Easy::PushSubscription
s_to_b(const string &str) constMastodon::Easy::PushSubscriptionprotected
mastodon-cpp -  0.21.0 +  0.30.0
virtual bool valid () const
 Returns true if the Entity holds valid data. More...
 
uint_fast64_t id () const
 Returns push subscription ID. More...
 
const string id () const
 Returns push subscription ID. More...
 
const string endpoint () const
 Returns the endpoint URL. More...
 
stouint - -

◆ id()

+ +

◆ id()

- + @@ -270,7 +270,7 @@ std::uint_fast64_t  @@ -67,7 +67,7 @@ $(function() { - + diff --git a/docs/classMastodon_1_1Easy_1_1Relationship.html b/docs/classMastodon_1_1Easy_1_1Relationship.html index 0f4376a..d24cadc 100644 --- a/docs/classMastodon_1_1Easy_1_1Relationship.html +++ b/docs/classMastodon_1_1Easy_1_1Relationship.html @@ -19,7 +19,7 @@ @@ -91,9 +91,9 @@ Public Member Functions - - - + + + @@ -327,14 +327,14 @@ std::uint_fast64_t 
uint_fast64_t PushSubscription::id const string PushSubscription::id ( ) conststouint

Returns push subscription ID.

Since
0.14.0
-
27 {
28  return stouint64(get_string("id"));
29 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
+
27 {
28  return get_string("id");
29 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
diff --git a/docs/classMastodon_1_1Easy_1_1Relationship-members.html b/docs/classMastodon_1_1Easy_1_1Relationship-members.html index 7b43109..7a09bf5 100644 --- a/docs/classMastodon_1_1Easy_1_1Relationship-members.html +++ b/docs/classMastodon_1_1Easy_1_1Relationship-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
get_time_point(const string &key) constMastodon::Easy::Entityprotected
get_uint64(const string &key) constMastodon::Easy::Entityprotected
get_vector(const string &key) constMastodon::Easy::Entityprotected
id() constMastodon::Easy::Relationship
id() constMastodon::Easy::Relationship
muting() constMastodon::Easy::Relationship
muting_notifications() constMastodon::Easy::Relationship
Relationship(const string &json)Mastodon::Easy::Relationshipexplicit
mastodon-cpp -  0.21.0 +  0.30.0
bool following () const
 Returns true if the user is being following the account. More...
 
uint_fast64_t id () const
 Returns the target account ID. More...
 
const string id () const
 Returns the target account ID. More...
 
bool muting () const
 Returns true if the user is muting the account. More...
 
stouint - -

◆ id()

+ +

◆ id()

- + @@ -344,7 +344,7 @@ std::uint_fast64_t  @@ -63,7 +63,7 @@ $(function() { - + diff --git a/docs/classMastodon_1_1Easy_1_1Report.html b/docs/classMastodon_1_1Easy_1_1Report.html index b5b7225..857d99f 100644 --- a/docs/classMastodon_1_1Easy_1_1Report.html +++ b/docs/classMastodon_1_1Easy_1_1Report.html @@ -19,7 +19,7 @@ @@ -79,9 +79,9 @@ Public Member Functions - - - + + + @@ -219,14 +219,14 @@ std::uint_fast64_t 
uint_fast64_t Relationship::id const string Relationship::id ( ) conststouint

Returns the target account ID.

Since
before 0.11.0
-
73 {
74  return stouint64(get_string("id"));
75 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
+
73 {
74  return get_string("id");
75 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
diff --git a/docs/classMastodon_1_1Easy_1_1Report-members.html b/docs/classMastodon_1_1Easy_1_1Report-members.html index 5c350bc..55fcaa6 100644 --- a/docs/classMastodon_1_1Easy_1_1Report-members.html +++ b/docs/classMastodon_1_1Easy_1_1Report-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
get_time_point(const string &key) constMastodon::Easy::Entityprotected
get_uint64(const string &key) constMastodon::Easy::Entityprotected
get_vector(const string &key) constMastodon::Easy::Entityprotected
id() constMastodon::Easy::Report
id() constMastodon::Easy::Report
Report(const string &json)Mastodon::Easy::Reportexplicit
Report()Mastodon::Easy::Report
set(const string &key, const Json::Value &value)Mastodon::Easy::Entityprotected
mastodon-cpp -  0.21.0 +  0.30.0
bool action_taken () const
 Returns true if an action was taken in response to the report. More...
 
uint_fast64_t id () const
 Returns the ID of the report. More...
 
const string id () const
 Returns the ID of the report. More...
 
- Public Member Functions inherited from Mastodon::Easy::Entity
 Entity (const string &json)
 Constructs an Entity object from a JSON string. More...
stouint - -

◆ id()

+ +

◆ id()

- + @@ -236,7 +236,7 @@ std::uint_fast64_t  diff --git a/docs/classMastodon_1_1Easy_1_1Results.html b/docs/classMastodon_1_1Easy_1_1Results.html index a50884c..6aae1a4 100644 --- a/docs/classMastodon_1_1Easy_1_1Results.html +++ b/docs/classMastodon_1_1Easy_1_1Results.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Status-members.html b/docs/classMastodon_1_1Easy_1_1Status-members.html index e40f491..1f9b61d 100644 --- a/docs/classMastodon_1_1Easy_1_1Status-members.html +++ b/docs/classMastodon_1_1Easy_1_1Status-members.html @@ -19,7 +19,7 @@ @@ -71,10 +71,10 @@ $(function() { - - - - + + + + diff --git a/docs/classMastodon_1_1Easy_1_1Status.html b/docs/classMastodon_1_1Easy_1_1Status.html index 818ba5e..7fe5e41 100644 --- a/docs/classMastodon_1_1Easy_1_1Status.html +++ b/docs/classMastodon_1_1Easy_1_1Status.html @@ -19,7 +19,7 @@ @@ -103,18 +103,18 @@ Public Member Functions - - - - - - - - - - - - + + + + + + + + + + + + @@ -481,14 +481,14 @@ std::uint_fast64_t 
uint_fast64_t Report::id const string Report::id ( ) conststouint

Returns the ID of the report.

Since
before 0.11.0
-
47 {
48  return stouint64(get_string("id"));
49 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
+
47 {
48  return get_string("id");
49 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
diff --git a/docs/classMastodon_1_1Easy_1_1Results-members.html b/docs/classMastodon_1_1Easy_1_1Results-members.html index afb488b..75c4c50 100644 --- a/docs/classMastodon_1_1Easy_1_1Results-members.html +++ b/docs/classMastodon_1_1Easy_1_1Results-members.html @@ -19,7 +19,7 @@
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
mastodon-cpp -  0.21.0 +  0.30.0
get_time_point(const string &key) constMastodon::Easy::Entityprotected
get_uint64(const string &key) constMastodon::Easy::Entityprotected
get_vector(const string &key) constMastodon::Easy::Entityprotected
id() constMastodon::Easy::Status
in_reply_to_account_id() constMastodon::Easy::Status
in_reply_to_id() constMastodon::Easy::Status
in_reply_to_id(const uint_fast64_t &in_reply_to_id)Mastodon::Easy::Status
id() constMastodon::Easy::Status
in_reply_to_account_id() constMastodon::Easy::Status
in_reply_to_id() constMastodon::Easy::Status
in_reply_to_id(const string &in_reply_to_id)Mastodon::Easy::Status
language() constMastodon::Easy::Status
language(const string &language)Mastodon::Easy::Status
media_attachments() constMastodon::Easy::Status
mastodon-cpp -  0.21.0 +  0.30.0
uint_fast64_t favourites_count () const
 Returns the number of favourites. More...
 
uint_fast64_t id () const
 Returns the ID of the status. More...
 
uint_fast64_t in_reply_to_id () const
 Returns the ID of the status it replies to. More...
 
Status in_reply_to_id (const uint_fast64_t &in_reply_to_id)
 Sets the ID of the status it replies to. More...
 
uint_fast64_t in_reply_to_account_id () const
 Returns the ID of the account it replies to. More...
 
const string id () const
 Returns the ID of the status. More...
 
const string in_reply_to_id () const
 Returns the ID of the status it replies to. More...
 
Status in_reply_to_id (const string &in_reply_to_id)
 Sets the ID of the status it replies to. More...
 
const string in_reply_to_account_id () const
 Returns the ID of the account it replies to. More...
 
const string language () const
 Returns the language of the status. More...
 
stouint - -

◆ id()

+ +

◆ id()

- + @@ -498,18 +498,18 @@ std::uint_fast64_t 
uint_fast64_t Status::id const string Status::id ( ) conststouint

Returns the ID of the status.

Since
before 0.11.0
-
131 {
132  return stouint64(get_string("id"));
133 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
+
131 {
132  return get_string("id");
133 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
- -

◆ in_reply_to_account_id()

+ +

◆ in_reply_to_account_id()

- + @@ -519,18 +519,18 @@ std::uint_fast64_t 
uint_fast64_t Status::in_reply_to_account_id const string Status::in_reply_to_account_id ( ) conststouint

Returns the ID of the account it replies to.

Since
before 0.11.0
-
147 {
148  return stouint64(get_string("in_reply_to_account_id"));
149 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
+
147 {
148  return get_string("in_reply_to_account_id");
149 }
const string get_string(const string &key) const
Returns the value of key as std::string.
Definition: entity.cpp:134
- -

◆ in_reply_to_id() [1/2]

+ +

◆ in_reply_to_id() [1/2]

- + @@ -540,12 +540,12 @@ std::uint_fast64_t  - + @@ -562,7 +562,7 @@ std::uint_fast64_t  diff --git a/docs/classMastodon_1_1Easy_1_1Tag.html b/docs/classMastodon_1_1Easy_1_1Tag.html index 0e9501f..a0143f0 100644 --- a/docs/classMastodon_1_1Easy_1_1Tag.html +++ b/docs/classMastodon_1_1Easy_1_1Tag.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Tag_1_1History-members.html b/docs/classMastodon_1_1Easy_1_1Tag_1_1History-members.html index 525e4ef..23f31ea 100644 --- a/docs/classMastodon_1_1Easy_1_1Tag_1_1History-members.html +++ b/docs/classMastodon_1_1Easy_1_1Tag_1_1History-members.html @@ -19,7 +19,7 @@ diff --git a/docs/classMastodon_1_1Easy_1_1Tag_1_1History.html b/docs/classMastodon_1_1Easy_1_1Tag_1_1History.html index 6286159..a756b52 100644 --- a/docs/classMastodon_1_1Easy_1_1Tag_1_1History.html +++ b/docs/classMastodon_1_1Easy_1_1Tag_1_1History.html @@ -19,7 +19,7 @@ diff --git a/docs/classes.html b/docs/classes.html index ae2dedd..331069c 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -19,7 +19,7 @@ diff --git a/docs/context_8hpp_source.html b/docs/context_8hpp_source.html index 1493232..1e5d8b5 100644 --- a/docs/context_8hpp_source.html +++ b/docs/context_8hpp_source.html @@ -19,7 +19,7 @@ diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 4756c12..3efb773 100644 --- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -19,7 +19,7 @@ diff --git a/docs/dir_9d328871126a6a5820f3cd5c0c41741e.html b/docs/dir_9d328871126a6a5820f3cd5c0c41741e.html index ca797d9..0afee55 100644 --- a/docs/dir_9d328871126a6a5820f3cd5c0c41741e.html +++ b/docs/dir_9d328871126a6a5820f3cd5c0c41741e.html @@ -19,7 +19,7 @@ diff --git a/docs/dir_da61e3e9a357748887e3ca8d7c5a0c16.html b/docs/dir_da61e3e9a357748887e3ca8d7c5a0c16.html index 9d1bcc1..b6d8094 100644 --- a/docs/dir_da61e3e9a357748887e3ca8d7c5a0c16.html +++ b/docs/dir_da61e3e9a357748887e3ca8d7c5a0c16.html @@ -19,7 +19,7 @@ diff --git a/docs/dir_e526f556af6ddef7955f0f6556f0f4d0.html b/docs/dir_e526f556af6ddef7955f0f6556f0f4d0.html index acde292..9f9abda 100644 --- a/docs/dir_e526f556af6ddef7955f0f6556f0f4d0.html +++ b/docs/dir_e526f556af6ddef7955f0f6556f0f4d0.html @@ -19,7 +19,7 @@ diff --git a/docs/easy_8hpp_source.html b/docs/easy_8hpp_source.html index 534e054..7e15bfa 100644 --- a/docs/easy_8hpp_source.html +++ b/docs/easy_8hpp_source.html @@ -19,7 +19,7 @@ @@ -47,25 +47,22 @@ $(function() {
easy.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_EASY_CPP_HPP
18 #define MASTODON_EASY_CPP_HPP
19 
20 #include <string>
21 #include <cstdint>
22 #include <chrono>
23 #include <vector>
24 #include <utility>
25 #include <functional>
26 #include <jsoncpp/json/json.h>
27 
28 // If we are compiling mastodon-cpp, use another include path
29 #ifdef MASTODON_CPP
30  #include "mastodon-cpp.hpp"
31 #else
32  #include <mastodon-cpp/mastodon-cpp.hpp>
33 #endif
34 
35 using std::string;
36 using std::vector;
37 using std::uint_fast64_t;
38 using std::uint_fast16_t;
39 using std::chrono::system_clock;
40 
41 namespace Mastodon
42 {
48 class Easy : public API
49 {
50 public:
56  enum class event_type
57  {
58  Update,
60  Delete,
61  Undefined
62  };
63 
69  enum class visibility_type
70  {
71  Direct,
72  Private,
73  Unlisted,
74  Public,
75  Undefined
76  };
77 
83  enum class attachment_type
84  {
85  Image,
86  Video,
87  Gifv,
88  Unknown,
89  Undefined
90  };
91 
97  enum class card_type
98  {
99  Link,
100  Photo,
101  Video,
102  Rich,
103  Undefined
104  };
105 
111  enum class notification_type
112  {
113  Mention,
114  Reblog,
115  Favourite,
116  Follow,
117  Undefined
118  };
119 
125  typedef std::pair<event_type, string> stream_event;
126 
134  typedef std::map<Easy::notification_type, bool> alertmap;
135 
136  class Account;
137  class Application;
138  class Attachment;
139  class Card;
140  class Context;
141  class Emoji;
142  class Instance;
143  class List;
144  class Mention;
145  class Notification;
146  class Relationship;
147  class Report;
148  class Results;
149  class Status;
150  class Tag;
151  class PushSubscription;
152 
160  class Link
161  {
162  public:
168  explicit Link(const string &link_header);
169 
175  uint_fast64_t next() const;
176 
182  uint_fast64_t max_id() const;
183 
189  uint_fast64_t prev() const;
190 
196  uint_fast64_t since_id() const;
197 
198  private:
199  uint_fast64_t _next;
200  uint_fast64_t _prev;
201  };
202 
214  explicit Easy(const string &instance, const string &access_token);
215 
225  static const std::vector<string> json_array_to_vector(const string &json);
226 
236  static const std::vector<stream_event>
237  parse_stream(const std::string &streamdata);
238 
244  const Link get_link() const;
245 
264  static const string strtime_utc(const system_clock::time_point &timepoint,
265  const string &format);
266 
274  static const string strtime_local(const system_clock::time_point &timepoint,
275  const string &format);
276 
277  // #### simple calls ####
278 
289  const Status send_post(const Status &status, uint_fast16_t &error);
290 
296  const Status send_toot(const Status &status, uint_fast16_t &error);
297 
310  const vector<Notification> get_notifications(
311  uint_fast16_t &error, const uint_fast16_t limit = 20,
312  const uint_fast64_t since_id = 0, const uint_fast64_t max_id = 0);
313 
319  class Entity
320  {
321  public:
329  explicit Entity(const string &json);
330 
336  Entity();
337 
345  void from_string(const string &json);
346 
354  const Json::Value to_object() const;
355 
361  virtual bool valid() const = 0;
362 
368  const string error() const;
369 
398  bool was_set() const;
399 
400  protected:
407  const Json::Value get(const string &key) const;
408 
414  const string get_string(const string &key) const;
415 
421  uint_fast64_t get_uint64(const string &key) const;
422 
428  double get_double(const string &key) const;
429 
430  // TODO: Maybe an enum would be better?
436  bool get_bool(const string &key) const;
437 
443  const system_clock::time_point get_time_point(const string &key) const;
444 
451  const std::vector<string> get_vector(const string &key) const;
452 
458  void set(const string &key, const Json::Value &value);
459 
460  std::uint_fast64_t stouint64(const string &str) const;
461 
471  bool check_valid(const std::vector<string> &attributes) const;
472 
473  private:
474  Json::Value _tree;
475  mutable bool _was_set;
476  };
477 
478 protected:
479  inline static const string strtime
480  (const system_clock::time_point &timepoint,
481  const string &format, const bool &utc);
482 };
483 }
484 
485 #endif // MASTODON_EASY_CPP_HPP
Class for the Mastodon API.
Definition: mastodon-cpp.hpp:77
+
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_EASY_CPP_HPP
18 #define MASTODON_EASY_CPP_HPP
19 
20 #include <string>
21 #include <cstdint>
22 #include <chrono>
23 #include <vector>
24 #include <utility>
25 #include <functional>
26 #include <jsoncpp/json/json.h>
27 
28 // If we are compiling mastodon-cpp, use another include path
29 #ifdef MASTODON_CPP
30  #include "mastodon-cpp.hpp"
31 #else
32  #include <mastodon-cpp/mastodon-cpp.hpp>
33 #endif
34 
35 using std::string;
36 using std::vector;
37 using std::uint_fast64_t;
38 using std::uint_fast16_t;
39 using std::chrono::system_clock;
40 
41 namespace Mastodon
42 {
48 class Easy : public API
49 {
50 public:
56  enum class event_type
57  {
58  Update,
60  Delete,
61  Undefined
62  };
63 
69  enum class visibility_type
70  {
71  Direct,
72  Private,
73  Unlisted,
74  Public,
75  Undefined
76  };
77 
83  enum class attachment_type
84  {
85  Image,
86  Video,
87  Gifv,
88  Unknown,
89  Undefined
90  };
91 
97  enum class card_type
98  {
99  Link,
100  Photo,
101  Video,
102  Rich,
103  Undefined
104  };
105 
111  enum class notification_type
112  {
113  Mention,
114  Reblog,
115  Favourite,
116  Follow,
117  Undefined
118  };
119 
125  typedef std::pair<event_type, string> stream_event;
126 
134  typedef std::map<Easy::notification_type, bool> alertmap;
135 
136  class Account;
137  class Application;
138  class Attachment;
139  class Card;
140  class Context;
141  class Emoji;
142  class Instance;
143  class List;
144  class Mention;
145  class Notification;
146  class Relationship;
147  class Report;
148  class Results;
149  class Status;
150  class Tag;
151  class PushSubscription;
152 
160  class Link
161  {
162  public:
168  explicit Link(const string &link_header);
169 
175  const string next() const;
176 
182  const string max_id() const;
183 
189  const string prev() const;
190 
196  const string since_id() const;
197 
198  private:
199  string _next;
200  string _prev;
201  };
202 
214  explicit Easy(const string &instance, const string &access_token);
215 
225  static const std::vector<string> json_array_to_vector(const string &json);
226 
236  static const std::vector<stream_event>
237  parse_stream(const std::string &streamdata);
238 
244  const Link get_link() const;
245 
264  static const string strtime_utc(const system_clock::time_point &timepoint,
265  const string &format);
266 
274  static const string strtime_local(const system_clock::time_point &timepoint,
275  const string &format);
276 
277  // #### simple calls ####
278 
289  const Status send_post(const Status &status, uint_fast16_t &error);
290 
296  const Status send_toot(const Status &status, uint_fast16_t &error);
297 
310  const vector<Notification> get_notifications(
311  uint_fast16_t &error, const uint_fast16_t limit = 20,
312  const string since_id = 0, const string max_id = 0);
313 
319  class Entity
320  {
321  public:
329  explicit Entity(const string &json);
330 
336  Entity();
337 
345  void from_string(const string &json);
346 
354  const Json::Value to_object() const;
355 
361  virtual bool valid() const = 0;
362 
368  const string error() const;
369 
398  bool was_set() const;
399 
400  protected:
407  const Json::Value get(const string &key) const;
408 
414  const string get_string(const string &key) const;
415 
421  uint_fast64_t get_uint64(const string &key) const;
422 
428  double get_double(const string &key) const;
429 
430  // TODO: Maybe an enum would be better?
436  bool get_bool(const string &key) const;
437 
443  const system_clock::time_point get_time_point(const string &key) const;
444 
451  const std::vector<string> get_vector(const string &key) const;
452 
458  void set(const string &key, const Json::Value &value);
459 
460  std::uint_fast64_t stouint64(const string &str) const;
461 
471  bool check_valid(const std::vector<string> &attributes) const;
472 
473  private:
474  Json::Value _tree;
475  mutable bool _was_set;
476  };
477 
478 protected:
479  inline static const string strtime
480  (const system_clock::time_point &timepoint,
481  const string &format, const bool &utc);
482 };
483 }
484 
485 #endif // MASTODON_EASY_CPP_HPP
Class for the Mastodon API.
Definition: mastodon-cpp.hpp:77
static const string strtime_utc(const system_clock::time_point &timepoint, const string &format)
Converts a time_point to a string.
Definition: easy.cpp:85
Class to hold tags.
Definition: tag.hpp:44
- +
Entity()
Constructs an empty Entity object.
Definition: entity.cpp:65
Class to hold notifications.
Definition: notification.hpp:48
-
Class to hold attachments.
Definition: attachment.hpp:44
Class to hold cards.
Definition: card.hpp:42
card_type
Describes the card type.
Definition: easy.hpp:97
Child of Mastodon::API with abstract methods.
Definition: easy.hpp:48
- -
Class to hold instances.
Definition: instance.hpp:45
double get_double(const string &key) const
Returns the value of key as double.
Definition: entity.cpp:162
virtual bool valid() const =0
Returns true if the Entity holds valid data.
-
Class to hold push subscriptions.
Definition: pushsubscription.hpp:43
+
Class to hold push subscriptions.
Definition: pushsubscription.hpp:42
const Status send_post(const Status &status, uint_fast16_t &error)
Sends a toot.
Definition: simple_calls.cpp:31
static const std::vector< string > json_array_to_vector(const string &json)
Turns a JSON array into a vector of strings.
Definition: easy.cpp:31
Easy(const string &instance, const string &access_token)
Constructs a new Easy object.
Definition: easy.cpp:27
@@ -73,12 +70,16 @@ $(function() {
attachment_type
Describes the attachment type.
Definition: easy.hpp:83
bool was_set() const
Returns true if the last requested value was set, false if it was unset.
Definition: entity.cpp:88
notification_type
Describes the notification type.
Definition: easy.hpp:111
+ +
const vector< Notification > get_notifications(uint_fast16_t &error, const uint_fast16_t limit=20, const string since_id=0, const string max_id=0)
Gets notifications.
Definition: simple_calls.cpp:141
const Json::Value to_object() const
Returns the JSON object of the Entity.
Definition: entity.cpp:60
Class to hold mentions.
Definition: mention.hpp:43
std::map< Easy::notification_type, bool > alertmap
Map of &#39;notification type&#39; and &#39;push is requested or not&#39;.
Definition: easy.hpp:134
-
Class to hold reports.
Definition: report.hpp:42
+
Class to hold reports.
Definition: report.hpp:41
static const string strtime_local(const system_clock::time_point &timepoint, const string &format)
See strtime_utc.
Definition: easy.cpp:91
+
event_type
Describes the event type.
Definition: easy.hpp:56
+
uint_fast64_t get_uint64(const string &key) const
Returns the value of key as std::uint_fast64_t.
Definition: entity.cpp:148
bool check_valid(const std::vector< string > &attributes) const
Checks if an Entity is valid.
Definition: entity.cpp:69
Class to hold statuses.
Definition: status.hpp:59
@@ -100,7 +101,6 @@ $(function() {
const std::vector< string > get_vector(const string &key) const
Returns the value of key as vector.
Definition: entity.cpp:210
const Link get_link() const
Gets the links from the last answer.
Definition: easy.cpp:80
Class to hold applications.
Definition: application.hpp:40
-
const vector< Notification > get_notifications(uint_fast16_t &error, const uint_fast16_t limit=20, const uint_fast64_t since_id=0, const uint_fast64_t max_id=0)
Gets notifications.
Definition: simple_calls.cpp:141
std::pair< event_type, string > stream_event
Used for stream events.
Definition: easy.hpp:125
diff --git a/docs/emoji_8hpp_source.html b/docs/emoji_8hpp_source.html index c6fd687..970eb9c 100644 --- a/docs/emoji_8hpp_source.html +++ b/docs/emoji_8hpp_source.html @@ -19,7 +19,7 @@
diff --git a/docs/example01_dump_json_8cpp-example.html b/docs/example01_dump_json_8cpp-example.html index 3dba947..27710f3 100644 --- a/docs/example01_dump_json_8cpp-example.html +++ b/docs/example01_dump_json_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example02_parse_account_8cpp-example.html b/docs/example02_parse_account_8cpp-example.html index 8478598..d26172b 100644 --- a/docs/example02_parse_account_8cpp-example.html +++ b/docs/example02_parse_account_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example03_mastocron_8cpp-example.html b/docs/example03_mastocron_8cpp-example.html index 8bc240c..c5fa9ec 100644 --- a/docs/example03_mastocron_8cpp-example.html +++ b/docs/example03_mastocron_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example04_update_credentials_8cpp-example.html b/docs/example04_update_credentials_8cpp-example.html index 625e8d7..665e431 100644 --- a/docs/example04_update_credentials_8cpp-example.html +++ b/docs/example04_update_credentials_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example05_follow_unfollow_8cpp-example.html b/docs/example05_follow_unfollow_8cpp-example.html index 644618d..64f19ed 100644 --- a/docs/example05_follow_unfollow_8cpp-example.html +++ b/docs/example05_follow_unfollow_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example06_toot_delete-toot_8cpp-example.html b/docs/example06_toot_delete-toot_8cpp-example.html index a8c2713..f0b8d4e 100644 --- a/docs/example06_toot_delete-toot_8cpp-example.html +++ b/docs/example06_toot_delete-toot_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example07_register_app_8cpp-example.html b/docs/example07_register_app_8cpp-example.html index 72212f7..8f50c0e 100644 --- a/docs/example07_register_app_8cpp-example.html +++ b/docs/example07_register_app_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example08_rate_limiting_8cpp-example.html b/docs/example08_rate_limiting_8cpp-example.html index f527177..2416106 100644 --- a/docs/example08_rate_limiting_8cpp-example.html +++ b/docs/example08_rate_limiting_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example09_streaming_api_8cpp-example.html b/docs/example09_streaming_api_8cpp-example.html index f090c20..178926b 100644 --- a/docs/example09_streaming_api_8cpp-example.html +++ b/docs/example09_streaming_api_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example10_simplify_8cpp-example.html b/docs/example10_simplify_8cpp-example.html index 7d7f021..947f265 100644 --- a/docs/example10_simplify_8cpp-example.html +++ b/docs/example10_simplify_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example11_post_media_8cpp-example.html b/docs/example11_post_media_8cpp-example.html index 30dccca..6485f1b 100644 --- a/docs/example11_post_media_8cpp-example.html +++ b/docs/example11_post_media_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/example12_easy_laststatus_8cpp-example.html b/docs/example12_easy_laststatus_8cpp-example.html index e2217d5..41cdd33 100644 --- a/docs/example12_easy_laststatus_8cpp-example.html +++ b/docs/example12_easy_laststatus_8cpp-example.html @@ -19,7 +19,7 @@ @@ -43,7 +43,7 @@ $(function() {
example12_easy_laststatus.cpp
-
/* This file is part of mastodon-cpp.
* Prints some information about your last status.
*/
// Don't compile this if the Easy-interface is turned off
#ifndef WITHOUT_EASY
#include <iostream>
#include <string>
#include <cstdint>
// If we are compiling mastodon-cpp, use another include path
#ifdef MASTODON_CPP
#include "mastodon-cpp.hpp"
#include "easy/all.hpp"
#else
#include <mastodon-cpp/mastodon-cpp.hpp>
// Include all headers in mastodon-cpp/easy/
#include <mastodon-cpp/easy/all.hpp>
#endif
using std::cout;
int main(int argc, char *argv[])
{
if (argc < 3)
{
std::cerr << "usage: " << argv[0] << " <instance> <access token>\n";
return 1;
}
Easy masto(argv[1], argv[2]);
std::string answer;
std::uint16_t ret;
// Get own account in order to obtain account ID
ret = masto.get(API::v1::accounts_verify_credentials, answer);
if (ret == 0)
{
// Construct an Account object using the JSON string from the server
Easy::Account acc(answer);
// Get last status
ret = masto.get(API::v1::accounts_id_statuses,
{
{ "id", { std::to_string(acc.id()) } },
{ "limit", { "1" } }
},
answer);
if (ret == 0)
{
// answer contains an array with a single object. This works because
// Easy::Status will turn that into an object, but an array with
// more than 1 object will not work.
Easy::Status status(answer);
// An Entitiy is valid if the JSON was not empty and contained no
// "error":-key
if (status.valid())
{
if (!status.language().empty())
cout << "Language: " << status.language() << '\n';
if (!status.content().empty())
cout << "Content: "
<< status.content().substr(0, 200) << "…\n";
if (!status.application().name().empty())
cout << "Application used: "
<< status.application().name() << '\n';
cout << "ID: " << status.id() << '\n';
string acct;
string url;
std::vector<Easy::Attachment> attachments;
std::vector<Easy::Tag> tags;
// If the status is a reblog, print the original author
if (status.reblog().valid())
{
// status.reblog() is an Easy::Status
// status.reblog().account() is an Easy::Account
cout << "Original ID: " << status.reblog().id() << '\n';
acct = status.reblog().account().acct();
url = status.reblog().account().url();
attachments = status.reblog().media_attachments();
tags = status.reblog().tags();
}
else
{
acct = status.account().acct();
url = status.account().url();
attachments = status.media_attachments();
tags = status.tags();
}
cout << "From: " << acct << " ";
cout << "(" << url << ")\n";
// List attachments, if any
for (const Easy::Attachment &attachment : attachments)
{
cout << "Attachment: " << attachment.text_url()
<< " (" << attachment.size() << ")\n";
}
// List hashtags, if any
for (const Easy::Tag &tag : tags)
{
cout << "Hashtag: #" << tag.name()
<< " (" << tag.url() << ")\n";
}
}
return 0;
}
}
std::cout << answer << '\n';
std::cerr << "Error code: " << ret << '\n';
return ret;
}
#else
#include <cstdio>
int main()
{
printf("mastodon-cpp was compiled without Easy support.\n");
return 255;
}
#endif // WITHOUT_EASY
+
/* This file is part of mastodon-cpp.
* Prints some information about your last status.
*/
// Don't compile this if the Easy-interface is turned off
#ifndef WITHOUT_EASY
#include <iostream>
#include <string>
#include <cstdint>
// If we are compiling mastodon-cpp, use another include path
#ifdef MASTODON_CPP
#include "mastodon-cpp.hpp"
#include "easy/all.hpp"
#else
#include <mastodon-cpp/mastodon-cpp.hpp>
// Include all headers in mastodon-cpp/easy/
#include <mastodon-cpp/easy/all.hpp>
#endif
using std::cout;
int main(int argc, char *argv[])
{
if (argc < 3)
{
std::cerr << "usage: " << argv[0] << " <instance> <access token>\n";
return 1;
}
Easy masto(argv[1], argv[2]);
std::string answer;
std::uint16_t ret;
// Get own account in order to obtain account ID
ret = masto.get(API::v1::accounts_verify_credentials, answer);
if (ret == 0)
{
// Construct an Account object using the JSON string from the server
Easy::Account acc(answer);
// Get last status
ret = masto.get(API::v1::accounts_id_statuses,
{
{ "id", { acc.id() } },
{ "limit", { "1" } }
},
answer);
if (ret == 0)
{
// answer contains an array with a single object. This works because
// Easy::Status will turn that into an object, but an array with
// more than 1 object will not work.
Easy::Status status(answer);
// An Entitiy is valid if the JSON was not empty and contained no
// "error":-key
if (status.valid())
{
if (!status.language().empty())
cout << "Language: " << status.language() << '\n';
if (!status.content().empty())
cout << "Content: "
<< status.content().substr(0, 200) << "…\n";
if (!status.application().name().empty())
cout << "Application used: "
<< status.application().name() << '\n';
cout << "ID: " << status.id() << '\n';
string acct;
string url;
std::vector<Easy::Attachment> attachments;
std::vector<Easy::Tag> tags;
// If the status is a reblog, print the original author
if (status.reblog().valid())
{
// status.reblog() is an Easy::Status
// status.reblog().account() is an Easy::Account
cout << "Original ID: " << status.reblog().id() << '\n';
acct = status.reblog().account().acct();
url = status.reblog().account().url();
attachments = status.reblog().media_attachments();
tags = status.reblog().tags();
}
else
{
acct = status.account().acct();
url = status.account().url();
attachments = status.media_attachments();
tags = status.tags();
}
cout << "From: " << acct << " ";
cout << "(" << url << ")\n";
// List attachments, if any
for (const Easy::Attachment &attachment : attachments)
{
cout << "Attachment: " << attachment.text_url()
<< " (" << attachment.size() << ")\n";
}
// List hashtags, if any
for (const Easy::Tag &tag : tags)
{
cout << "Hashtag: #" << tag.name()
<< " (" << tag.url() << ")\n";
}
}
return 0;
}
}
std::cout << answer << '\n';
std::cerr << "Error code: " << ret << '\n';
return ret;
}
#else
#include <cstdio>
int main()
{
printf("mastodon-cpp was compiled without Easy support.\n");
return 255;
}
#endif // WITHOUT_EASY
diff --git a/docs/example14_easy_treeview_8cpp-example.html b/docs/example14_easy_treeview_8cpp-example.html index a784699..884a78b 100644 --- a/docs/example14_easy_treeview_8cpp-example.html +++ b/docs/example14_easy_treeview_8cpp-example.html @@ -19,7 +19,7 @@ @@ -43,7 +43,7 @@ $(function() {
example14_easy_treeview.cpp
-
/* This file is part of mastodon-cpp.
* Prints a Mastodon-conversation in a tree.
* Argument has to be in the form: https://<domain>/<user>/<status id>
*
* This example uses a rather wasteful approach in order to use less code and
* therefore be more clear. Please don't use it on long conversations.
*/
// Don't compile this if the Easy-interface is turned off
#ifndef WITHOUT_EASY
#include <iostream>
#include <string>
#include <thread>
#include <chrono>
#include <ctime>
#include <regex>
// If we are compiling mastodon-cpp, use another include path
#ifdef MASTODON_CPP
#include "mastodon-cpp.hpp"
#include "easy/all.hpp"
#else
#include <mastodon-cpp/mastodon-cpp.hpp>
// Include all headers in mastodon-cpp/easy/
#include <mastodon-cpp/easy/all.hpp>
#endif
using std::cout;
using std::chrono::system_clock;
// Print a status to stdout, nicely formatted
void format_status(const Easy::Status &status, const std::uint8_t &level)
{
std::string space(level, ' ');
// Remove HTML-tags
std::regex restrip("<[^>]*>");
std::string content = std::regex_replace(status.content(), restrip, "");
cout << space << "+-----------------------------------------\n";
cout << space << "| " << status.account().acct() << ": \n";
while (!content.empty())
{
cout << space << "| " << content.substr(0, 40) << '\n';
if (content.length() > 40)
{
content = content.substr(40);
}
else
{
content.clear();
}
}
cout << space << "| "
<< Easy::strtime_local(status.created_at(), "%T") << '\n';
cout << space << "+-----------------------------------------" << std::endl;
}
// Fetch status and its descendants, output them
std::uint16_t print_status(Easy &masto, const std::string &id,
const std::uint8_t level)
{
std::uint16_t ret;
std::string answer;
API::parametermap parameters =
{
{ "id", { id }}
};
ret = masto.get(Mastodon::API::v1::statuses_id, parameters, answer);
if (ret == 0)
{
format_status(Easy::Status(answer), level);
ret = masto.get(Mastodon::API::v1::statuses_id_context,
parameters, answer);
if (ret == 0)
{
Easy::Context context(answer);
for (const Easy::Status &s : context.descendants())
{
// Only print descendant if it is a direct reply
// NOTE: This is a wasteful approach, I use it only in the
// interest of more clarity. Don't do this at home. :-)
if (s.in_reply_to_id() == std::stoull(id))
{
print_status(masto, std::to_string(s.id()), level + 4);
}
}
}
}
return ret;
}
int main(int argc, char *argv[])
{
if (argc < 2)
{
std::cerr << "usage: " << argv[0] << " <url>\n";
return 1;
}
// Extract domain name
std::string instance = std::string(argv[1]);
std::size_t pos = instance.find('/') + 2;
instance = instance.substr(pos, instance.find('/', pos) - pos);
// Extract status ID
std::string id = std::string(argv[1]);
id = id.substr(id.rfind('/') + 1);
cout << " Instance: " << instance << "\nStatus ID: " << id << "\n\n";
Easy masto(instance, "");
return print_status(masto, id, 0);
}
#else
#include <cstdio>
int main()
{
printf("mastodon-cpp was compiled without Easy support.\n");
return 255;
}
#endif // WITHOUT_EASY
+
/* This file is part of mastodon-cpp.
* Prints a Mastodon-conversation in a tree.
* Argument has to be in the form: https://<domain>/<user>/<status id>
*
* This example uses a rather wasteful approach in order to use less code and
* therefore be more clear. Please don't use it on long conversations.
*/
// Don't compile this if the Easy-interface is turned off
#ifndef WITHOUT_EASY
#include <iostream>
#include <string>
#include <thread>
#include <chrono>
#include <ctime>
#include <regex>
// If we are compiling mastodon-cpp, use another include path
#ifdef MASTODON_CPP
#include "mastodon-cpp.hpp"
#include "easy/all.hpp"
#else
#include <mastodon-cpp/mastodon-cpp.hpp>
// Include all headers in mastodon-cpp/easy/
#include <mastodon-cpp/easy/all.hpp>
#endif
using std::cout;
using std::chrono::system_clock;
// Print a status to stdout, nicely formatted
void format_status(const Easy::Status &status, const std::uint8_t &level)
{
std::string space(level, ' ');
// Remove HTML-tags
std::regex restrip("<[^>]*>");
std::string content = std::regex_replace(status.content(), restrip, "");
cout << space << "+-----------------------------------------\n";
cout << space << "| " << status.account().acct() << ": \n";
while (!content.empty())
{
cout << space << "| " << content.substr(0, 40) << '\n';
if (content.length() > 40)
{
content = content.substr(40);
}
else
{
content.clear();
}
}
cout << space << "| "
<< Easy::strtime_local(status.created_at(), "%T") << '\n';
cout << space << "+-----------------------------------------" << std::endl;
}
// Fetch status and its descendants, output them
std::uint16_t print_status(Easy &masto, const std::string &id,
const std::uint8_t level)
{
std::uint16_t ret;
std::string answer;
API::parametermap parameters =
{
{ "id", { id }}
};
ret = masto.get(Mastodon::API::v1::statuses_id, parameters, answer);
if (ret == 0)
{
format_status(Easy::Status(answer), level);
ret = masto.get(Mastodon::API::v1::statuses_id_context,
parameters, answer);
if (ret == 0)
{
Easy::Context context(answer);
for (const Easy::Status &s : context.descendants())
{
// Only print descendant if it is a direct reply
// NOTE: This is a wasteful approach, I use it only in the
// interest of more clarity. Don't do this at home. :-)
if (s.in_reply_to_id() == id)
{
print_status(masto, s.id(), level + 4);
}
}
}
}
return ret;
}
int main(int argc, char *argv[])
{
if (argc < 2)
{
std::cerr << "usage: " << argv[0] << " <url>\n";
return 1;
}
// Extract domain name
std::string instance = std::string(argv[1]);
std::size_t pos = instance.find('/') + 2;
instance = instance.substr(pos, instance.find('/', pos) - pos);
// Extract status ID
std::string id = std::string(argv[1]);
id = id.substr(id.rfind('/') + 1);
cout << " Instance: " << instance << "\nStatus ID: " << id << "\n\n";
Easy masto(instance, "");
return print_status(masto, id, 0);
}
#else
#include <cstdio>
int main()
{
printf("mastodon-cpp was compiled without Easy support.\n");
return 255;
}
#endif // WITHOUT_EASY
diff --git a/docs/example16_account_fields_8cpp-example.html b/docs/example16_account_fields_8cpp-example.html index 2df7f93..9186b4f 100644 --- a/docs/example16_account_fields_8cpp-example.html +++ b/docs/example16_account_fields_8cpp-example.html @@ -19,7 +19,7 @@ diff --git a/docs/examples.html b/docs/examples.html index 423b5b7..d32bc88 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -19,7 +19,7 @@ diff --git a/docs/files.html b/docs/files.html index a174b70..6a1d3b8 100644 --- a/docs/files.html +++ b/docs/files.html @@ -19,7 +19,7 @@ diff --git a/docs/functions.html b/docs/functions.html index fd5588c..1e1f00d 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_b.html b/docs/functions_b.html index ebf588f..f37f5aa 100644 --- a/docs/functions_b.html +++ b/docs/functions_b.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_c.html b/docs/functions_c.html index 8faf686..8bc6c1d 100644 --- a/docs/functions_c.html +++ b/docs/functions_c.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_d.html b/docs/functions_d.html index 564dbd8..26fb8f1 100644 --- a/docs/functions_d.html +++ b/docs/functions_d.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_e.html b/docs/functions_e.html index dbaf367..03f2d89 100644 --- a/docs/functions_e.html +++ b/docs/functions_e.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_enum.html b/docs/functions_enum.html index 6b28cda..619dd56 100644 --- a/docs/functions_enum.html +++ b/docs/functions_enum.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_f.html b/docs/functions_f.html index 026c495..b306fca 100644 --- a/docs/functions_f.html +++ b/docs/functions_f.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_func.html b/docs/functions_func.html index 2e14cd3..633172a 100644 --- a/docs/functions_func.html +++ b/docs/functions_func.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_func_b.html b/docs/functions_func_b.html index a299bcd..9f1a2d5 100644 --- a/docs/functions_func_b.html +++ b/docs/functions_func_b.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_func_c.html b/docs/functions_func_c.html index f9c88ec..df67d3b 100644 --- a/docs/functions_func_c.html +++ b/docs/functions_func_c.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_func_d.html b/docs/functions_func_d.html index 57c8459..de92222 100644 --- a/docs/functions_func_d.html +++ b/docs/functions_func_d.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_func_e.html b/docs/functions_func_e.html index eb7c4af..d414504 100644 --- a/docs/functions_func_e.html +++ b/docs/functions_func_e.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_func_f.html b/docs/functions_func_f.html index b57d221..c3abf10 100644 --- a/docs/functions_func_f.html +++ b/docs/functions_func_f.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_func_g.html b/docs/functions_func_g.html index 71f52c5..41adf84 100644 --- a/docs/functions_func_g.html +++ b/docs/functions_func_g.html @@ -19,7 +19,7 @@ @@ -68,7 +68,7 @@ $(function() { : Mastodon::API::http
  • get_notifications() -: Mastodon::Easy +: Mastodon::Easy
  • get_proxy() : Mastodon::API diff --git a/docs/functions_func_h.html b/docs/functions_func_h.html index 27185ae..e192cc7 100644 --- a/docs/functions_func_h.html +++ b/docs/functions_func_h.html @@ -19,7 +19,7 @@
  • diff --git a/docs/functions_func_i.html b/docs/functions_func_i.html index 90e77f1..2f2b49c 100644 --- a/docs/functions_func_i.html +++ b/docs/functions_func_i.html @@ -19,7 +19,7 @@ @@ -43,24 +43,24 @@ $(function() {

    - i -

    diff --git a/docs/functions_func_l.html b/docs/functions_func_l.html index 2189482..c10679d 100644 --- a/docs/functions_func_l.html +++ b/docs/functions_func_l.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_func_m.html b/docs/functions_func_m.html index 02d53fd..e7c2458 100644 --- a/docs/functions_func_m.html +++ b/docs/functions_func_m.html @@ -19,7 +19,7 @@ @@ -43,7 +43,7 @@ $(function() {

    - m -

    @@ -47,7 +47,7 @@ $(function() { , Mastodon::Easy::Tag
  • next() -: Mastodon::Easy::Link +: Mastodon::Easy::Link
  • note() : Mastodon::Easy::Account diff --git a/docs/functions_func_p.html b/docs/functions_func_p.html index d5d1e77..bfb5485 100644 --- a/docs/functions_func_p.html +++ b/docs/functions_func_p.html @@ -19,7 +19,7 @@
  • @@ -55,7 +55,7 @@ $(function() { : Mastodon::API
  • prev() -: Mastodon::Easy::Link +: Mastodon::Easy::Link
  • preview_url() : Mastodon::Easy::Attachment diff --git a/docs/functions_func_r.html b/docs/functions_func_r.html index 8b2bcc4..2d675e0 100644 --- a/docs/functions_func_r.html +++ b/docs/functions_func_r.html @@ -19,7 +19,7 @@
  • diff --git a/docs/functions_func_s.html b/docs/functions_func_s.html index 53a9476..8ab6b7b 100644 --- a/docs/functions_func_s.html +++ b/docs/functions_func_s.html @@ -19,7 +19,7 @@ @@ -75,7 +75,7 @@ $(function() { : Mastodon::Easy::Relationship
  • since_id() -: Mastodon::Easy::Link +: Mastodon::Easy::Link
  • size() : Mastodon::Easy::Attachment diff --git a/docs/functions_func_t.html b/docs/functions_func_t.html index e3e74a3..da1bb03 100644 --- a/docs/functions_func_t.html +++ b/docs/functions_func_t.html @@ -19,7 +19,7 @@
  • diff --git a/docs/functions_func_u.html b/docs/functions_func_u.html index 4b287ae..4a0db46 100644 --- a/docs/functions_func_u.html +++ b/docs/functions_func_u.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_func_v.html b/docs/functions_func_v.html index 42e0791..e98eadc 100644 --- a/docs/functions_func_v.html +++ b/docs/functions_func_v.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_func_w.html b/docs/functions_func_w.html index 2abcc4f..5993c6a 100644 --- a/docs/functions_func_w.html +++ b/docs/functions_func_w.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_g.html b/docs/functions_g.html index da905b7..128d80b 100644 --- a/docs/functions_g.html +++ b/docs/functions_g.html @@ -19,7 +19,7 @@ @@ -68,7 +68,7 @@ $(function() { : Mastodon::API::http
  • get_notifications() -: Mastodon::Easy +: Mastodon::Easy
  • get_proxy() : Mastodon::API diff --git a/docs/functions_h.html b/docs/functions_h.html index 21f7ed8..0a79a80 100644 --- a/docs/functions_h.html +++ b/docs/functions_h.html @@ -19,7 +19,7 @@
  • diff --git a/docs/functions_i.html b/docs/functions_i.html index de98a0b..87b720b 100644 --- a/docs/functions_i.html +++ b/docs/functions_i.html @@ -19,7 +19,7 @@ @@ -43,24 +43,24 @@ $(function() {

    - i -

    diff --git a/docs/functions_l.html b/docs/functions_l.html index d9d2c86..7723b07 100644 --- a/docs/functions_l.html +++ b/docs/functions_l.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_m.html b/docs/functions_m.html index 4abfa7a..da0dae7 100644 --- a/docs/functions_m.html +++ b/docs/functions_m.html @@ -19,7 +19,7 @@ @@ -43,7 +43,7 @@ $(function() {

    - m -

    @@ -47,7 +47,7 @@ $(function() { , Mastodon::Easy::Tag
  • next() -: Mastodon::Easy::Link +: Mastodon::Easy::Link
  • note() : Mastodon::Easy::Account diff --git a/docs/functions_p.html b/docs/functions_p.html index e4175c5..27de3bd 100644 --- a/docs/functions_p.html +++ b/docs/functions_p.html @@ -19,7 +19,7 @@
  • @@ -58,7 +58,7 @@ $(function() { : Mastodon::API
  • prev() -: Mastodon::Easy::Link +: Mastodon::Easy::Link
  • preview_url() : Mastodon::Easy::Attachment diff --git a/docs/functions_r.html b/docs/functions_r.html index 4d307ef..84d641c 100644 --- a/docs/functions_r.html +++ b/docs/functions_r.html @@ -19,7 +19,7 @@
  • diff --git a/docs/functions_s.html b/docs/functions_s.html index 645e0d8..cbe81db 100644 --- a/docs/functions_s.html +++ b/docs/functions_s.html @@ -19,7 +19,7 @@ @@ -75,7 +75,7 @@ $(function() { : Mastodon::Easy::Relationship
  • since_id() -: Mastodon::Easy::Link +: Mastodon::Easy::Link
  • size() : Mastodon::Easy::Attachment diff --git a/docs/functions_t.html b/docs/functions_t.html index 815a4e4..970114e 100644 --- a/docs/functions_t.html +++ b/docs/functions_t.html @@ -19,7 +19,7 @@
  • diff --git a/docs/functions_type.html b/docs/functions_type.html index 08af9dc..6d4a823 100644 --- a/docs/functions_type.html +++ b/docs/functions_type.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_u.html b/docs/functions_u.html index 3e49263..fc793b6 100644 --- a/docs/functions_u.html +++ b/docs/functions_u.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_v.html b/docs/functions_v.html index 33d8ff4..b4905fb 100644 --- a/docs/functions_v.html +++ b/docs/functions_v.html @@ -19,7 +19,7 @@ diff --git a/docs/functions_w.html b/docs/functions_w.html index 2791df7..490df43 100644 --- a/docs/functions_w.html +++ b/docs/functions_w.html @@ -19,7 +19,7 @@ diff --git a/docs/hierarchy.html b/docs/hierarchy.html index 7d437f7..34d2973 100644 --- a/docs/hierarchy.html +++ b/docs/hierarchy.html @@ -19,7 +19,7 @@ diff --git a/docs/index.html b/docs/index.html index dc84233..9bf9f62 100644 --- a/docs/index.html +++ b/docs/index.html @@ -19,7 +19,7 @@ @@ -46,6 +46,7 @@ $(function() {

    mastodon-cpp is a C++ wrapper for the Mastodon API. The library takes care of the network stuff. You submit a query and get the raw JSON. You can then put that JSON into easy to use classes.

    TODO-list

    The ABI will be unstable in versions < 1.0.0

    +

    Beginning with 0.30.0, all IDs are const string instead of uint_fast64_t as required by the Mastodon API. Sorry for the inconvenience.

    Usage

    The HTML reference can be generated with build_doc.sh, if doxygen is installed. It is also available at doc.schlomp.space/mastodon-cpp/. There are examples in examples/.

    Most basic example

    diff --git a/docs/instance_8hpp_source.html b/docs/instance_8hpp_source.html index 1770571..7e6c04e 100644 --- a/docs/instance_8hpp_source.html +++ b/docs/instance_8hpp_source.html @@ -19,7 +19,7 @@
    diff --git a/docs/list_8hpp_source.html b/docs/list_8hpp_source.html index 7293998..94f6ced 100644 --- a/docs/list_8hpp_source.html +++ b/docs/list_8hpp_source.html @@ -19,7 +19,7 @@ @@ -47,9 +47,9 @@ $(function() {
    list.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_LIST_HPP
    18 #define MASTODON_CPP_EASY_LIST_HPP
    19 
    20 #include <string>
    21 #include <vector>
    22 #include <cstdint>
    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 
    36 namespace Mastodon
    37 {
    43  class Easy::List : public Easy::Entity
    44  {
    45  public:
    53  explicit List(const string &json);
    54 
    60  List();
    61 
    62  virtual bool valid() const;
    63 
    69  uint_fast64_t id() const;
    70 
    76  const string title() const;
    77  };
    78 }
    79 
    80 #endif // MASTODON_CPP_EASY_LIST_HPP
    const string title() const
    Returns title.
    Definition: list.cpp:48
    +
    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_LIST_HPP
    18 #define MASTODON_CPP_EASY_LIST_HPP
    19 
    20 #include <string>
    21 #include <vector>
    22 #include <cstdint>
    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 
    36 namespace Mastodon
    37 {
    43  class Easy::List : public Easy::Entity
    44  {
    45  public:
    53  explicit List(const string &json);
    54 
    60  List();
    61 
    62  virtual bool valid() const;
    63 
    69  const string id() const;
    70 
    76  const string title() const;
    77  };
    78 }
    79 
    80 #endif // MASTODON_CPP_EASY_LIST_HPP
    const string id() const
    Returns list-ID.
    Definition: list.cpp:43
    +
    const string title() const
    Returns title.
    Definition: list.cpp:48
    List()
    Constructs an empty List object.
    Definition: list.cpp:28
    -
    uint_fast64_t id() const
    Returns list-ID.
    Definition: list.cpp:43
    Definition: mastodon-cpp.hpp:52
    Base class for all entities.
    Definition: easy.hpp:319
    virtual bool valid() const
    Returns true if the Entity holds valid data.
    Definition: list.cpp:32
    diff --git a/docs/macros_8hpp_source.html b/docs/macros_8hpp_source.html index f6fc869..57d39cb 100644 --- a/docs/macros_8hpp_source.html +++ b/docs/macros_8hpp_source.html @@ -19,7 +19,7 @@
    diff --git a/docs/mastodon-cpp_8hpp_source.html b/docs/mastodon-cpp_8hpp_source.html index 4b0f34a..304229d 100644 --- a/docs/mastodon-cpp_8hpp_source.html +++ b/docs/mastodon-cpp_8hpp_source.html @@ -19,7 +19,7 @@ diff --git a/docs/mention_8hpp_source.html b/docs/mention_8hpp_source.html index 53d8f7b..04bd222 100644 --- a/docs/mention_8hpp_source.html +++ b/docs/mention_8hpp_source.html @@ -19,7 +19,7 @@ @@ -47,11 +47,11 @@ $(function() {
    mention.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_MENTION_HPP
    18 #define MASTODON_CPP_EASY_MENTION_HPP
    19 
    20 #include <string>
    21 #include <cstdint>
    22 
    23 // If we are compiling mastodon-cpp, use another include path
    24 #ifdef MASTODON_CPP
    25  #include "mastodon-cpp.hpp"
    26  #include "easy/easy.hpp"
    27 #else
    28  #include <mastodon-cpp/mastodon-cpp.hpp>
    29  #include <mastodon-cpp/easy/easy.hpp>
    30 #endif
    31 
    32 using std::string;
    33 using std::uint_fast64_t;
    34 using std::chrono::system_clock;
    35 
    36 namespace Mastodon
    37 {
    43  class Easy::Mention : public Easy::Entity
    44  {
    45  public:
    53  explicit Mention(const string &json);
    54 
    60  Mention();
    61 
    62  virtual bool valid() const;
    63 
    69  const string acct() const;
    70 
    76  uint_fast64_t id() const;
    77 
    83  const string url() const;
    84 
    90  const string username() const;
    91  };
    92 }
    93 
    94 #endif // MASTODON_CPP_EASY_MENTION_HPP
    const string acct() const
    Returns acct.
    Definition: mention.cpp:43
    +
    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_MENTION_HPP
    18 #define MASTODON_CPP_EASY_MENTION_HPP
    19 
    20 #include <string>
    21 #include <cstdint>
    22 
    23 // If we are compiling mastodon-cpp, use another include path
    24 #ifdef MASTODON_CPP
    25  #include "mastodon-cpp.hpp"
    26  #include "easy/easy.hpp"
    27 #else
    28  #include <mastodon-cpp/mastodon-cpp.hpp>
    29  #include <mastodon-cpp/easy/easy.hpp>
    30 #endif
    31 
    32 using std::string;
    33 using std::uint_fast64_t;
    34 using std::chrono::system_clock;
    35 
    36 namespace Mastodon
    37 {
    43  class Easy::Mention : public Easy::Entity
    44  {
    45  public:
    53  explicit Mention(const string &json);
    54 
    60  Mention();
    61 
    62  virtual bool valid() const;
    63 
    69  const string acct() const;
    70 
    76  const string id() const;
    77 
    83  const string url() const;
    84 
    90  const string username() const;
    91  };
    92 }
    93 
    94 #endif // MASTODON_CPP_EASY_MENTION_HPP
    const string acct() const
    Returns acct.
    Definition: mention.cpp:43
    Mention()
    Constructs an empty Mention object.
    Definition: mention.cpp:26
    -
    uint_fast64_t id() const
    Returns account ID.
    Definition: mention.cpp:48
    Class to hold mentions.
    Definition: mention.hpp:43
    virtual bool valid() const
    Returns true if the Entity holds valid data.
    Definition: mention.cpp:30
    +
    const string id() const
    Returns account ID.
    Definition: mention.cpp:48
    Definition: mastodon-cpp.hpp:52
    Base class for all entities.
    Definition: easy.hpp:319
    const string url() const
    Returns the URL of user&#39;s profile.
    Definition: mention.cpp:53
    diff --git a/docs/notification_8hpp_source.html b/docs/notification_8hpp_source.html index 88eb0d3..b66d9d5 100644 --- a/docs/notification_8hpp_source.html +++ b/docs/notification_8hpp_source.html @@ -19,7 +19,7 @@
    @@ -47,12 +47,12 @@ $(function() {
    notification.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_NOTIFICATION_HPP
    18 #define MASTODON_CPP_EASY_NOTIFICATION_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  #include "easy/entities/account.hpp"
    29  #include "easy/entities/status.hpp"
    30 #else
    31  #include <mastodon-cpp/mastodon-cpp.hpp>
    32  #include <mastodon-cpp/easy/easy.hpp>
    33  #include <mastodon-cpp/easy/entities/account.hpp>
    34  #include <mastodon-cpp/easy/entities/status.hpp>
    35 #endif
    36 
    37 using std::string;
    38 using std::uint_fast64_t;
    39 using std::chrono::system_clock;
    40 
    41 namespace Mastodon
    42 {
    49  {
    50  public:
    58  explicit Notification(const string &json);
    59 
    65  Notification();
    66 
    67  virtual bool valid() const;
    68 
    74  const Account account() const;
    75 
    81  const system_clock::time_point created_at() const;
    82 
    88  uint_fast64_t id() const;
    89 
    96  const Status status() const;
    97 
    104  };
    105 }
    106 
    107 #endif // MASTODON_CPP_EASY_NOTIFICATION_HPP
    const Status status() const
    Returns the Status associated with the notification, if applicable.
    Definition: notification.cpp:66
    -
    uint_fast64_t id() const
    Returns notification ID.
    Definition: notification.cpp:61
    +
    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_NOTIFICATION_HPP
    18 #define MASTODON_CPP_EASY_NOTIFICATION_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  #include "easy/entities/account.hpp"
    29  #include "easy/entities/status.hpp"
    30 #else
    31  #include <mastodon-cpp/mastodon-cpp.hpp>
    32  #include <mastodon-cpp/easy/easy.hpp>
    33  #include <mastodon-cpp/easy/entities/account.hpp>
    34  #include <mastodon-cpp/easy/entities/status.hpp>
    35 #endif
    36 
    37 using std::string;
    38 using std::uint_fast64_t;
    39 using std::chrono::system_clock;
    40 
    41 namespace Mastodon
    42 {
    49  {
    50  public:
    58  explicit Notification(const string &json);
    59 
    65  Notification();
    66 
    67  virtual bool valid() const;
    68 
    74  const Account account() const;
    75 
    81  const system_clock::time_point created_at() const;
    82 
    88  const string id() const;
    89 
    96  const Status status() const;
    97 
    104  };
    105 }
    106 
    107 #endif // MASTODON_CPP_EASY_NOTIFICATION_HPP
    const Status status() const
    Returns the Status associated with the notification, if applicable.
    Definition: notification.cpp:66
    Class to hold notifications.
    Definition: notification.hpp:48
    const system_clock::time_point created_at() const
    Returns time of creation.
    Definition: notification.cpp:56
    Easy::notification_type type() const
    Returns notification type.
    Definition: notification.cpp:78
    virtual bool valid() const
    Returns true if the Entity holds valid data.
    Definition: notification.cpp:31
    +
    const string id() const
    Returns notification ID.
    Definition: notification.cpp:61
    const Account account() const
    Returns the Account sending the notification to the user.
    Definition: notification.cpp:44
    notification_type
    Describes the notification type.
    Definition: easy.hpp:111
    Class to hold statuses.
    Definition: status.hpp:59
    diff --git a/docs/pushsubscription_8hpp_source.html b/docs/pushsubscription_8hpp_source.html index bb6e90a..a1d2364 100644 --- a/docs/pushsubscription_8hpp_source.html +++ b/docs/pushsubscription_8hpp_source.html @@ -19,7 +19,7 @@
    @@ -47,12 +47,12 @@ $(function() {
    pushsubscription.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_PUSHSUBSCRIPTION_HPP
    18 #define MASTODON_CPP_EASY_PUSHSUBSCRIPTION_HPP
    19 
    20 #include <string>
    21 #include <cstdint>
    22 #include <map>
    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 
    36 namespace Mastodon
    37 {
    44  {
    45  public:
    53  explicit PushSubscription(const string &json);
    54 
    61 
    62  virtual bool valid() const;
    63 
    69  uint_fast64_t id() const;
    70 
    76  const string endpoint() const;
    77 
    83  const string server_key() const;
    84 
    85  // TODO: Look up what the data looks like
    92  const Easy::alertmap alerts() const;
    93 
    94  protected:
    100  bool s_to_b(const string &str) const;
    101 };
    102 }
    103 
    104 #endif // MASTODON_CPP_EASY_PUSHSUBSCRIPTION_HPP
    const string server_key() const
    Returns the server public key for signature verification.
    Definition: pushsubscription.cpp:52
    -
    Class to hold push subscriptions.
    Definition: pushsubscription.hpp:43
    +
    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_PUSHSUBSCRIPTION_HPP
    18 #define MASTODON_CPP_EASY_PUSHSUBSCRIPTION_HPP
    19 
    20 #include <string>
    21 #include <cstdint>
    22 #include <map>
    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 
    35 namespace Mastodon
    36 {
    43  {
    44  public:
    52  explicit PushSubscription(const string &json);
    53 
    60 
    61  virtual bool valid() const;
    62 
    68  const string id() const;
    69 
    75  const string endpoint() const;
    76 
    82  const string server_key() const;
    83 
    84  // TODO: Look up what the data looks like
    91  const Easy::alertmap alerts() const;
    92 
    93  protected:
    99  bool s_to_b(const string &str) const;
    100 };
    101 }
    102 
    103 #endif // MASTODON_CPP_EASY_PUSHSUBSCRIPTION_HPP
    const string server_key() const
    Returns the server public key for signature verification.
    Definition: pushsubscription.cpp:52
    +
    const string id() const
    Returns push subscription ID.
    Definition: pushsubscription.cpp:26
    +
    Class to hold push subscriptions.
    Definition: pushsubscription.hpp:42
    PushSubscription()
    Constructs an empty PushSubscription object.
    Definition: pushsubscription.cpp:31
    std::map< Easy::notification_type, bool > alertmap
    Map of &#39;notification type&#39; and &#39;push is requested or not&#39;.
    Definition: easy.hpp:134
    bool s_to_b(const string &str) const
    Converts string to bool.
    Definition: pushsubscription.cpp:91
    -
    uint_fast64_t id() const
    Returns push subscription ID.
    Definition: pushsubscription.cpp:26
    Definition: mastodon-cpp.hpp:52
    Base class for all entities.
    Definition: easy.hpp:319
    virtual bool valid() const
    Returns true if the Entity holds valid data.
    Definition: pushsubscription.cpp:35
    diff --git a/docs/relationship_8hpp_source.html b/docs/relationship_8hpp_source.html index 35530a0..acd1bb7 100644 --- a/docs/relationship_8hpp_source.html +++ b/docs/relationship_8hpp_source.html @@ -19,7 +19,7 @@
    @@ -47,7 +47,8 @@ $(function() {
    relationship.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_RELATIONSHIP_HPP
    18 #define MASTODON_CPP_EASY_RELATIONSHIP_HPP
    19 
    20 #include <string>
    21 #include <cstdint>
    22 
    23 // If we are compiling mastodon-cpp, use another include path
    24 #ifdef MASTODON_CPP
    25  #include "mastodon-cpp.hpp"
    26  #include "easy/easy.hpp"
    27 #else
    28  #include <mastodon-cpp/mastodon-cpp.hpp>
    29  #include <mastodon-cpp/easy/easy.hpp>
    30 #endif
    31 
    32 using std::string;
    33 using std::uint_fast64_t;
    34 
    35 namespace Mastodon
    36 {
    43  {
    44  public:
    52  explicit Relationship(const string &json);
    53 
    59  Relationship();
    60 
    61  virtual bool valid() const;
    62 
    68  bool blocking() const;
    69 
    75  bool domain_blocking() const;
    76 
    82  bool endorsed() const;
    83 
    89  bool followed_by() const;
    90 
    96  bool following() const;
    97 
    103  uint_fast64_t id() const;
    104 
    110  bool muting() const;
    111 
    117  bool muting_notifications() const;
    118 
    124  bool requested() const;
    125 
    131  bool showing_notifications() const;
    132  };
    133 }
    134 
    135 #endif // MASTODON_CPP_EASY_RELATIONSHIP_HPP
    virtual bool valid() const
    Returns true if the Entity holds valid data.
    Definition: relationship.cpp:30
    +
    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_RELATIONSHIP_HPP
    18 #define MASTODON_CPP_EASY_RELATIONSHIP_HPP
    19 
    20 #include <string>
    21 #include <cstdint>
    22 
    23 // If we are compiling mastodon-cpp, use another include path
    24 #ifdef MASTODON_CPP
    25  #include "mastodon-cpp.hpp"
    26  #include "easy/easy.hpp"
    27 #else
    28  #include <mastodon-cpp/mastodon-cpp.hpp>
    29  #include <mastodon-cpp/easy/easy.hpp>
    30 #endif
    31 
    32 using std::string;
    33 using std::uint_fast64_t;
    34 
    35 namespace Mastodon
    36 {
    43  {
    44  public:
    52  explicit Relationship(const string &json);
    53 
    59  Relationship();
    60 
    61  virtual bool valid() const;
    62 
    68  bool blocking() const;
    69 
    75  bool domain_blocking() const;
    76 
    82  bool endorsed() const;
    83 
    89  bool followed_by() const;
    90 
    96  bool following() const;
    97 
    103  const string id() const;
    104 
    110  bool muting() const;
    111 
    117  bool muting_notifications() const;
    118 
    124  bool requested() const;
    125 
    131  bool showing_notifications() const;
    132  };
    133 }
    134 
    135 #endif // MASTODON_CPP_EASY_RELATIONSHIP_HPP
    const string id() const
    Returns the target account ID.
    Definition: relationship.cpp:72
    +
    virtual bool valid() const
    Returns true if the Entity holds valid data.
    Definition: relationship.cpp:30
    bool showing_notifications() const
    Returns true if the user is showing notifications.
    Definition: relationship.cpp:92
    bool blocking() const
    Returns true if the user is blocking the account.
    Definition: relationship.cpp:47
    bool endorsed() const
    Returns true if the account is endorsed by the user.
    Definition: relationship.cpp:57
    @@ -60,7 +61,6 @@ $(function() {
    bool domain_blocking() const
    Returns true if the user is blocking the account&#39;s domain.
    Definition: relationship.cpp:52
    bool following() const
    Returns true if the user is being following the account.
    Definition: relationship.cpp:67
    Class to hold relationships.
    Definition: relationship.hpp:42
    -
    uint_fast64_t id() const
    Returns the target account ID.
    Definition: relationship.cpp:72
    bool requested() const
    Returns true if the user has requested to follow the account.
    Definition: relationship.cpp:87
    diff --git a/docs/report_8hpp_source.html b/docs/report_8hpp_source.html index d300022..56ceaa4 100644 --- a/docs/report_8hpp_source.html +++ b/docs/report_8hpp_source.html @@ -19,7 +19,7 @@
    @@ -47,13 +47,13 @@ $(function() {
    report.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_REPORT_HPP
    18 #define MASTODON_CPP_EASY_REPORT_HPP
    19 
    20 #include <string>
    21 #include <cstdint>
    22 
    23 // If we are compiling mastodon-cpp, use another include path
    24 #ifdef MASTODON_CPP
    25  #include "mastodon-cpp.hpp"
    26  #include "easy/easy.hpp"
    27 #else
    28  #include <mastodon-cpp/mastodon-cpp.hpp>
    29  #include <mastodon-cpp/easy/easy.hpp>
    30 #endif
    31 
    32 using std::string;
    33 using std::uint_fast64_t;
    34 
    35 namespace Mastodon
    36 {
    42  class Easy::Report : public Easy::Entity
    43  {
    44  public:
    52  explicit Report(const string &json);
    53 
    59  Report();
    60 
    61  virtual bool valid() const;
    62 
    69  bool action_taken() const;
    70 
    76  uint_fast64_t id() const;
    77  };
    78 }
    79 
    80 #endif // MASTODON_CPP_EASY_REPORT_HPP
    Report()
    Constructs an empty Report object.
    Definition: report.cpp:26
    -
    uint_fast64_t id() const
    Returns the ID of the report.
    Definition: report.cpp:46
    -
    Class to hold reports.
    Definition: report.hpp:42
    +
    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_REPORT_HPP
    18 #define MASTODON_CPP_EASY_REPORT_HPP
    19 
    20 #include <string>
    21 #include <cstdint>
    22 
    23 // If we are compiling mastodon-cpp, use another include path
    24 #ifdef MASTODON_CPP
    25  #include "mastodon-cpp.hpp"
    26  #include "easy/easy.hpp"
    27 #else
    28  #include <mastodon-cpp/mastodon-cpp.hpp>
    29  #include <mastodon-cpp/easy/easy.hpp>
    30 #endif
    31 
    32 using std::string;
    33 
    34 namespace Mastodon
    35 {
    41  class Easy::Report : public Easy::Entity
    42  {
    43  public:
    51  explicit Report(const string &json);
    52 
    58  Report();
    59 
    60  virtual bool valid() const;
    61 
    68  bool action_taken() const;
    69 
    75  const string id() const;
    76  };
    77 }
    78 
    79 #endif // MASTODON_CPP_EASY_REPORT_HPP
    Report()
    Constructs an empty Report object.
    Definition: report.cpp:26
    +
    Class to hold reports.
    Definition: report.hpp:41
    Definition: mastodon-cpp.hpp:52
    Base class for all entities.
    Definition: easy.hpp:319
    bool action_taken() const
    Returns true if an action was taken in response to the report.
    Definition: report.cpp:41
    virtual bool valid() const
    Returns true if the Entity holds valid data.
    Definition: report.cpp:30
    +
    const string id() const
    Returns the ID of the report.
    Definition: report.cpp:46
    diff --git a/docs/status_8hpp_source.html b/docs/status_8hpp_source.html index 98e9a12..5e2d08d 100644 --- a/docs/status_8hpp_source.html +++ b/docs/status_8hpp_source.html @@ -19,7 +19,7 @@ @@ -47,7 +47,7 @@ $(function() {
    status.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_STATUS_HPP
    18 #define MASTODON_CPP_EASY_STATUS_HPP
    19 
    20 #include <string>
    21 #include <cstdint>
    22 #include <chrono>
    23 #include <vector>
    24 
    25 // If we are compiling mastodon-cpp, use another include path
    26 #ifdef MASTODON_CPP
    27  #include "mastodon-cpp.hpp"
    28  #include "easy/easy.hpp"
    29  #include "easy/entities/account.hpp"
    30  #include "easy/entities/emoji.hpp"
    31  #include "easy/entities/attachment.hpp"
    32  #include "easy/entities/mention.hpp"
    33  #include "easy/entities/tag.hpp"
    34  #include "easy/entities/application.hpp"
    35  #include "easy/entities/card.hpp"
    36 #else
    37  #include <mastodon-cpp/mastodon-cpp.hpp>
    38  #include <mastodon-cpp/easy/easy.hpp>
    39  #include <mastodon-cpp/easy/entities/account.hpp>
    40  #include <mastodon-cpp/easy/entities/emoji.hpp>
    41  #include <mastodon-cpp/easy/entities/attachment.hpp>
    42  #include <mastodon-cpp/easy/entities/mention.hpp>
    43  #include <mastodon-cpp/easy/entities/tag.hpp>
    44  #include <mastodon-cpp/easy/entities/application.hpp>
    45  #include <mastodon-cpp/easy/entities/card.hpp>
    46 #endif
    47 
    48 using std::string;
    49 using std::uint_fast64_t;
    50 using std::chrono::system_clock;
    51 
    52 namespace Mastodon
    53 {
    59  class Easy::Status : public Easy::Entity
    60  {
    61  public:
    69  explicit Status(const string &json);
    70 
    76  Status();
    77 
    78  virtual bool valid() const;
    79 
    85  const Account account() const;
    86 
    92  const Application application() const;
    93 
    99  const Card card() const;
    100 
    106  const system_clock::time_point created_at() const;
    107 
    113  const string content() const;
    114 
    120  Status content(const string &content);
    121 
    127  const std::vector<Emoji> emojis() const;
    128 
    134  bool favourited() const;
    135 
    141  uint_fast64_t favourites_count() const;
    142 
    148  uint_fast64_t id() const;
    149 
    155  uint_fast64_t in_reply_to_id() const;
    156 
    162  Status in_reply_to_id(const uint_fast64_t &in_reply_to_id);
    163 
    169  uint_fast64_t in_reply_to_account_id() const;
    170 
    176  const string language() const;
    177 
    183  Status language(const string &language);
    184 
    190  const std::vector<Attachment> media_attachments() const;
    191 
    198  (const std::vector<Attachment> &media_attachments);
    199 
    205  const std::vector<Mention> mentions() const;
    206 
    212  bool muted() const;
    213 
    219  bool pinned() const;
    220 
    226  const Status reblog() const;
    227 
    233  bool reblogged() const;
    234 
    240  uint_fast64_t reblogs_count() const;
    241 
    247  uint_fast64_t replies_count() const;
    248 
    254  bool sensitive() const;
    255 
    261  Status sensitive(const bool &sensitive);
    262 
    268  const string spoiler_text() const;
    269 
    275  Status spoiler_text(const string &spoiler_text);
    276 
    282  const std::vector<Tag> tags() const;
    283 
    289  const string uri() const;
    290 
    296  const string url() const;
    297 
    303  visibility_type visibility() const;
    304 
    311  };
    312 }
    313 
    314 #endif // MASTODON_CPP_EASY_STATUS_HPP
    bool sensitive() const
    Returns true if the attachments should be hidden by default.
    Definition: status.cpp:244
    +
    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_STATUS_HPP
    18 #define MASTODON_CPP_EASY_STATUS_HPP
    19 
    20 #include <string>
    21 #include <cstdint>
    22 #include <chrono>
    23 #include <vector>
    24 
    25 // If we are compiling mastodon-cpp, use another include path
    26 #ifdef MASTODON_CPP
    27  #include "mastodon-cpp.hpp"
    28  #include "easy/easy.hpp"
    29  #include "easy/entities/account.hpp"
    30  #include "easy/entities/emoji.hpp"
    31  #include "easy/entities/attachment.hpp"
    32  #include "easy/entities/mention.hpp"
    33  #include "easy/entities/tag.hpp"
    34  #include "easy/entities/application.hpp"
    35  #include "easy/entities/card.hpp"
    36 #else
    37  #include <mastodon-cpp/mastodon-cpp.hpp>
    38  #include <mastodon-cpp/easy/easy.hpp>
    39  #include <mastodon-cpp/easy/entities/account.hpp>
    40  #include <mastodon-cpp/easy/entities/emoji.hpp>
    41  #include <mastodon-cpp/easy/entities/attachment.hpp>
    42  #include <mastodon-cpp/easy/entities/mention.hpp>
    43  #include <mastodon-cpp/easy/entities/tag.hpp>
    44  #include <mastodon-cpp/easy/entities/application.hpp>
    45  #include <mastodon-cpp/easy/entities/card.hpp>
    46 #endif
    47 
    48 using std::string;
    49 using std::uint_fast64_t;
    50 using std::chrono::system_clock;
    51 
    52 namespace Mastodon
    53 {
    59  class Easy::Status : public Easy::Entity
    60  {
    61  public:
    69  explicit Status(const string &json);
    70 
    76  Status();
    77 
    78  virtual bool valid() const;
    79 
    85  const Account account() const;
    86 
    92  const Application application() const;
    93 
    99  const Card card() const;
    100 
    106  const system_clock::time_point created_at() const;
    107 
    113  const string content() const;
    114 
    120  Status content(const string &content);
    121 
    127  const std::vector<Emoji> emojis() const;
    128 
    134  bool favourited() const;
    135 
    141  uint_fast64_t favourites_count() const;
    142 
    148  const string id() const;
    149 
    155  const string in_reply_to_id() const;
    156 
    162  Status in_reply_to_id(const string &in_reply_to_id);
    163 
    169  const string in_reply_to_account_id() const;
    170 
    176  const string language() const;
    177 
    183  Status language(const string &language);
    184 
    190  const std::vector<Attachment> media_attachments() const;
    191 
    198  (const std::vector<Attachment> &media_attachments);
    199 
    205  const std::vector<Mention> mentions() const;
    206 
    212  bool muted() const;
    213 
    219  bool pinned() const;
    220 
    226  const Status reblog() const;
    227 
    233  bool reblogged() const;
    234 
    240  uint_fast64_t reblogs_count() const;
    241 
    247  uint_fast64_t replies_count() const;
    248 
    254  bool sensitive() const;
    255 
    261  Status sensitive(const bool &sensitive);
    262 
    268  const string spoiler_text() const;
    269 
    275  Status spoiler_text(const string &spoiler_text);
    276 
    282  const std::vector<Tag> tags() const;
    283 
    289  const string uri() const;
    290 
    296  const string url() const;
    297 
    303  visibility_type visibility() const;
    304 
    311  };
    312 }
    313 
    314 #endif // MASTODON_CPP_EASY_STATUS_HPP
    bool sensitive() const
    Returns true if the attachments should be hidden by default.
    Definition: status.cpp:244
    Class to hold cards.
    Definition: card.hpp:42
    uint_fast64_t favourites_count() const
    Returns the number of favourites.
    Definition: status.cpp:125
    const string url() const
    Returns the URL to the status page.
    Definition: status.cpp:287
    @@ -59,7 +59,6 @@ $(function() {
    const string language() const
    Returns the language of the status.
    Definition: status.cpp:151
    Status()
    Constructs an empty Status object.
    Definition: status.cpp:28
    uint_fast64_t reblogs_count() const
    Returns the number of reblogs for the status.
    Definition: status.cpp:234
    -
    uint_fast64_t id() const
    Returns the ID of the status.
    Definition: status.cpp:130
    Class to hold accounts.
    Definition: account.hpp:46
    Class to hold statuses.
    Definition: status.hpp:59
    bool pinned() const
    Returns true if the status is pinned.
    Definition: status.cpp:213
    @@ -74,13 +73,14 @@ $(function() {
    bool muted() const
    Returns true if the user muted the conversation.
    Definition: status.cpp:208
    const string uri() const
    Returns the Fediverse-unique resource ID.
    Definition: status.cpp:282
    bool reblogged() const
    Returns true if the user has reblogged the status.
    Definition: status.cpp:229
    +
    const string in_reply_to_account_id() const
    Returns the ID of the account it replies to.
    Definition: status.cpp:146
    const Application application() const
    Returns application from which the status was posted.
    Definition: status.cpp:66
    const string spoiler_text() const
    Returns the spoiler text.
    Definition: status.cpp:255
    const std::vector< Mention > mentions() const
    Returns the mentions.
    Definition: status.cpp:192
    Class to hold applications.
    Definition: application.hpp:40
    bool favourited() const
    Returns true if the user has favourited the status.
    Definition: status.cpp:120
    -
    uint_fast64_t in_reply_to_account_id() const
    Returns the ID of the account it replies to.
    Definition: status.cpp:146
    -
    uint_fast64_t in_reply_to_id() const
    Returns the ID of the status it replies to.
    Definition: status.cpp:135
    +
    const string in_reply_to_id() const
    Returns the ID of the status it replies to.
    Definition: status.cpp:135
    +
    const string id() const
    Returns the ID of the status.
    Definition: status.cpp:130
    const Status reblog() const
    Returns the reblogged Status.
    Definition: status.cpp:218
    diff --git a/docs/tag_8hpp_source.html b/docs/tag_8hpp_source.html index c8aa729..b6c6b78 100644 --- a/docs/tag_8hpp_source.html +++ b/docs/tag_8hpp_source.html @@ -19,7 +19,7 @@
    uint_fast64_t Status::in_reply_to_id const string Status::in_reply_to_id ( ) conststouint

    Returns the ID of the status it replies to.

    Since
    before 0.11.0
    -
    136 {
    137  return stouint64(get_string("in_reply_to_id"));
    138 }
    const string get_string(const string &key) const
    Returns the value of key as std::string.
    Definition: entity.cpp:134
    +
    136 {
    137  return get_string("in_reply_to_id");
    138 }
    const string get_string(const string &key) const
    Returns the value of key as std::string.
    Definition: entity.cpp:134
    - -

    ◆ in_reply_to_id() [2/2]

    + +

    ◆ in_reply_to_id() [2/2]

    @@ -553,7 +553,7 @@ std::uint_fast64_t 
    stouint
    Status Status::in_reply_to_id (const uint_fast64_t & const string &  in_reply_to_id)
    stouint

    Sets the ID of the status it replies to.

    Since
    0.17.0
    -
    141 {
    142  set("in_reply_to_id", Json::Value(std::to_string(in_reply_to_id)));
    143  return *this;
    144 }
    uint_fast64_t in_reply_to_id() const
    Returns the ID of the status it replies to.
    Definition: status.cpp:135
    +
    141 {
    142  set("in_reply_to_id", Json::Value(in_reply_to_id));
    143  return *this;
    144 }
    const string in_reply_to_id() const
    Returns the ID of the status it replies to.
    Definition: status.cpp:135
    diff --git a/docs/classMastodon_1_1Easy_1_1Tag-members.html b/docs/classMastodon_1_1Easy_1_1Tag-members.html index da0717f..df00cdf 100644 --- a/docs/classMastodon_1_1Easy_1_1Tag-members.html +++ b/docs/classMastodon_1_1Easy_1_1Tag-members.html @@ -19,7 +19,7 @@
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0
    mastodon-cpp -  0.21.0 +  0.30.0