Browse Source

Removed const where it has no effect.

tastytea 1 week ago
parent
commit
ee82d35357
Signed by: tastytea <tastytea@tastytea.de> GPG Key ID: CFC39497F1B26E07
44 changed files with 379 additions and 379 deletions
  1. 9
    9
      src/api/delete.cpp
  2. 11
    11
      src/api/get.cpp
  3. 13
    13
      src/api/get_stream.cpp
  4. 3
    3
      src/api/patch.cpp
  5. 10
    10
      src/api/post.cpp
  6. 7
    7
      src/api/put.cpp
  7. 4
    4
      src/easy/easy.cpp
  8. 13
    14
      src/easy/easy.hpp
  9. 13
    13
      src/easy/entities/account.cpp
  10. 13
    13
      src/easy/entities/account.hpp
  11. 1
    1
      src/easy/entities/application.cpp
  12. 1
    1
      src/easy/entities/application.hpp
  13. 11
    11
      src/easy/entities/attachment.cpp
  14. 11
    11
      src/easy/entities/attachment.hpp
  15. 4
    4
      src/easy/entities/card.cpp
  16. 4
    4
      src/easy/entities/card.hpp
  17. 1
    1
      src/easy/entities/context.cpp
  18. 1
    1
      src/easy/entities/context.hpp
  19. 1
    1
      src/easy/entities/emoji.cpp
  20. 1
    1
      src/easy/entities/emoji.hpp
  21. 2
    2
      src/easy/entities/instance.cpp
  22. 2
    2
      src/easy/entities/instance.hpp
  23. 2
    2
      src/easy/entities/list.cpp
  24. 2
    2
      src/easy/entities/list.hpp
  25. 2
    2
      src/easy/entities/mention.cpp
  26. 2
    2
      src/easy/entities/mention.hpp
  27. 3
    3
      src/easy/entities/notification.cpp
  28. 3
    3
      src/easy/entities/notification.hpp
  29. 3
    3
      src/easy/entities/pushsubscription.cpp
  30. 3
    3
      src/easy/entities/pushsubscription.hpp
  31. 11
    11
      src/easy/entities/relationship.cpp
  32. 11
    11
      src/easy/entities/relationship.hpp
  33. 3
    3
      src/easy/entities/report.cpp
  34. 3
    3
      src/easy/entities/report.hpp
  35. 1
    1
      src/easy/entities/results.cpp
  36. 1
    1
      src/easy/entities/results.hpp
  37. 13
    13
      src/easy/entities/status.cpp
  38. 13
    13
      src/easy/entities/status.hpp
  39. 4
    4
      src/easy/entities/tag.cpp
  40. 4
    4
      src/easy/entities/tag.hpp
  41. 9
    10
      src/easy/entity.cpp
  42. 19
    17
      src/http.cpp
  43. 30
    30
      src/mastodon-cpp.cpp
  44. 101
    101
      src/mastodon-cpp.hpp

+ 9
- 9
src/api/delete.cpp View File

@@ -20,8 +20,8 @@
20 20
 
21 21
 using namespace Mastodon;
22 22
 
