mastodon-cpp  0.15.1
instance.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_INSTANCE_HPP
18 #define MASTODON_CPP_EASY_INSTANCE_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 #else
29  #include <mastodon-cpp/mastodon-cpp.hpp>
30  #include <mastodon-cpp/easy/easy.hpp>
31  #include <mastodon-cpp/easy/entities/account.hpp>
32 #endif
33 
34 using std::string;
35 
36 namespace Mastodon
37 {
42  {
43  public:
49  explicit Instance(const string &json);
50 
54  Instance();
55 
59  const Account contact_account() const;
60 
64  const string description() const;
65 
70  const string email() const;
71 
76  const std::vector<string> languages() const;
77 
81  const string title() const;
82 
86  const string uri() const;
87 
91  const string version() const;
92 
96  const string streaming_api() const;
97  };
98 }
99 
100 #endif // MASTODON_CPP_EASY_INSTANCE_HPP
Instance()
Constructs an empty Instance object.
Definition: instance.cpp:29
const string streaming_api() const
Returns the URL for the streaming API.
Definition: instance.cpp:75
Class to hold instances.
Definition: instance.hpp:41
const std::vector< string > languages() const
Returns a vector of ISO 6391 language codes the instance has chosen to advertise. ...
Definition: instance.cpp:55
const string uri() const
Returns the URI of the instance.
Definition: instance.cpp:65
const string email() const
Returns the email address which can be used to contact the instance administrator.
Definition: instance.cpp:50
const string title() const
Returns the title of the instance.
Definition: instance.cpp:60
const Account contact_account() const
Returns the Account of the admin or another contact person.
Definition: instance.cpp:33
Class to hold accounts.
Definition: account.hpp:42
Definition: mastodon-cpp.hpp:51
Base class for all entities.
Definition: easy.hpp:225
const string description() const
Returns the description of the instance.
Definition: instance.cpp:45
const string version() const
Returns the version used by the instance.
Definition: instance.cpp:70