mastodon-cpp  0.15.1
results.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_RESULTS_HPP
18 #define MASTODON_CPP_EASY_RESULTS_HPP
19 
20 #include <string>
21 #include <vector>
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  #include "easy/entities/account.hpp"
28  #include "easy/entities/status.hpp"
29 #else
30  #include <mastodon-cpp/mastodon-cpp.hpp>
31  #include <mastodon-cpp/easy/easy.hpp>
32  #include <mastodon-cpp/easy/entities/account.hpp>
33  #include <mastodon-cpp/easy/entities/status.hpp>
34 #endif
35 
36 using std::string;
37 
38 namespace Mastodon
39 {
43  class Easy::Results : public Easy::Entity
44  {
45  public:
51  explicit Results(const string &json);
52 
56  Results();
57 
61  const std::vector<Account> accounts() const;
62 
66  const std::vector<Status> statuses() const;
67 
71  const std::vector<string> hashtags() const;
72  };
73 }
74 
75 #endif // MASTODON_CPP_EASY_RESULTS_HPP
const std::vector< string > hashtags() const
Returns an array of matched hashtags.
Definition: results.cpp:66
const std::vector< Account > accounts() const
Returns an array of matched Accounts.
Definition: results.cpp:32
Results()
Constructs an empty Results object.
Definition: results.cpp:28
Definition: mastodon-cpp.hpp:51
Base class for all entities.
Definition: easy.hpp:225
const std::vector< Status > statuses() const
Returns an array of matched Statuses.
Definition: results.cpp:49
Class to hold results.
Definition: results.hpp:43