23
-const uint_fast16_t API::del(const Mastodon::API::v1 &call,
24
-                              const parametermap &parameters)
23
+uint_fast16_t API::del(const Mastodon::API::v1 &call,
24
+                       const parametermap &parameters)
25 25
 {
26 26
     string strcall = "";
27 27
     string strid = "";
@@ -60,8 +60,8 @@ const uint_fast16_t API::del(const Mastodon::API::v1 &call,
60 60
     return del(strcall, parameters, answer);
61 61
 }
62 62
 
63
-const uint_fast16_t API::del(const std::string &call,
64
-                              const parametermap &parameters, string &answer)
63
+uint_fast16_t API::del(const std::string &call,
64
+                       const parametermap &parameters, string &answer)
65 65
 {
66 66
 
67 67
     return _http.request(http::method::DELETE, call,
@@ -71,16 +71,16 @@ const uint_fast16_t API::del(const std::string &call,
71 71
 
72 72
 // ↓↓ DEPRECATED ↓↓
73 73
 
74
-const uint_fast16_t API::del(const Mastodon::API::v1 &call,
75
-                             const string &argument)
74
+uint_fast16_t API::del(const Mastodon::API::v1 &call,
75
+                       const string &argument)
76 76
 {
77 77
     const parametermap p = {};
78 78
     return del(call, argument, p);
79 79
 }
80 80
 
81
-const uint_fast16_t API::del(const Mastodon::API::v1 &call,
82
-                             const string &argument,
83
-                             const parametermap &parameters)
81
+uint_fast16_t API::del(const Mastodon::API::v1 &call,
82
+                       const string &argument,
83
+                       const parametermap &parameters)
84 84
 {
85 85
     parametermap newparameters = parameters;
86 86
 

+ 11
- 11
src/api/get.cpp View File

@@ -21,8 +21,8 @@
21 21
 using namespace Mastodon;
22 22
 using std::cerr;
23 23
 
24
-const uint_fast16_t API::get(const Mastodon::API::v1 &call,
25
-                             const parametermap &parameters, string &answer)
24
+uint_fast16_t API::get(const Mastodon::API::v1 &call,
25
+                       const parametermap &parameters, string &answer)
26 26
 {
27 27
     string strcall = "";
28 28
     string strid = "";
@@ -168,8 +168,8 @@ const uint_fast16_t API::get(const Mastodon::API::v1 &call,
168 168
     return get(strcall, answer);
169 169
 }
170 170
 
171
-const uint_fast16_t API::get(const Mastodon::API::v2 &call,
172
-                             const parametermap &parameters, string &answer)
171
+uint_fast16_t API::get(const Mastodon::API::v2 &call,
172
+                       const parametermap &parameters, string &answer)
173 173
 {
174 174
     string strcall = "";
175 175
     string strid = "";
@@ -204,13 +204,13 @@ const uint_fast16_t API::get(const Mastodon::API::v2 &call,
204 204
     return get(strcall, answer);
205 205
 }
206 206
 
207
-const uint_fast16_t API::get(const Mastodon::API::v1 &call, string &answer)
207
+uint_fast16_t API::get(const Mastodon::API::v1 &call, string &answer)
208 208
 {
209 209
     const parametermap p;
210 210
     return get(call, p, answer);
211 211
 }
212 212
 
213
-const uint_fast16_t API::get(const std::string &call, string &answer)
213
+uint_fast16_t API::get(const std::string &call, string &answer)
214 214
 {
215 215
     return _http.request(http::method::GET, call, answer);
216 216
 }
@@ -219,9 +219,9 @@ const uint_fast16_t API::get(const std::string &call, string &answer)
219 219
 
220 220
 // ↓↓ DEPRECATED ↓↓
221 221
 
222
-const uint_fast16_t API::get(const Mastodon::API::v1 &call,
223
-                             const string &argument,
224
-                             const parametermap &parameters, string &answer)
222
+uint_fast16_t API::get(const Mastodon::API::v1 &call,
223
+                       const string &argument,
224
+                       const parametermap &parameters, string &answer)
225 225
 {
226 226
     parametermap newparameters = parameters;
227 227
 
@@ -243,8 +243,8 @@ const uint_fast16_t API::get(const Mastodon::API::v1 &call,
243 243
     return get(call, newparameters, answer);
244 244
 }
245 245
 
246
-const uint_fast16_t API::get(const Mastodon::API::v1 &call,
247
-                             const string &argument, string &answer)
246
+uint_fast16_t API::get(const Mastodon::API::v1 &call,
247
+                       const string &argument, string &answer)
248 248
 {
249 249
     const parametermap p;
250 250
     return get(call, argument, p, answer);

+ 13
- 13
src/api/get_stream.cpp View File

@@ -21,10 +21,10 @@
21 21
 using namespace Mastodon;
22 22
 using std::cerr;
23 23
 
24
-const uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
25
-                                    const parametermap &parameters,
26
-                                    string &answer,
27
-                                    std::unique_ptr<Mastodon::API::http> &ptr)
24
+uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
25
+                              const parametermap &parameters,
26
+                              string &answer,
27
+                              std::unique_ptr<Mastodon::API::http> &ptr)
28 28
 {
29 29
     string strcall = "";
30 30
 
@@ -59,16 +59,16 @@ const uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
59 59
     return get_stream(strcall, answer, ptr);
60 60
 }
61 61
 
62
-const uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
63
-                                    string &answer,
64
-                                    std::unique_ptr<Mastodon::API::http> &ptr)
62
+uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
63
+                              string &answer,
64
+                              std::unique_ptr<Mastodon::API::http> &ptr)
65 65
 {
66 66
     parametermap p = {};
67 67
     return get_stream(call, p, answer, ptr);
68 68
 }
69 69
 
70
-const uint_fast16_t API::get_stream(const std::string &call, string &answer,
71
-                                    std::unique_ptr<http> &ptr)
70
+uint_fast16_t API::get_stream(const std::string &call, string &answer,
71
+                              std::unique_ptr<http> &ptr)
72 72
 {
73 73
     ptr = std::make_unique<http>(*this, _instance, _access_token);
74 74
     return ptr->request(http::method::GET_STREAM, call, answer);
@@ -77,10 +77,10 @@ const uint_fast16_t API::get_stream(const std::string &call, string &answer,
77 77
 
78 78
 // ↓↓ DEPRECATED ↓↓
79 79
 
80
-const uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
81
-                                    const string &argument,
82
-                                    string &answer,
83
-                                    std::unique_ptr<Mastodon::API::http> &ptr)
80
+uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
81
+                              const string &argument,
82
+                              string &answer,
83
+                              std::unique_ptr<Mastodon::API::http> &ptr)
84 84
 {
85 85
     parametermap parameters;
86 86
 

+ 3
- 3
src/api/patch.cpp View File

@@ -21,9 +21,9 @@
21 21
 using namespace Mastodon;
22 22
 using std::cerr;
23 23
 
24
-const uint_fast16_t API::patch(const Mastodon::API::v1 &call,
25
-                               const parametermap &parameters,
26
-                               string &answer)
24
+uint_fast16_t API::patch(const Mastodon::API::v1 &call,
25
+                         const parametermap &parameters,
26
+                         string &answer)
27 27
 {
28 28
     string strcall = "";
29 29
     switch (call)

+ 10
- 10
src/api/post.cpp View File

@@ -20,8 +20,8 @@
20 20
 
21 21
 using namespace Mastodon;
22 22
 
23
-const uint_fast16_t API::post(const Mastodon::API::v1 &call,
24
-                              const parametermap &parameters, string &answer)
23
+uint_fast16_t API::post(const Mastodon::API::v1 &call,
24
+                        const parametermap &parameters, string &answer)
25 25
 {
26 26
     string strcall = "";
27 27
     string strid = "";
@@ -137,14 +137,14 @@ const uint_fast16_t API::post(const Mastodon::API::v1 &call,
137 137
     return post(strcall, parameters, answer);
138 138
 }
139 139
 
140
-const uint_fast16_t API::post(const Mastodon::API::v1 &call, string &answer)
140
+uint_fast16_t API::post(const Mastodon::API::v1 &call, string &answer)
141 141
 {
142 142
     const parametermap p;
143 143
     return post(call, p, answer);
144 144
 }
145 145
 
146
-const uint_fast16_t API::post(const string &call,
147
-                              const parametermap &parameters, string &answer)
146
+uint_fast16_t API::post(const string &call,
147
+                        const parametermap &parameters, string &answer)
148 148
 {
149 149
 
150 150
     return _http.request(http::method::POST, call,
@@ -154,9 +154,9 @@ const uint_fast16_t API::post(const string &call,
154 154
 
155 155
 // ↓↓ DEPRECATED ↓↓
156 156
 
157
-const uint_fast16_t API::post(const Mastodon::API::v1 &call,
158
-                              const string &argument,
159
-                              const parametermap &parameters, string &answer)
157
+uint_fast16_t API::post(const Mastodon::API::v1 &call,
158
+                        const string &argument,
159
+                        const parametermap &parameters, string &answer)
160 160
 {
161 161
     parametermap newparameters = parameters;
162 162
 
@@ -166,8 +166,8 @@ const uint_fast16_t API::post(const Mastodon::API::v1 &call,
166 166
     return post(call, newparameters, answer);
167 167
 }
168 168
 
169
-const uint_fast16_t API::post(const Mastodon::API::v1 &call,
170
-                              const string &argument, string &answer)
169
+uint_fast16_t API::post(const Mastodon::API::v1 &call,
170
+                        const string &argument, string &answer)
171 171
 {
172 172
     const parametermap p;
173 173
     return post(call, argument, p, answer);

+ 7
- 7
src/api/put.cpp View File

@@ -20,8 +20,8 @@
20 20
 
21 21
 using namespace Mastodon;
22 22
 
23
-const uint_fast16_t API::put(const Mastodon::API::v1 &call,
24
-                             const parametermap &parameters, string &answer)
23
+uint_fast16_t API::put(const Mastodon::API::v1 &call,
24
+                       const parametermap &parameters, string &answer)
25 25
 {
26 26
     string strcall = "";
27 27
     string strid = "";
@@ -53,8 +53,8 @@ const uint_fast16_t API::put(const Mastodon::API::v1 &call,
53 53
     return put(strcall, parameters, answer);
54 54
 }
55 55
 
56
-const uint_fast16_t API::put(const string &call,
57
-                             const parametermap &parameters, string &answer)
56
+uint_fast16_t API::put(const string &call,
57
+                       const parametermap &parameters, string &answer)
58 58
 {
59 59
 
60 60
     return _http.request(http::method::PUT, call,
@@ -63,9 +63,9 @@ const uint_fast16_t API::put(const string &call,
63 63
 
64 64
 
65 65
 // ↓↓ DEPRECATED ↓↓
66
-const uint_fast16_t API::put(const Mastodon::API::v1 &call,
67
-                             const string &argument,
68
-                             const parametermap &parameters, string &answer)
66
+uint_fast16_t API::put(const Mastodon::API::v1 &call,
67
+                       const string &argument,
68
+                       const parametermap &parameters, string &answer)
69 69
 {
70 70
     parametermap newparameters = parameters;
71 71
 

+ 4
- 4
src/easy/easy.cpp View File

@@ -133,22 +133,22 @@ Easy::Link::Link(const string &link_header)
133 133
     }
134 134
 }
135 135
 
136
-const uint_fast64_t Easy::Link::next() const
136
+uint_fast64_t Easy::Link::next() const
137 137
 {
138 138
     return _next;
139 139
 }
140 140
 
141
-const uint_fast64_t Easy::Link::max_id() const
141
+uint_fast64_t Easy::Link::max_id() const
142 142
 {
143 143
     return _next;
144 144
 }
145 145
 
146
-const uint_fast64_t Easy::Link::prev() const
146
+uint_fast64_t Easy::Link::prev() const
147 147
 {
148 148
     return _prev;
149 149
 }
150 150
 
151
-const uint_fast64_t Easy::Link::since_id() const
151
+uint_fast64_t Easy::Link::since_id() const
152 152
 {
153 153
     return _prev;
154 154
 }

+ 13
- 14
src/easy/easy.hpp View File

@@ -171,28 +171,28 @@ public:
171 171
          *  
172 172
          *  @since  before 0.11.0
173 173
          */
174
-        const uint_fast64_t next() const;
174
+        uint_fast64_t next() const;
175 175
 
176 176
         /*!
177 177
          *  @brief  Returns max_id
178 178
          *  
179 179
          *  @since  before 0.11.0
180 180
          */
181
-        const uint_fast64_t max_id() const;
181
+        uint_fast64_t max_id() const;
182 182
 
183 183
         /*!
184 184
          *  @brief  Returns since_id
185 185
          *  
186 186
          *  @since  before 0.11.0
187 187
          */
188
-        const uint_fast64_t prev() const;
188
+        uint_fast64_t prev() const;
189 189
 
190 190
         /*!
191 191
          *  @brief  Returns since_id
192 192
          *  
193 193
          *  @since  before 0.11.0
194 194
          */
195
-        const uint_fast64_t since_id() const;
195
+        uint_fast64_t since_id() const;
196 196
 
197 197
     private:
198 198
         uint_fast64_t _next;
@@ -327,7 +327,7 @@ public:
327 327
          *  
328 328
          *  @since  before 0.11.0
329 329
          */
330
-        const void from_string(const string &json);
330
+        void from_string(const string &json);
331 331
 
332 332
         /*!
333 333
          *  @brief  Returns the JSON object of the Entity
@@ -343,7 +343,7 @@ public:
343 343
          *  
344 344
          *  @since  before 0.11.0 (virtual since 0.18.2)
345 345
          */
346
-        virtual const bool valid() const = 0;
346
+        virtual bool valid() const = 0;
347 347
 
348 348
         /*!
349 349
          *  @brief  Returns error string sent by the server
@@ -380,7 +380,7 @@ public:
380 380
          *  
381 381
          *  @since  before 0.11.0
382 382
          */
383
-        const bool was_set() const;
383
+        bool was_set() const;
384 384
 
385 385
     protected:
386 386
         /*!
@@ -403,14 +403,14 @@ public:
403 403
          *  
404 404
          *          Returns 0 if the value does not exist or is null.
405 405
          */
406
-        const uint_fast64_t get_uint64(const string &key) const;
406
+        uint_fast64_t get_uint64(const string &key) const;
407 407
 
408 408
         /*!
409 409
          *  @brief  Returns the value of key as double
410 410
          *  
411 411
          *          Returns 0.0 if the value does not exist or is null.
412 412
          */
413
-        const double get_double(const string &key) const;
413
+        double get_double(const string &key) const;
414 414
 
415 415
         // TODO: Maybe an enum would be better?
416 416
         /*!
@@ -418,7 +418,7 @@ public:
418 418
          *  
419 419
          *          Returns false if the value does not exist or is null.
420 420
          */
421
-        const bool get_bool(const string &key) const;
421
+        bool get_bool(const string &key) const;
422 422
 
423 423
         /*!
424 424
          *  @brief  Returns the value of key as time_point
@@ -440,9 +440,9 @@ public:
440 440
          *  
441 441
          *  @since  0.17.0
442 442
          */
443
-        const void set(const string &key, const Json::Value &value);
443
+        void set(const string &key, const Json::Value &value);
444 444
 
445
-        const std::uint_fast64_t stouint64(const string &str) const;
445
+        std::uint_fast64_t stouint64(const string &str) const;
446 446
 
447 447
         /*!
448 448
          *  @brief  Checks if an Entity is valid
@@ -453,8 +453,7 @@ public:
453 453
          *  
454 454
          *  @since  0.18.2
455 455
          */
456
-        const bool
457
-        check_valid(const std::vector<string> &attributes) const;
456
+        bool check_valid(const std::vector<string> &attributes) const;
458 457
 
459 458
     private:
460 459
         Json::Value _tree;

+ 13
- 13
src/easy/entities/account.cpp View File

@@ -29,7 +29,7 @@ Account::Account()
29 29
 : Entity()
30 30
 {}
31 31
 
32
-const bool Account::valid() const
32
+bool Account::valid() const
33 33
 {
34 34
     const std::vector<string> attributes =
35 35
     {{
@@ -74,7 +74,7 @@ const string Account::avatar_static() const
74 74
     return get_string("avatar_static");
75 75
 }
76 76
 
77
-const bool Account::bot() const
77
+bool Account::bot() const
78 78
 {
79 79
     return get_bool("bot");
80 80
 }
@@ -128,12 +128,12 @@ Account Account::fields(std::vector<Account::fields_pair> &fields)
128 128
     return *this;
129 129
 }
130 130
 
131
-const std::uint_fast64_t Account::followers_count() const
131
+std::uint_fast64_t Account::followers_count() const
132 132
 {
133 133
     return get_uint64("followers_count");
134 134
 }
135 135
 
136
-const std::uint_fast64_t Account::following_count() const
136
+std::uint_fast64_t Account::following_count() const
137 137
 {
138 138
     return get_uint64("following_count");
139 139
 }
@@ -154,12 +154,12 @@ const string Account::header_static() const
154 154
     return get_string("header_static");
155 155
 }
156 156
 
157
-const std::uint_fast64_t Account::id() const
157
+std::uint_fast64_t Account::id() const
158 158
 {
159 159
     return stouint64(get_string("id"));
160 160
 }
161 161
 
162
-const bool Account::locked() const
162
+bool Account::locked() const
163 163
 {
164 164
     return get_bool("locked");
165 165
 }
@@ -170,7 +170,7 @@ Account Account::locked(const bool &locked)
170 170
     return *this;
171 171
 }
172 172
 
173
-const bool Account::has_moved() const
173
+bool Account::has_moved() const
174 174
 {
175 175
     if (get("moved").isObject())
176 176
     {
@@ -207,7 +207,7 @@ const string Account::note_plain() const
207 207
     return get_string("source.note");
208 208
 }
209 209
 
210
-const Easy::visibility_type Account::privacy() const
210
+Easy::visibility_type Account::privacy() const
211 211
 {
212 212
     const string strprivacy = get_string("source.privacy");
213 213
     if (strprivacy.compare("public") == 0)
@@ -223,7 +223,7 @@ const Easy::visibility_type Account::privacy() const
223 223
     return visibility_type::Undefined;
224 224
 }
225 225
 
226
-const bool Account::sensitive() const
226
+bool Account::sensitive() const
227 227
 {
228 228
     return get_bool("source.sensitive");
229 229
 }
@@ -236,7 +236,7 @@ Account::Source::Source()
236 236
 : Entity()
237 237
 {}
238 238
 
239
-const bool Account::Source::valid() const
239
+bool Account::Source::valid() const
240 240
 {
241 241
     return true;
242 242
 }
@@ -286,7 +286,7 @@ Account::Source Account::Source::note(const string &note)
286 286
     return *this;
287 287
 }
288 288
 
289
-const Easy::visibility_type Account::Source::privacy() const
289
+Easy::visibility_type Account::Source::privacy() const
290 290
 {
291 291
     const string strprivacy = get_string("privacy");
292 292
     if (strprivacy.compare("public") == 0)
@@ -337,7 +337,7 @@ Account::Source Account::Source::privacy(const Easy::visibility_type &privacy)
337 337
     return *this;
338 338
 }
339 339
 
340
-const bool Account::Source::sensitive() const
340
+bool Account::Source::sensitive() const
341 341
 {
342 342
     return get_bool("sensitive");
343 343
 }
@@ -359,7 +359,7 @@ Account Account::source(const Account::Source &source)
359 359
     return *this;
360 360
 }
361 361
 
362
-const std::uint_fast64_t Account::statuses_count() const
362
+std::uint_fast64_t Account::statuses_count() const
363 363
 {
364 364
     return get_uint64("statuses_count");
365 365
 }

+ 13
- 13
src/easy/entities/account.hpp View File

@@ -69,7 +69,7 @@ namespace Mastodon
69 69
          */
70 70
         Account();
71 71
 
72
-        virtual const bool valid() const;
72
+        virtual bool valid() const;
73 73
 
74 74
         /*!
75 75
          *  @brief  Returns username
@@ -109,7 +109,7 @@ namespace Mastodon
109 109
          *  
110 110
          *  @since  0.16.0
111 111
          */
112
-        const bool bot() const;
112
+        bool bot() const;
113 113
 
114 114
         /*!
115 115
          *  @brief  Returns time of creation
@@ -151,14 +151,14 @@ namespace Mastodon
151 151
          *  
152 152
          *  @since before 0.11.0
153 153
          */
154
-        const uint_fast64_t followers_count() const;
154
+        uint_fast64_t followers_count() const;
155 155
 
156 156
         /*!
157 157
          *  @brief  Returns number of people this account follows
158 158
          *  
159 159
          *  @since before 0.11.0
160 160
          */
161
-        const uint_fast64_t following_count() const;
161
+        uint_fast64_t following_count() const;
162 162
 
163 163
         /*!
164 164
          *  @brief  Returns URL of header image
@@ -188,14 +188,14 @@ namespace Mastodon
188 188
          *  
189 189
          *  @since before 0.11.0
190 190
          */
191
-        const uint_fast64_t id() const;
191
+        uint_fast64_t id() const;
192 192
 
193 193
         /*!
194 194
          *  @brief  Returns true if the account is locked
195 195
          *  
196 196
          *  @since before 0.11.0
197 197
          */
198
-        const bool locked() const;
198
+        bool locked() const;
199 199
 
200 200
         /*!
201 201
          *  @brief  Sets locked state
@@ -209,7 +209,7 @@ namespace Mastodon
209 209
          *  
210 210
          *  @since before 0.11.0
211 211
          */
212
-        const bool has_moved() const;
212
+        bool has_moved() const;
213 213
 
214 214
         /*!
215 215
          *  @brief  If the owner decided to switch accounts, new account is in
@@ -246,14 +246,14 @@ namespace Mastodon
246 246
          *  
247 247
          *  @since before 0.11.0
248 248
          */
249
-        const visibility_type privacy() const;
249
+        visibility_type privacy() const;
250 250
 
251 251
         /*!
252 252
          *  @brief  Returns if media is marked as sensitive by default
253 253
          *  
254 254
          *  @since before 0.11.0
255 255
          */
256
-        const bool sensitive() const;
256
+        bool sensitive() const;
257 257
 
258 258
         /*!
259 259
          *  @brief  Class to hold source attribute
@@ -279,7 +279,7 @@ namespace Mastodon
279 279
              */
280 280
             Source();
281 281
 
282
-            virtual const bool valid() const;
282
+            virtual bool valid() const;
283 283
 
284 284
             /*!
285 285
              *  @brief  Returns metadata fields
@@ -314,7 +314,7 @@ namespace Mastodon
314 314
              *  
315 315
              *  @since 0.18.5
316 316
              */
317
-            const visibility_type privacy() const;
317
+            visibility_type privacy() const;
318 318
 
319 319
             /*!
320 320
              *  @brief  Sets default privacy of new toots
@@ -328,7 +328,7 @@ namespace Mastodon
328 328
              *  
329 329
              *  @since 0.18.5
330 330
              */
331
-            const bool sensitive() const;
331
+            bool sensitive() const;
332 332
 
333 333
             /*!
334 334
              *  @brief  Sets if media is marked as sensitive by default
@@ -346,7 +346,7 @@ namespace Mastodon
346 346
          *  
347 347
          *  @since before 0.11.0
348 348
          */
349
-        const uint_fast64_t statuses_count() const;
349
+        uint_fast64_t statuses_count() const;
350 350
 
351 351
         /*!
352 352
          *  @brief  Returns URL of the profile

+ 1
- 1
src/easy/entities/application.cpp View File

@@ -27,7 +27,7 @@ Application::Application()
27 27
 : Entity()
28 28
 {}
29 29
 
30
-const bool Application::valid() const
30
+bool Application::valid() const
31 31
 {
32 32
     return Entity::check_valid({"name"});
33 33
 }

+ 1
- 1
src/easy/entities/application.hpp View File

@@ -56,7 +56,7 @@ namespace Mastodon
56 56
          */
57 57
         Application();
58 58
 
59
-        virtual const bool valid() const;
59
+        virtual bool valid() const;
60 60
 
61 61
         /*!
62 62
          *  @brief  Returns the name of the application

+ 11
- 11
src/easy/entities/attachment.cpp View File

@@ -29,7 +29,7 @@ Attachment::Attachment()
29 29
 : Entity()
30 30
 {}
31 31
 
32
-const bool Attachment::valid() const
32
+bool Attachment::valid() const
33 33
 {
34 34
     const std::vector<string> attributes =
35 35
     {{
@@ -42,17 +42,17 @@ const bool Attachment::valid() const
42 42
     return Entity::check_valid(attributes);
43 43
 }
44 44
 
45
-const double Attachment::aspect() const
45
+double Attachment::aspect() const
46 46
 {
47 47
     return get_double("meta.original.aspect");
48 48
 }
49 49
 
50
-const double Attachment::aspect_small() const
50
+double Attachment::aspect_small() const
51 51
 {
52 52
     return get_double("meta.small.aspect");
53 53
 }
54 54
 
55
-const uint_fast64_t Attachment::bitrate() const
55
+uint_fast64_t Attachment::bitrate() const
56 56
 {
57 57
     return get_uint64("meta.original.bitrate");
58 58
 }
@@ -110,7 +110,7 @@ Attachment Attachment::focus(const std::array<double, 2> &focus)
110 110
     return *this;
111 111
 }
112 112
 
113
-const double Attachment::framerate() const
113
+double Attachment::framerate() const
114 114
 {
115 115
     string strframes = get_string("meta.original.frame_rate");
116 116
 
@@ -129,17 +129,17 @@ const double Attachment::framerate() const
129 129
     return 0.0;
130 130
 }
131 131
 
132
-const uint_fast64_t Attachment::height() const
132
+uint_fast64_t Attachment::height() const
133 133
 {
134 134
     return get_uint64("meta.original.height");
135 135
 }
136 136
 
137
-const uint_fast64_t Attachment::height_small() const
137
+uint_fast64_t Attachment::height_small() const
138 138
 {
139 139
     return get_uint64("meta.small.height");
140 140
 }
141 141
 
142
-const std::uint_fast64_t Attachment::id() const
142
+std::uint_fast64_t Attachment::id() const
143 143
 {
144 144
     return stouint64(get_string("id"));
145 145
 }
@@ -169,7 +169,7 @@ const string Attachment::text_url() const
169 169
     return get_string("text_url");
170 170
 }
171 171
 
172
-const Easy::attachment_type Attachment::type() const
172
+Easy::attachment_type Attachment::type() const
173 173
 {
174 174
     const string strtype = get_string("type");
175 175
     if (strtype.compare("image") == 0)
@@ -190,12 +190,12 @@ const string Attachment::url() const
190 190
     return get_string("url");
191 191
 }
192 192
 
193
-const uint_fast64_t Attachment::width() const
193
+uint_fast64_t Attachment::width() const
194 194
 {
195 195
     return get_uint64("meta.original.width");
196 196
 }
197 197
 
198
-const uint_fast64_t Attachment::width_small() const
198
+uint_fast64_t Attachment::width_small() const
199 199
 {
200 200
     return get_uint64("meta.small.width");
201 201
 }

+ 11
- 11
src/easy/entities/attachment.hpp View File

@@ -60,28 +60,28 @@ namespace Mastodon
60 60
          */
61 61
         Attachment();
62 62
 
63
-        virtual const bool valid() const;
63
+        virtual bool valid() const;
64 64
 
65 65
         /*!
66 66
          *  @brief  Aspect of original image
67 67
          *  
68 68
          *  @since before 0.11.0
69 69
          */
70
-        const double aspect() const;
70
+        double aspect() const;
71 71
 
72 72
         /*!
73 73
          *  @brief  Aspect of preview image
74 74
          *  
75 75
          *  @since before 0.11.0
76 76
          */
77
-        const double aspect_small() const;
77
+        double aspect_small() const;
78 78
 
79 79
         /*!
80 80
          *  @brief  Returns the bitrate of a video
81 81
          *  
82 82
          *  @since before 0.11.0
83 83
          */
84
-        const uint_fast64_t bitrate() const;
84
+        uint_fast64_t bitrate() const;
85 85
 
86 86
         /*!
87 87
          *  @brief  Returns the image description
@@ -143,28 +143,28 @@ namespace Mastodon
143 143
          *  
144 144
          *  @since before 0.11.0
145 145
          */
146
-        const double framerate() const;
146
+        double framerate() const;
147 147
 
148 148
         /*!
149 149
          *  @brief  Returns the height of the original image
150 150
          *  
151 151
          *  @since before 0.11.0
152 152
          */
153
-        const uint_fast64_t height() const;
153
+        uint_fast64_t height() const;
154 154
 
155 155
         /*!
156 156
          *  @brief  Returns the height of the preview image
157 157
          *  
158 158
          *  @since before 0.11.0
159 159
          */
160
-        const uint_fast64_t height_small() const;
160
+        uint_fast64_t height_small() const;
161 161
 
162 162
         /*!
163 163
          *  @brief  Returns the ID of the attachment
164 164
          *  
165 165
          *  @since before 0.11.0
166 166
          */
167
-        const uint_fast64_t id() const;
167
+        uint_fast64_t id() const;
168 168
 
169 169
         /*!
170 170
          *  @brief  Returns the URL of the preview image
@@ -206,7 +206,7 @@ namespace Mastodon
206 206
          *  
207 207
          *  @since before 0.11.0
208 208
          */
209
-        const attachment_type type() const;
209
+        attachment_type type() const;
210 210
 
211 211
         /*!
212 212
          *  @brief  Returns URL of the locally hosted version of the image
@@ -220,14 +220,14 @@ namespace Mastodon
220 220
          *  
221 221
          *  @since before 0.11.0
222 222
          */
223
-        const uint_fast64_t width() const;
223
+        uint_fast64_t width() const;
224 224
 
225 225
         /*!
226 226
          *  @brief  Returns the width of the preview image
227 227
          *  
228 228
          *  @since before 0.11.0
229 229
          */
230
-        const uint_fast64_t width_small() const;
230
+        uint_fast64_t width_small() const;
231 231
 
232 232
 
233 233
     };

+ 4
- 4
src/easy/entities/card.cpp View File

@@ -28,7 +28,7 @@ Card::Card()
28 28
 : Entity()
29 29
 {}
30 30
 
31
-const bool Card::valid() const
31
+bool Card::valid() const
32 32
 {
33 33
     const std::vector<string> attributes =
34 34
     {{
@@ -56,7 +56,7 @@ const string Card::description() const
56 56
     return get_string("description");
57 57
 }
58 58
 
59
-const uint_fast64_t Card::height() const
59
+uint_fast64_t Card::height() const
60 60
 {
61 61
     return get_uint64("height");
62 62
 }
@@ -86,7 +86,7 @@ const string Card::title() const
86 86
     return get_string("title");
87 87
 }
88 88
 
89
-const Easy::card_type Card::type() const
89
+Easy::card_type Card::type() const
90 90
 {
91 91
     const string strtype = get_string("type");
92 92
     if (strtype.compare("link") == 0)
@@ -107,7 +107,7 @@ const string Card::url() const
107 107
     return get_string("url");
108 108
 }
109 109
 
110
-const uint_fast64_t Card::width() const
110
+uint_fast64_t Card::width() const
111 111
 {
112 112
     return get_uint64("width");
113 113
 }

+ 4
- 4
src/easy/entities/card.hpp View File

@@ -58,7 +58,7 @@ namespace Mastodon
58 58
          */
59 59
         Card();
60 60
 
61
-        virtual const bool valid() const;
61
+        virtual bool valid() const;
62 62
 
63 63
         /*!
64 64
          *  @brief  Returns the name of the author
@@ -86,7 +86,7 @@ namespace Mastodon
86 86
          *  
87 87
          *  @since before 0.11.0
88 88
          */
89
-        const uint_fast64_t height() const;
89
+        uint_fast64_t height() const;
90 90
 
91 91
         /*!
92 92
          *  @brief  Returns the HTML
@@ -128,7 +128,7 @@ namespace Mastodon
128 128
          *  
129 129
          *  @since before 0.11.0
130 130
          */
131
-        const Easy::card_type type() const;
131
+        Easy::card_type type() const;
132 132
 
133 133
         /*!
134 134
          *  @brief  Returns the URL associated with the card
@@ -142,7 +142,7 @@ namespace Mastodon
142 142
          *  
143 143
          *  @since before 0.11.0
144 144
          */
145
-        const uint_fast64_t width() const;
145
+        uint_fast64_t width() const;
146 146
     };
147 147
 }
148 148
 

+ 1
- 1
src/easy/entities/context.cpp View File

@@ -28,7 +28,7 @@ Context::Context()
28 28
 : Entity()
29 29
 {}
30 30
 
31
-const bool Context::valid() const
31
+bool Context::valid() const
32 32
 {
33 33
     const std::vector<string> attributes =
34 34
     {{

+ 1
- 1
src/easy/entities/context.hpp View File

@@ -59,7 +59,7 @@ namespace Mastodon
59 59
          */
60 60
         Context();
61 61
 
62
-        virtual const bool valid() const;
62
+        virtual bool valid() const;
63 63
 
64 64
         /*!
65 65
          *  @brief  Returns the ancestors of the Status as vector of Statuses

+ 1
- 1
src/easy/entities/emoji.cpp View File

@@ -28,7 +28,7 @@ Emoji::Emoji()
28 28
 : Entity()
29 29
 {}
30 30
 
31
-const bool Emoji::valid() const
31
+bool Emoji::valid() const
32 32
 {
33 33
     const std::vector<string> attributes =
34 34
     {{

+ 1
- 1
src/easy/entities/emoji.hpp View File

@@ -56,7 +56,7 @@ namespace Mastodon
56 56
          */
57 57
         Emoji();
58 58
 
59
-        virtual const bool valid() const;
59
+        virtual bool valid() const;
60 60
 
61 61
         /*!
62 62
          *  @brief  Returns the shortcode of the emoji

+ 2
- 2
src/easy/entities/instance.cpp View File

@@ -30,7 +30,7 @@ Instance::Instance()
30 30
 : Entity()
31 31
 {}
32 32
 
33
-const bool Instance::valid() const
33
+bool Instance::valid() const
34 34
 {
35 35
     const std::vector<string> attributes =
36 36
     {{
@@ -94,7 +94,7 @@ const string Instance::streaming_api() const
94 94
     return get_string("urls.streaming_api");
95 95
 }
96 96
 
97
-const uint_fast64_t Instance::max_toot_chars() const
97
+uint_fast64_t Instance::max_toot_chars() const
98 98
 {
99 99
     const uint_fast64_t max_chars = get_uint64("max_toot_chars");
100 100
     if (was_set())

+ 2
- 2
src/easy/entities/instance.hpp View File

@@ -61,7 +61,7 @@ namespace Mastodon
61 61
          */
62 62
         Instance();
63 63
 
64
-        virtual const bool valid() const;
64
+        virtual bool valid() const;
65 65
 
66 66
         /*!
67 67
          *  @brief  Returns the Account of the admin or another contact person
@@ -129,7 +129,7 @@ namespace Mastodon
129 129
          *
130 130
          *  @since  0.20.0
131 131
          */
132
-        const uint_fast64_t max_toot_chars() const;
132
+        uint_fast64_t max_toot_chars() const;
133 133
     };
134 134
 }
135 135
 

+ 2
- 2
src/easy/entities/list.cpp View File

@@ -29,7 +29,7 @@ List::List()
29 29
 : Entity()
30 30
 {}
31 31
 
32
-const bool List::valid() const
32
+bool List::valid() const
33 33
 {
34 34
     const std::vector<string> attributes =
35 35
     {{
@@ -40,7 +40,7 @@ const bool List::valid() const
40 40
     return Entity::check_valid(attributes);
41 41
 }
42 42
 
43
-const uint_fast64_t List::id() const
43
+uint_fast64_t List::id() const
44 44
 {
45 45
     return stouint64(get_string("id"));
46 46
 }

+ 2
- 2
src/easy/entities/list.hpp View File

@@ -59,14 +59,14 @@ namespace Mastodon
59 59
          */
60 60
         List();
61 61
 
62
-        virtual const bool valid() const;
62
+        virtual bool valid() const;
63 63
 
64 64
         /*!
65 65
          *  @brief  Returns list-ID
66 66
          *  
67 67
          *  @since before 0.11.0
68 68
          */
69
-        const uint_fast64_t id() const;
69
+        uint_fast64_t id() const;
70 70
 
71 71
         /*!
72 72
          *  @brief  Returns title

+ 2
- 2
src/easy/entities/mention.cpp View File

@@ -27,7 +27,7 @@ Mention::Mention()
27 27
 : Entity()
28 28
 {}
29 29
 
30
-const bool Mention::valid() const
30
+bool Mention::valid() const
31 31
 {
32 32
     const std::vector<string> attributes =
33 33
     {{
@@ -45,7 +45,7 @@ const string Mention::acct() const
45 45
     return get_string("acct");
46 46
 }
47 47
 
48
-const uint_fast64_t Mention::id() const
48
+uint_fast64_t Mention::id() const
49 49
 {
50 50
     return stouint64(get_string("id"));
51 51
 }

+ 2
- 2
src/easy/entities/mention.hpp View File

@@ -59,7 +59,7 @@ namespace Mastodon
59 59
          */
60 60
         Mention();
61 61
 
62
-        virtual const bool valid() const;
62
+        virtual bool valid() const;
63 63
 
64 64
         /*!
65 65
          *  @brief  Returns acct
@@ -73,7 +73,7 @@ namespace Mastodon
73 73
          *  
74 74
          *  @since before 0.11.0
75 75
          */
76
-        const uint_fast64_t id() const;
76
+        uint_fast64_t id() const;
77 77
 
78 78
         /*!
79 79
          *  @brief  Returns the URL of user's profile

+ 3
- 3
src/easy/entities/notification.cpp View File

@@ -28,7 +28,7 @@ Notification::Notification()
28 28
 : Entity()
29 29
 {}
30 30
 
31
-const bool Notification::valid() const
31
+bool Notification::valid() const
32 32
 {
33 33
     const std::vector<string> attributes =
34 34
     {{
@@ -58,7 +58,7 @@ const system_clock::time_point Notification::created_at() const
58 58
     return get_time_point("created_at");
59 59
 }
60 60
 
61
-const uint_fast64_t Notification::id() const
61
+uint_fast64_t Notification::id() const
62 62
 {
63 63
     return stouint64(get_string("id"));
64 64
 }
@@ -75,7 +75,7 @@ const Easy::Status Notification::status() const
75 75
     return Easy::Status();
76 76
 }
77 77
 
78
-const Easy::notification_type Notification::type() const
78
+Easy::notification_type Notification::type() const
79 79
 {
80 80
     const string strtype = get_string("type");
81 81
     if (strtype.compare("mention") == 0)

+ 3
- 3
src/easy/entities/notification.hpp View File

@@ -64,7 +64,7 @@ namespace Mastodon
64 64
          */
65 65
         Notification();
66 66
 
67
-        virtual const bool valid() const;
67
+        virtual bool valid() const;
68 68
 
69 69
         /*!
70 70
          *  @brief  Returns the Account sending the notification to the user
@@ -85,7 +85,7 @@ namespace Mastodon
85 85
          *  
86 86
          *  @since before 0.11.0
87 87
          */
88
-        const uint_fast64_t id() const;
88
+        uint_fast64_t id() const;
89 89
 
90 90
         /*!
91 91
          *  @brief  Returns the Status associated with the notification, if
@@ -100,7 +100,7 @@ namespace Mastodon
100 100
          *  
101 101
          *  @since before 0.11.0
102 102
          */
103
-        const Easy::notification_type type() const;
103
+        Easy::notification_type type() const;
104 104
     };
105 105
 }
106 106
 

+ 3
- 3
src/easy/entities/pushsubscription.cpp View File

@@ -23,7 +23,7 @@ PushSubscription::PushSubscription(const string &json)
23 23
 : Entity(json)
24 24
 {}
25 25
 
26
-const uint_fast64_t PushSubscription::id() const
26
+uint_fast64_t PushSubscription::id() const
27 27
 {
28 28
     return stouint64(get_string("id"));
29 29
 }
@@ -32,7 +32,7 @@ PushSubscription::PushSubscription()
32 32
 : Entity()
33 33
 {}
34 34
 
35
-const bool PushSubscription::valid() const
35
+bool PushSubscription::valid() const
36 36
 {
37 37
     const std::vector<string> attributes =
38 38
     {{
@@ -88,7 +88,7 @@ const Easy::alertmap PushSubscription::alerts() const
88 88
     return alerts;
89 89
 }
90 90
 
91
-const bool PushSubscription::s_to_b(const string &str) const
91
+bool PushSubscription::s_to_b(const string &str) const
92 92
 {
93 93
     if (str.compare("true") == 0)
94 94
     {

+ 3
- 3
src/easy/entities/pushsubscription.hpp View File

@@ -59,14 +59,14 @@ namespace Mastodon
59 59
          */
60 60
         PushSubscription();
61 61
 
62
-        virtual const bool valid() const;
62
+        virtual bool valid() const;
63 63
 
64 64
         /*!
65 65
          *  @brief  Returns push subscription ID
66 66
          *  
67 67
          *  @since  0.14.0
68 68
          */
69
-        const uint_fast64_t id() const;
69
+        uint_fast64_t id() const;
70 70
 
71 71
         /*!
72 72
          *  @brief  Returns the endpoint URL
@@ -97,7 +97,7 @@ namespace Mastodon
97 97
          *
98 98
          *  @return `true` if str is equal to "true", `false` otherwise
99 99
          */
100
-        const bool s_to_b(const string &str) const;
100
+        bool s_to_b(const string &str) const;
101 101
 };
102 102
 }
103 103
 

+ 11
- 11
src/easy/entities/relationship.cpp View File

@@ -27,7 +27,7 @@ Relationship::Relationship()
27 27
 : Entity()
28 28
 {}
29 29
 
30
-const bool Relationship::valid() const
30
+bool Relationship::valid() const
31 31
 {
32 32
     const std::vector<string> attributes =
33 33
     {{
@@ -44,52 +44,52 @@ const bool Relationship::valid() const
44 44
     return Entity::check_valid(attributes);
45 45
 }
46 46
 
47
-const bool Relationship::blocking() const
47
+bool Relationship::blocking() const
48 48
 {
49 49
     return get_bool("blocking");
50 50
 }
51 51
 
52
-const bool Relationship::domain_blocking() const
52
+bool Relationship::domain_blocking() const
53 53
 {
54 54
     return get_bool("domain_blocking");
55 55
 }
56 56
 
57
-const bool Relationship::endorsed() const
57
+bool Relationship::endorsed() const
58 58
 {
59 59
     return get_bool("endorsed");
60 60
 }
61 61
 
62
-const bool Relationship::followed_by() const
62
+bool Relationship::followed_by() const
63 63
 {
64 64
     return get_bool("followed_by");
65 65
 }
66 66
 
67
-const bool Relationship::following() const
67
+bool Relationship::following() const
68 68
 {
69 69
     return get_bool("following");
70 70
 }
71 71
 
72
-const uint_fast64_t Relationship::id() const
72
+uint_fast64_t Relationship::id() const
73 73
 {
74 74
     return stouint64(get_string("id"));
75 75
 }
76 76
 
77
-const bool Relationship::muting() const
77
+bool Relationship::muting() const
78 78
 {
79 79
     return get_bool("muting");
80 80
 }
81 81
 
82
-const bool Relationship::muting_notifications() const
82
+bool Relationship::muting_notifications() const
83 83
 {
84 84
     return get_bool("muting_notifications");
85 85
 }
86 86
 
87
-const bool Relationship::requested() const
87
+bool Relationship::requested() const
88 88
 {
89 89
     return get_bool("requested");
90 90
 }
91 91
 
92
-const bool Relationship::showing_notifications() const
92
+bool Relationship::showing_notifications() const
93 93
 {
94 94
     return get_bool("showing_notifications");
95 95
 }

+ 11
- 11
src/easy/entities/relationship.hpp View File

@@ -58,77 +58,77 @@ namespace Mastodon
58 58
          */
59 59
         Relationship();
60 60
 
61
-        virtual const bool valid() const;
61
+        virtual bool valid() const;
62 62
 
63 63
         /*!
64 64
          *  @brief  Returns true if the user is blocking the account
65 65
          *  
66 66
          *  @since  before 0.11.0
67 67
          */
68
-        const bool blocking() const;
68
+        bool blocking() const;
69 69
 
70 70
         /*!
71 71
          *  @brief  Returns true if the user is blocking the account's domain
72 72
          *  
73 73
          *  @since  before 0.11.0
74 74
          */
75
-        const bool domain_blocking() const;
75
+        bool domain_blocking() const;
76 76
 
77 77
         /*!
78 78
          *  @brief  Returns true if the account is endorsed by the user
79 79
          *  
80 80
          *  @since  0.19.0
81 81
          */
82
-        const bool endorsed() const;
82
+        bool endorsed() const;
83 83
 
84 84
         /*!
85 85
          *  @brief  Returns true if the user is being followed by the account
86 86
          *  
87 87
          *  @since  before 0.11.0
88 88
          */
89
-        const bool followed_by() const;
89
+        bool followed_by() const;
90 90
 
91 91
         /*!
92 92
          *  @brief  Returns true if the user is being following the account
93 93
          *  
94 94
          *  @since  before 0.11.0
95 95
          */
96
-        const bool following() const;
96
+        bool following() const;
97 97
 
98 98
         /*!
99 99
          *  @brief  Returns the target account ID
100 100
          *  
101 101
          *  @since  before 0.11.0
102 102
          */
103
-        const uint_fast64_t id() const;
103
+        uint_fast64_t id() const;
104 104
 
105 105
         /*!
106 106
          *  @brief  Returns true if the user is muting the account
107 107
          *  
108 108
          *  @since  before 0.11.0
109 109
          */
110
-        const bool muting() const;
110
+        bool muting() const;
111 111
 
112 112
         /*!
113 113
          *  @brief  Returns true if the user is also muting notifications
114 114
          *  
115 115
          *  @since  before 0.11.0
116 116
          */
117
-        const bool muting_notifications() const;
117
+        bool muting_notifications() const;
118 118
 
119 119
         /*!
120 120
          *  @brief  Returns true if the user has requested to follow the account
121 121
          *  
122 122
          *  @since  before 0.11.0
123 123
          */
124
-        const bool requested() const;
124
+        bool requested() const;
125 125
 
126 126
         /*!
127 127
          *  @brief  Returns true if the user is showing notifications
128 128
          *  
129 129
          *  @since  0.19.0
130 130
          */
131
-        const bool showing_notifications() const;
131
+        bool showing_notifications() const;
132 132
     };
133 133
 }
134 134
 

+ 3
- 3
src/easy/entities/report.cpp View File

@@ -27,7 +27,7 @@ Report::Report()
27 27
 : Entity()
28 28
 {}
29 29
 
30
-const bool Report::valid() const
30
+bool Report::valid() const
31 31
 {
32 32
     const std::vector<string> attributes =
33 33
     {{
@@ -38,12 +38,12 @@ const bool Report::valid() const
38 38
     return Entity::check_valid(attributes);
39 39
 }
40 40
 
41
-const bool Report::action_taken() const
41
+bool Report::action_taken() const
42 42
 {
43 43
     return get_bool("action_taken");
44 44
 }
45 45
 
46
-const uint_fast64_t Report::id() const
46
+uint_fast64_t Report::id() const
47 47
 {
48 48
     return stouint64(get_string("id"));
49 49
 }

+ 3
- 3
src/easy/entities/report.hpp View File

@@ -58,7 +58,7 @@ namespace Mastodon
58 58
          */
59 59
         Report();
60 60
 
61
-        virtual const bool valid() const;
61
+        virtual bool valid() const;
62 62
 
63 63
         /*!
64 64
          *  @brief  Returns true if an action was taken in response to the
@@ -66,14 +66,14 @@ namespace Mastodon
66 66
          *  
67 67
          *  @since  before 0.11.0
68 68
          */
69
-        const bool action_taken() const;
69
+        bool action_taken() const;
70 70
         
71 71
         /*!
72 72
          *  @brief  Returns the ID of the report
73 73
          *  
74 74
          *  @since  before 0.11.0
75 75
          */
76
-        const uint_fast64_t id() const;
76
+        uint_fast64_t id() const;
77 77
     };
78 78
 }
79 79
 

+ 1
- 1
src/easy/entities/results.cpp View File

@@ -28,7 +28,7 @@ Results::Results()
28 28
 : Entity()
29 29
 {}
30 30
 
31
-const bool Results::valid() const
31
+bool Results::valid() const
32 32
 {
33 33
     const std::vector<string> attributes =
34 34
     {{

+ 1
- 1
src/easy/entities/results.hpp View File

@@ -63,7 +63,7 @@ namespace Mastodon
63 63
          */
64 64
         Results();
65 65
 
66
-        virtual const bool valid() const;
66
+        virtual bool valid() const;
67 67
 
68 68
         /*!
69 69
          *  @brief  Returns an array of matched Accounts

+ 13
- 13
src/easy/entities/status.cpp View File

@@ -29,7 +29,7 @@ Status::Status()
29 29
 : Entity()
30 30
 {}
31 31
 
32
-const bool Status::valid() const
32
+bool Status::valid() const
33 33
 {
34 34
     const std::vector<string> attributes =
35 35
     {{
@@ -117,22 +117,22 @@ const std::vector<Easy::Emoji> Status::emojis() const
117 117
     return {};
118 118
 }
119 119
 
120
-const bool Status::favourited() const
120
+bool Status::favourited() const
121 121
 {
122 122
     return get_bool("favourited");
123 123
 }
124 124
 
125
-const uint_fast64_t Status::favourites_count() const
125
+uint_fast64_t Status::favourites_count() const
126 126
 {
127 127
     return get_uint64("favourites_count");
128 128
 }
129 129
 
130
-const uint_fast64_t Status::id() const
130
+uint_fast64_t Status::id() const
131 131
 {
132 132
     return stouint64(get_string("id"));
133 133
 }
134 134
 
135
-const uint_fast64_t Status::in_reply_to_id() const
135
+uint_fast64_t Status::in_reply_to_id() const
136 136
 {
137 137
     return stouint64(get_string("in_reply_to_id"));
138 138
 }
@@ -143,7 +143,7 @@ Status Status::in_reply_to_id(const uint_fast64_t &in_reply_to_id)
143 143
     return *this;
144 144
 }
145 145
 
146
-const uint_fast64_t Status::in_reply_to_account_id() const
146
+uint_fast64_t Status::in_reply_to_account_id() const
147 147
 {
148 148
     return stouint64(get_string("in_reply_to_account_id"));
149 149
 }
@@ -205,12 +205,12 @@ const std::vector<Easy::Mention> Status::mentions() const
205 205
     return {};
206 206
 }
207 207
 
208
-const bool Status::muted() const
208
+bool Status::muted() const
209 209
 {
210 210
     return get_bool("muted");
211 211
 }
212 212
 
213
-const bool Status::pinned() const
213
+bool Status::pinned() const
214 214
 {
215 215
     return get_bool("pinned");
216 216
 }
@@ -226,22 +226,22 @@ const Status Status::reblog() const
226 226
     return Easy::Status();
227 227
 }
228 228
 
229
-const bool Status::reblogged() const
229
+bool Status::reblogged() const
230 230
 {
231 231
     return get_bool("reblogged");
232 232
 }
233 233
 
234
-const uint_fast64_t Status::reblogs_count() const
234
+uint_fast64_t Status::reblogs_count() const
235 235
 {
236 236
     return get_uint64("reblogs_count");
237 237
 }
238 238
 
239
-const uint_fast64_t Status::replies_count() const
239
+uint_fast64_t Status::replies_count() const
240 240
 {
241 241
     return get_uint64("replies_count");
242 242
 }
243 243
 
244
-const bool Status::sensitive() const
244
+bool Status::sensitive() const
245 245
 {
246 246
     return get_bool("sensitive");
247 247
 }
@@ -289,7 +289,7 @@ const string Status::url() const
289 289
     return get_string("url");
290 290
 }
291 291
 
292
-const Easy::visibility_type Status::visibility() const
292
+Easy::visibility_type Status::visibility() const
293 293
 {
294 294
     const string strvisibility = get_string("visibility");
295 295
     if (strvisibility.compare("public") == 0)

+ 13
- 13
src/easy/entities/status.hpp View File

@@ -75,7 +75,7 @@ namespace Mastodon
75 75
          */
76 76
         Status();
77 77
 
78
-        virtual const bool valid() const;
78
+        virtual bool valid() const;
79 79
 
80 80
         /*!
81 81
          *  @brief  Returns an array of matched accounts.
@@ -131,28 +131,28 @@ namespace Mastodon
131 131
          *  
132 132
          *  @since  before 0.11.0
133 133
          */
134
-        const bool favourited() const;
134
+        bool favourited() const;
135 135
 
136 136
         /*!
137 137
          *  @brief  Returns the number of favourites
138 138
          *  
139 139
          *  @since  before 0.11.0
140 140
          */
141
-        const uint_fast64_t favourites_count() const;
141
+        uint_fast64_t favourites_count() const;
142 142
 
143 143
         /*!
144 144
          *  @brief  Returns the ID of the status
145 145
          *  
146 146
          *  @since  before 0.11.0
147 147
          */
148
-        const uint_fast64_t id() const;
148
+        uint_fast64_t id() const;
149 149
 
150 150
         /*!
151 151
          *  @brief  Returns the ID of the status it replies to
152 152
          *  
153 153
          *  @since  before 0.11.0
154 154
          */
155
-        const uint_fast64_t in_reply_to_id() const;
155
+        uint_fast64_t in_reply_to_id() const;
156 156
 
157 157
         /*!
158 158
          *  @brief  Sets the ID of the status it replies to
@@ -166,7 +166,7 @@ namespace Mastodon
166 166
          *  
167 167
          *  @since  before 0.11.0
168 168
          */
169
-        const uint_fast64_t in_reply_to_account_id() const;
169
+        uint_fast64_t in_reply_to_account_id() const;
170 170
 
171 171
         /*!
172 172
          *  @brief  Returns the language of the status
@@ -209,14 +209,14 @@ namespace Mastodon
209 209
          *  
210 210
          *  @since  before 0.11.0
211 211
          */
212
-        const bool muted() const;
212
+        bool muted() const;
213 213
 
214 214
         /*!
215 215
          *  @brief  Returns true if the status is pinned
216 216
          *  
217 217
          *  @since  before 0.11.0
218 218
          */
219
-        const bool pinned() const;
219
+        bool pinned() const;
220 220
 
221 221
         /*!
222 222
          *  @brief  Returns the reblogged Status
@@ -230,28 +230,28 @@ namespace Mastodon
230 230
          *  
231 231
          *  @since  before 0.11.0
232 232
          */
233
-        const bool reblogged() const;
233
+        bool reblogged() const;
234 234
 
235 235
         /*!
236 236
          *  @brief  Returns the number of reblogs for the status
237 237
          *  
238 238
          *  @since  before 0.11.0
239 239
          */
240
-        const uint_fast64_t reblogs_count() const;
240
+        uint_fast64_t reblogs_count() const;
241 241
 
242 242
         /*!
243 243
          *  @brief  Returns the number of replies for the status
244 244
          *  
245 245
          *  @since  0.19.0
246 246
          */
247
-        const uint_fast64_t replies_count() const;
247
+        uint_fast64_t replies_count() const;
248 248
 
249 249
         /*!
250 250
          *  @brief  Returns true if the attachments should be hidden by default
251 251
          *  
252 252
          *  @since  before 0.11.0
253 253
          */
254
-        const bool sensitive() const;
254
+        bool sensitive() const;
255 255
 
256 256
         /*!
257 257
          *  @brief  Sets sensitive flag for attachments
@@ -300,7 +300,7 @@ namespace Mastodon
300 300
          *  
301 301
          *  @since  before 0.11.0
302 302
          */
303
-        const visibility_type visibility() const;
303
+        visibility_type visibility() const;
304 304
 
305 305
         /*!
306 306
          *  @brief  Sets the visibility of the status

+ 4
- 4
src/easy/entities/tag.cpp View File

@@ -30,7 +30,7 @@ Tag::Tag()
30 30
 : Entity()
31 31
 {}
32 32
 
33
-const bool Tag::valid() const
33
+bool Tag::valid() const
34 34
 {
35 35
     const std::vector<string> attributes =
36 36
     {{
@@ -77,7 +77,7 @@ Tag::History::History()
77 77
 : Entity()
78 78
 {}
79 79
 
80
-const bool Tag::History::valid() const
80
+bool Tag::History::valid() const
81 81
 {
82 82
     const std::vector<string> attributes =
83 83
     {{
@@ -89,7 +89,7 @@ const bool Tag::History::valid() const
89 89
     return Entity::check_valid(attributes);
90 90
 }
91 91
 
92
-const uint_fast64_t Tag::History::accounts()
92
+uint_fast64_t Tag::History::accounts()
93 93
 {
94 94
     return stouint64(get_string("accounts"));
95 95
 }
@@ -108,7 +108,7 @@ const system_clock::time_point Tag::History::day()
108 108
     return system_clock::time_point();
109 109
 }
110 110
 
111
-const uint_fast64_t Tag::History::uses()
111
+uint_fast64_t Tag::History::uses()
112 112
 {
113 113
     return stouint64(get_string("uses"));
114 114
 }

+ 4
- 4
src/easy/entities/tag.hpp View File

@@ -68,14 +68,14 @@ namespace Mastodon
68 68
              */
69 69
             History();
70 70
 
71
-            virtual const bool valid() const;
71
+            virtual bool valid() const;
72 72
 
73 73
             /*!
74 74
              *  @brief  Returns the number of accounts using that hashtag.
75 75
              *  
76 76
              *  @since  0.16.0
77 77
              */
78
-            const uint_fast64_t accounts();
78
+            uint_fast64_t accounts();
79 79
 
80 80
             /*!
81 81
              *  @brief  Returns the day.
@@ -89,7 +89,7 @@ namespace Mastodon
89 89
              *  
90 90
              *  @since  0.16.0
91 91
              */
92
-            const uint_fast64_t uses();
92
+            uint_fast64_t uses();
93 93
         };
94 94
 
95 95
         /*!
@@ -108,7 +108,7 @@ namespace Mastodon
108 108
          */
109 109
         Tag();
110 110
 
111
-        virtual const bool valid() const;
111
+        virtual bool valid() const;
112 112
 
113 113
         /*!
114 114
          *  @brief  Returns the name of the tag

+ 9
- 10
src/easy/entity.cpp View File

@@ -33,7 +33,7 @@ Easy::Entity::Entity(const string &json)
33 33
     from_string(json);
34 34
 }
35 35
 
36
-const void Easy::Entity::from_string(const string &json)
36
+void Easy::Entity::from_string(const string &json)
37 37
 {
38 38
     std::stringstream ss(json);
39 39
     ss >> _tree;
@@ -66,8 +66,7 @@ Easy::Entity::Entity()
66 66
 : _was_set(false)
67 67
 {}
68 68
 
69
-const bool
70
-Easy::Entity::check_valid(const std::vector<string> &attributes) const
69
+bool Easy::Entity::check_valid(const std::vector<string> &attributes) const
71 70
 {
72 71
     for (const string &attribute: attributes)
73 72
     {
@@ -86,7 +85,7 @@ const string Easy::Entity::error() const
86 85
     return get_string("error");
87 86
 }
88 87
 
89
-const bool Easy::Entity::was_set() const
88
+bool Easy::Entity::was_set() const
90 89
 {
91 90
     return _was_set;
92 91
 }
@@ -146,7 +145,7 @@ const string Easy::Entity::get_string(const string &key) const
146 145
     return "";
147 146
 }
148 147
 
149
-const uint_fast64_t Easy::Entity::get_uint64(const string &key) const
148
+uint_fast64_t Easy::Entity::get_uint64(const string &key) const
150 149
 {
151 150
     const Json::Value node = get(key);
152 151
 
@@ -160,7 +159,7 @@ const uint_fast64_t Easy::Entity::get_uint64(const string &key) const
160 159
     return 0;
161 160
 }
162 161
 
163
-const double Easy::Entity::get_double(const string &key) const
162
+double Easy::Entity::get_double(const string &key) const
164 163
 {
165 164
     const Json::Value node = get(key);
166 165
 
@@ -174,7 +173,7 @@ const double Easy::Entity::get_double(const string &key) const
174 173
     return 0.0;
175 174
 }
176 175
 
177
-const bool Easy::Entity::get_bool(const string &key) const
176
+bool Easy::Entity::get_bool(const string &key) const
178 177
 {
179 178
     const Json::Value node = get(key);
180 179
 
@@ -196,7 +195,7 @@ const system_clock::time_point
196 195
     if (node.isString())
197 196
     {
198 197
         std::stringstream sstime(node.asString());
199
-        struct std::tm tm = {0};
198
+        struct std::tm tm;
200 199
         sstime >> std::get_time(&tm, "%Y-%m-%dT%T");
201 200
         std::time_t time = timegm(&tm);
202 201
         _was_set = true;
@@ -227,7 +226,7 @@ const std::vector<string> Easy::Entity::get_vector(const string &key) const
227 226
     return {};
228 227
 }
229 228
 
230
-const void Easy::Entity::set(const string &key, const Json::Value &value)
229
+void Easy::Entity::set(const string &key, const Json::Value &value)
231 230
 {
232 231
     if (key.find('.') == std::string::npos)
233 232
     {
@@ -265,7 +264,7 @@ const void Easy::Entity::set(const string &key, const Json::Value &value)
265 264
     ttdebug << "Could not set data: " << key << '\n';
266 265
 }
267 266
 
268
-const std::uint_fast64_t Easy::Entity::stouint64(const string &str) const
267
+std::uint_fast64_t Easy::Entity::stouint64(const string &str) const
269 268
 {
270 269
     if (str == "")
271 270
     {

+ 19
- 17
src/http.cpp View File

@@ -44,17 +44,17 @@ API::http::~http()
44 44
     curlpp::terminate();
45 45
 }
46 46
 
47
-const uint_fast16_t API::http::request(const method &meth,
48
-                                       const string &path,
49
-                                       string &answer)
47
+uint_fast16_t API::http::request(const method &meth,
48
+                                 const string &path,
49
+                                 string &answer)
50 50
 {
51 51
     return request(meth, path, curlpp::Forms(), answer);
52 52
 }
53 53
 
54
-const uint_fast16_t API::http::request(const method &meth,
55
-                                       const string &path,
56
-                                       const curlpp::Forms &formdata,
57
-                                       string &answer)
54
+uint_fast16_t API::http::request(const method &meth,
55
+                                 const string &path,
56
+                                 const curlpp::Forms &formdata,
57
+                                 string &answer)
58 58
 {
59 59
     using namespace std::placeholders;  // _1, _2, _3
60 60
 
@@ -119,8 +119,10 @@ const uint_fast16_t API::http::request(const method &meth,
119 119
                 break;
120 120
             case http::method::PUT:
121 121
                 request.setOpt<curlopts::CustomRequest>("PUT");
122
+                break;
122 123
             case http::method::DELETE:
123 124
                 request.setOpt<curlopts::CustomRequest>("DELETE");
125
+                break;
124 126
             default:
125 127
                 break;
126 128
         }
@@ -194,25 +196,25 @@ const uint_fast16_t API::http::request(const method &meth,
194 196
     }
195 197
 }
196 198
 
197
-const void API::http::get_headers(string &headers) const
199
+void API::http::get_headers(string &headers) const
198 200
 {
199 201
     headers = _headers;
200 202
 }
201 203
 
202
-const size_t API::http::callback_write(char* data, size_t size, size_t nmemb,
203
-                                       string *str)
204
+size_t API::http::callback_write(char* data, size_t size, size_t nmemb,
205
+                                 string *str)
204 206
 {
205 207
     std::lock_guard<std::mutex> lock(_mutex);
206 208
     str->append(data, size * nmemb);
207 209
     // ttdebug << "Received " << size * nmemb << " Bytes\n";
208 210
     return size * nmemb;
209
-};
211
+}
210 212
 
211
-const size_t API::http::callback(char* data, size_t size, size_t nmemb,
212
-                                 string *str)
213
+size_t API::http::callback(char* data, size_t size, size_t nmemb,
214
+                           string *str)
213 215
 {
214 216
     return callback_write(data, size, nmemb, str);
215
-};
217
+}
216 218
 
217 219
 double API::http::callback_progress(double /* dltotal */, double /* dlnow */,
218 220
                                     double /* ultotal */, double /* ulnow */)
@@ -223,14 +225,14 @@ double API::http::callback_progress(double /* dltotal */, double /* dlnow */,
223 225
         return 1;
224 226
     }
225 227
     return 0;
226
-};
228
+}
227 229
 
228
-const void API::http::cancel_stream()
230
+void API::http::cancel_stream()
229 231
 {
230 232
     _cancel_stream = true;
231 233
 }
232 234
 
233
-const void API::http::abort_stream()
235
+void API::http::abort_stream()
234 236
 {
235 237
     cancel_stream();
236 238
 }

+ 30
- 30
src/mastodon-cpp.cpp View File

@@ -39,7 +39,7 @@ API::API(const string &instance, const string &access_token)
39 39
     //
40 40
 }
41 41
 
42
-const void API::set_useragent(const std::string &useragent)
42
+void API::set_useragent(const std::string &useragent)
43 43
 {
44 44
     _useragent = useragent;
45 45
 }
@@ -148,25 +148,25 @@ const std::string API::urldecode(const std::string &str)
148 148
     return curlpp::unescape(str);
149 149
 }
150 150
 
151
-const uint_fast16_t API::register_app1(const string &instance,
152
-                                       const string &client_name,
153
-                                       const string &redirect_uri,
154
-                                       const string &scopes,
155
-                                       const string &website,
156
-                                       string &client_id,
157
-                                       string &client_secret,
158
-                                       string &url)
151
+uint_fast16_t API::register_app1(const string &instance,
152
+                                 const string &client_name,
153
+                                 const string &redirect_uri,
154
+                                 const string &scopes,
155
+                                 const string &website,
156
+                                 string &client_id,
157
+                                 string &client_secret,
158
+                                 string &url)
159 159
 {
160 160
     return register_app1(client_name, redirect_uri, scopes, website,
161 161
                   client_id, client_secret, url);
162 162
 }
163
-const uint_fast16_t API::register_app1(const string &client_name,
164
-                                       const string &redirect_uri,
165
-                                       const string &scopes,
166
-                                       const string &website,
167
-                                       string &client_id,
168
-                                       string &client_secret,
169
-                                       string &url)
163
+uint_fast16_t API::register_app1(const string &client_name,
164
+                                 const string &redirect_uri,
165
+                                 const string &scopes,
166
+                                 const string &website,
167
+                                 string &client_id,
168
+                                 string &client_secret,
169
+                                 string &url)
170 170
 {
171 171
     API::parametermap parameters =
172 172
     {
@@ -214,21 +214,21 @@ const uint_fast16_t API::register_app1(const string &client_name,
214 214
     
215 215
 }
216 216
 
217
-const uint_fast16_t API::register_app2(const string &instance,
218
-                                       const string &client_id,
219
-                                       const string &client_secret,
220
-                                       const string &redirect_uri,
221
-                                       const string &code,
222
-                                       string &access_token)
217
+uint_fast16_t API::register_app2(const string &instance,
218
+                                 const string &client_id,
219
+                                 const string &client_secret,
220
+                                 const string &redirect_uri,
221
+                                 const string &code,
222
+                                 string &access_token)
223 223
 {
224 224
     return register_app2(client_id, client_secret, redirect_uri, code, access_token);
225 225
 }
226 226
 
227
-const uint_fast16_t API::register_app2(const string &client_id,
228
-                                       const string &client_secret,
229
-                                       const string &redirect_uri,
230
-                                       const string &code,
231
-                                       string &access_token)
227
+uint_fast16_t API::register_app2(const string &client_id,
228
+                                 const string &client_secret,
229
+                                 const string &redirect_uri,
230
+                                 const string &code,
231
+                                 string &access_token)
232 232
 {
233 233
     API::parametermap parameters =
234 234
     {
@@ -280,7 +280,7 @@ bool API::exceptions(const bool &value)
280 280
     return _exceptions;
281 281
 }
282 282
 
283
-const bool API::exceptions() const
283
+bool API::exceptions() const
284 284
 {
285 285
     return _exceptions;
286 286
 }
@@ -586,13 +586,13 @@ const string API::unescape_html(const string &html)
586 586
     return output;
587 587
 }
588 588
 
589
-const void API::set_proxy(const string &proxy, const string &userpw)
589
+void API::set_proxy(const string &proxy, const string &userpw)
590 590
 {
591 591
     _proxy = proxy;
592 592
     _proxy_userpw = userpw;
593 593
 }
594 594
 
595
-const void API::get_proxy(string &proxy, string &userpw) const
595
+void API::get_proxy(string &proxy, string &userpw) const
596 596
 {
597 597
     if (!_proxy.empty())
598 598
     {

+ 101
- 101
src/mastodon-cpp.hpp View File

@@ -101,7 +101,7 @@ public:
101 101
         explicit http(const API &api, const string &instance,
102 102
                       const string &access_token);
103 103
         ~http();
104
-        const uint_fast16_t request(const method &meth,
104
+        uint_fast16_t request(const method &meth,
105 105
                                     const string &path,
106 106
                                     string &answer);
107 107
 
@@ -118,7 +118,7 @@ public:
118 118
          *  
119 119
          *  @since  before 0.11.0
120 120
          */
121
-        const uint_fast16_t request(const method &meth,
121
+        uint_fast16_t request(const method &meth,
122 122
                                     const string &path,
123 123
                                     const curlpp::Forms &formdata,
124 124
                                     string &answer);
@@ -126,7 +126,7 @@ public:
126 126
         /*!
127 127
          *  @brief  Get all headers in a string
128 128
          */
129
-        const void get_headers(string &headers) const;
129
+        void get_headers(string &headers) const;
130 130
 
131 131
         /*!
132 132
          *  @brief  Cancels the stream. Use only with streams.
@@ -138,10 +138,10 @@ public:
138 138
          *          
139 139
          *  @since  0.12.2
140 140
          */ 
141
-        const void cancel_stream();
141
+        void cancel_stream();
142 142
 
143 143
         [[deprecated("Will vanish in 1.0.0. Use cancel_stream() instead.")]]
144
-        const void abort_stream();
144
+        void abort_stream();
145 145
 
146 146
         /*!
147 147
          *  @brief  Gets the mutex guarding the string that is written to.
@@ -163,10 +163,10 @@ public:
163 163
         bool _cancel_stream;
164 164
         std::mutex _mutex;
165 165
 
166
-        const size_t callback_write(char* data, size_t size, size_t nmemb,
166
+        size_t callback_write(char* data, size_t size, size_t nmemb,
167 167
                                     string *oss);
168 168
         [[deprecated("Will vanish in 1.0.0. Use callback_write() instead.")]]
169
-        const size_t callback(char* data, size_t size, size_t nmemb,
169
+        size_t callback(char* data, size_t size, size_t nmemb,
170 170
                               string *oss);
171 171
         double callback_progress(double /* dltotal */, double /* dlnow */,
172 172
                                  double /* ultotal */, double /* ulnow */);
@@ -304,7 +304,7 @@ public:
304 304
      *  
305 305
      *  @since  before 0.11.0
306 306
      */
307
-    const void set_useragent(const string &useragent);
307
+    void set_useragent(const string &useragent);
308 308
 
309 309
     /*!
310 310
      *  @brief  Gets the useragent.
@@ -375,23 +375,23 @@ public:
375 375
      *  
376 376
      *  @since  before 0.11.0
377 377
      */
378
-    const uint_fast16_t register_app1(const string &client_name,
379
-                                      const string &redirect_uri,
380
-                                      const string &scopes,
381
-                                      const string &website,
382
-                                      string &client_id,
383
-                                      string &client_secret,
384
-                                      string &url);
378
+    uint_fast16_t register_app1(const string &client_name,
379
+                                const string &redirect_uri,
380
+                                const string &scopes,
381
+                                const string &website,
382
+                                string &client_id,
383
+                                string &client_secret,
384
+                                string &url);
385 385
 
386 386
     [[deprecated("Will vanish in 1.0.0")]]
387
-    const uint_fast16_t register_app1(const string &instance,
388
-                                      const string &client_name,
389
-                                      const string &redirect_uri,
390
-                                      const string &scopes,
391
-                                      const string &website,
392
-                                      string &client_id,
393
-                                      string &client_secret,
394
-                                      string &url);
387
+    uint_fast16_t register_app1(const string &instance,
388
+                                const string &client_name,
389
+                                const string &redirect_uri,
390
+                                const string &scopes,
391
+                                const string &website,
392
+                                string &client_id,
393
+                                string &client_secret,
394
+                                string &url);
395 395
 
396 396
     /*!
397 397
      *  @brief  Register application, step 2/2
@@ -408,19 +408,19 @@ public:
408 408
      *  
409 409
      *  @since  before 0.11.0
410 410
      */
411
-    const uint_fast16_t register_app2(const string &client_id,
412
-                                      const string &client_secret,
413
-                                      const string &redirect_uri,
414
-                                      const string &code,
415
-                                      string &access_token);
411
+    uint_fast16_t register_app2(const string &client_id,
412
+                                const string &client_secret,
413
+                                const string &redirect_uri,
414
+                                const string &code,
415
+                                string &access_token);
416 416
 
417 417
     [[deprecated("Will vanish in 1.0.0")]]
418
-    const uint_fast16_t register_app2(const string &instance,
419
-                                      const string &client_id,
420
-                                      const string &client_secret,
421
-                                      const string &redirect_uri,
422
-                                      const string &code,
423
-                                      string &access_token);
418
+    uint_fast16_t register_app2(const string &instance,
419
+                                const string &client_id,
420
+                                const string &client_secret,
421
+                                const string &redirect_uri,
422
+                                const string &code,
423
+                                string &access_token);
424 424
 
425 425
     /*!
426 426
      *  @brief  Gets the header from the last answer.
@@ -450,7 +450,7 @@ public:
450 450
     /*!
451 451
      *  @brief  Returns true if exceptions are turned on, false otherwise
452 452
      */
453
-    const bool exceptions() const;
453
+    bool exceptions() const;
454 454
 
455 455
     /*!
456 456
      *  @brief  Replaces HTML entities with UTF-8 characters
@@ -472,7 +472,7 @@ public:
472 472
      *
473 473
      *  @since  0.15.0
474 474
      */
475
-    const void set_proxy(const string &proxy, const string &userpw = "");
475
+    void set_proxy(const string &proxy, const string &userpw = "");
476 476
 
477 477
     /*!
478 478
      *  @brief  For internal use
@@ -482,7 +482,7 @@ public:
482 482
      *
483 483
      *  @since  0.15.1
484 484
      */
485
-    const void get_proxy(string &proxy, string &userpw) const;
485
+    void get_proxy(string &proxy, string &userpw) const;
486 486
 
487 487
     /*!
488 488
      *  @brief  Make a GET request which doesn't require parameters.
@@ -495,7 +495,7 @@ public:
495 495
      *  
496 496
      *  @since  before 0.11.0
497 497
      */
498
-    const uint_fast16_t get(const Mastodon::API::v1 &call, string &answer);
498
+    uint_fast16_t get(const Mastodon::API::v1 &call, string &answer);
499 499
 
500 500
     /*!
501 501
      *  @brief  Make a GET request which requires parameters.
@@ -508,18 +508,18 @@ public:
508 508
      *  @return @ref error "Error code". If the URL has permanently changed, 13
509 509
      *  is returned and answer is set to the new URL.
510 510
      */
511
-    const uint_fast16_t get(const Mastodon::API::v1 &call,
512
-                            const parametermap &parameters,
513
-                            string &answer);
511
+    uint_fast16_t get(const Mastodon::API::v1 &call,
512
+                      const parametermap &parameters,
513
+                      string &answer);
514 514
 
515 515
     /*!
516 516
      *  @brief  Make a GET request which requires parameters.
517 517
      *
518 518
      *  @since  0.16.0
519 519
      */
520
-    const uint_fast16_t get(const Mastodon::API::v2 &call,
521
-                            const parametermap &parameters,
522
-                            string &answer);
520
+    uint_fast16_t get(const Mastodon::API::v2 &call,
521
+                      const parametermap &parameters,
522
+                      string &answer);
523 523
 
524 524
     /*!
525 525
      *  @brief  Make a custom GET request.
@@ -533,20 +533,20 @@ public:
533 533
      *  
534 534
      *  @since  before 0.11.0
535 535
      */
536
-    const uint_fast16_t get(const string &call, string &answer);
536
+    uint_fast16_t get(const string &call, string &answer);
537 537
 
538 538
     [[deprecated("Will vanish in 1.0.0, use get() without string argument "
539 539
                  "instead.")]]
540
-    const uint_fast16_t get(const Mastodon::API::v1 &call,
541
-                            const string &argument,
542
-                            string &answer);
540
+    uint_fast16_t get(const Mastodon::API::v1 &call,
541
+                      const string &argument,
542
+                      string &answer);
543 543
 
544 544
     [[deprecated("Will vanish in 1.0.0, use get() without string argument "
545 545
                  "instead.")]]
546
-    const uint_fast16_t get(const Mastodon::API::v1 &call,
547
-                            const string &argument,
548
-                            const parametermap &parameters,
549
-                            string &answer);
546
+    uint_fast16_t get(const Mastodon::API::v1 &call,
547
+                      const string &argument,
548
+                      const parametermap &parameters,
549
+                      string &answer);
550 550
 
551 551
     /*!
552 552
      *  @brief  Make a streaming GET request.
@@ -562,10 +562,10 @@ public:
562 562
      *  
563 563
      *  @since  before 0.11.0
564 564
      */
565
-    const uint_fast16_t get_stream(const Mastodon::API::v1 &call,
566
-                                   const parametermap &parameters,
567
-                                   string &answer,
568
-                                   std::unique_ptr<Mastodon::API::http> &ptr);
565
+    uint_fast16_t get_stream(const Mastodon::API::v1 &call,
566
+                             const parametermap &parameters,
567
+                             string &answer,
568
+                             std::unique_ptr<Mastodon::API::http> &ptr);
569 569
 
570 570
     /*!
571 571
      *  @brief  Make a streaming GET request.
@@ -580,9 +580,9 @@ public:
580 580
      *  
581 581
      *  @since  before 0.11.0
582 582
      */
583
-    const uint_fast16_t get_stream(const Mastodon::API::v1 &call,
584
-                                   string &answer,
585
-                                   std::unique_ptr<Mastodon::API::http> &ptr);
583
+    uint_fast16_t get_stream(const Mastodon::API::v1 &call,
584
+                             string &answer,
585
+                             std::unique_ptr<Mastodon::API::http> &ptr);
586 586
 
587 587
     /*!
588 588
      *  @brief  Make a streaming GET request.
@@ -598,16 +598,16 @@ public:
598 598
      *  
599 599
      *  @since  before 0.11.0
600 600
      */
601
-    const uint_fast16_t get_stream(const string &call,
602
-                                   string &answer,
603
-                                   std::unique_ptr<Mastodon::API::http> &ptr);
601
+    uint_fast16_t get_stream(const string &call,
602
+                             string &answer,
603
+                             std::unique_ptr<Mastodon::API::http> &ptr);
604 604
 
605 605
     [[deprecated("Will vanish in 1.0.0, use get_stream() without string "
606 606
                  "argument instead.")]]
607
-    const uint_fast16_t get_stream(const Mastodon::API::v1 &call,
608
-                                   const string &argument,
609
-                                   string &answer,
610
-                                   std::unique_ptr<Mastodon::API::http> &ptr);
607
+    uint_fast16_t get_stream(const Mastodon::API::v1 &call,
608
+                             const string &argument,
609
+                             string &answer,
610
+                             std::unique_ptr<Mastodon::API::http> &ptr);
611 611
 
612 612
     /*!
613 613
      *  @brief  Make a PATCH request.
@@ -624,9 +624,9 @@ public:
624 624
      *  
625 625
      *  @since  before 0.11.0
626 626
      */
627
-    const uint_fast16_t patch(const Mastodon::API::v1 &call,
628
-                              const parametermap &parameters,
629
-                              string &answer);
627
+    uint_fast16_t patch(const Mastodon::API::v1 &call,
628
+                        const parametermap &parameters,
629
+                        string &answer);
630 630
 
631 631
     /*!
632 632
      *  @brief  Make a POST request which doesn't require parameters.
@@ -640,7 +640,7 @@ public:
640 640
      *  
641 641
      *  @since  before 0.11.0
642 642
      */
643
-    const uint_fast16_t post(const Mastodon::API::v1 &call, string &answer);
643
+    uint_fast16_t post(const Mastodon::API::v1 &call, string &answer);
644 644
 
645 645
     /*!
646 646
      *  @brief  Make a POST request which requires parameters.
@@ -657,9 +657,9 @@ public:
657 657
      *  
658 658
      *  @since  before 0.11.0
659 659
      */
660
-    const uint_fast16_t post(const Mastodon::API::v1 &call,
661
-                             const parametermap &parameters,
662
-                             string &answer);
660
+     uint_fast16_t post(const Mastodon::API::v1 &call,
661
+                        const parametermap &parameters,
662
+                        string &answer);
663 663
 
664 664
     /*!
665 665
      *  @brief  Make a custom POST request.
@@ -676,22 +676,22 @@ public:
676 676
      *  
677 677
      *  @since  before 0.11.0
678 678
      */
679
-    const uint_fast16_t post(const string &call,
680
-                             const parametermap &parameters,
681
-                             string &answer);
679
+     uint_fast16_t post(const string &call,
680
+                        const parametermap &parameters,
681
+                        string &answer);
682 682
 
683 683
     [[deprecated("Will vanish in 1.0.0, use post() without string argument "
684 684
                  "instead.")]]
685
-    const uint_fast16_t post(const Mastodon::API::v1 &call,
686
-                             const string &argument,
687
-                             string &answer);
685
+     uint_fast16_t post(const Mastodon::API::v1 &call,
686
+                        const string &argument,
687
+                        string &answer);
688 688
 
689 689
     [[deprecated("Will vanish in 1.0.0, use post() without string argument "
690 690
                  "instead.")]]
691
-    const uint_fast16_t post(const Mastodon::API::v1 &call,
692
-                             const string &argument,
693
-                             const parametermap &parameters,
694
-                             string &answer);
691
+     uint_fast16_t post(const Mastodon::API::v1 &call,
692
+                        const string &argument,
693
+                        const parametermap &parameters,
694
+                        string &answer);
695 695
 
696 696
     /*!
697 697
      *  @brief  Make a PUT request which requires a parameters.
@@ -707,9 +707,9 @@ public:
707 707
      *  
708 708
      *  @since  before 0.11.0
709 709
      */
710
-    const uint_fast16_t put(const Mastodon::API::v1 &call,
711
-                            const parametermap &parameters,
712
-                            string &answer);
710
+    uint_fast16_t put(const Mastodon::API::v1 &call,
711
+                      const parametermap &parameters,
712
+                      string &answer);
713 713
 
714 714
     /*!
715 715
      *  @brief  Make a custom PUT request.
@@ -725,16 +725,16 @@ public:
725 725
      *  
726 726
      *  @since  before 0.11.0
727 727
      */
728
-    const uint_fast16_t put(const string &call,
728
+    uint_fast16_t put(const string &call,
729 729
                             const parametermap &parameters,
730 730
                             string &answer);
731 731
 
732 732
     [[deprecated("Will vanish in 1.0.0, use put() without string argument "
733 733
                  "instead.")]]
734
-    const uint_fast16_t put(const Mastodon::API::v1 &call,
735
-                            const string &argument,
736
-                            const parametermap &parameters,
737
-                            string &answer);
734
+    uint_fast16_t put(const Mastodon::API::v1 &call,
735
+                      const string &argument,
736
+                      const parametermap &parameters,
737
+                      string &answer);
738 738
 
739 739
     /*!
740 740
      *  @brief  Make a DELETE request which requires parameters.
@@ -746,8 +746,8 @@ public:
746 746
      *  
747 747
      *  @since  before 0.11.0
748 748
      */
749
-    const uint_fast16_t del(const Mastodon::API::v1 &call,
750
-                            const parametermap &parameters);
749
+    uint_fast16_t del(const Mastodon::API::v1 &call,
750
+                      const parametermap &parameters);
751 751
 
752 752
     /*!
753 753
      *  @brief  Make a custom DELETE request.
@@ -762,20 +762,20 @@ public:
762 762
      *  
763 763
      *  @since  before 0.11.0
764 764
      */
765
-    const uint_fast16_t del(const string &call,
766
-                            const parametermap &parameters,
767
-                            string &answer);
765
+    uint_fast16_t del(const string &call,
766
+                      const parametermap &parameters,
767
+                      string &answer);
768 768
 
769 769
     [[deprecated("Will vanish in 1.0.0, use del() without string argument "
770 770
                  "instead.")]]
771
-    const uint_fast16_t del(const Mastodon::API::v1 &call,
772
-                            const string &argument);
771
+    uint_fast16_t del(const Mastodon::API::v1 &call,
772
+                      const string &argument);
773 773
 
774 774
     [[deprecated("Will vanish in 1.0.0, use del() without string argument "
775 775
                  "instead.")]]
776
-    const uint_fast16_t del(const Mastodon::API::v1 &call,
777
-                            const string &argument,
778
-                            const parametermap &parameters);
776
+    uint_fast16_t del(const Mastodon::API::v1 &call,
777
+                      const string &argument,
778
+                      const parametermap &parameters);
779 779
 
780 780
 private:
781 781
     const string _instance;

Loading…
Cancel
Save