mastodon-cpp  0.20.0
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 using std::uint_fast64_t;
24 
25 // If we are compiling mastodon-cpp, use another include path
26 #ifdef MASTODON_CPP
27  #include "mastodon-cpp.hpp"
28  #include "easy/easy.hpp"
29  #include "easy/entities/account.hpp"
30 #else
31  #include <mastodon-cpp/mastodon-cpp.hpp>
32  #include <mastodon-cpp/easy/easy.hpp>
33  #include <mastodon-cpp/easy/entities/account.hpp>
34 #endif
35 
36 using std::string;
37 
38 namespace Mastodon
39 {
46  {
47  public:
55  explicit Instance(const string &json);
56 
62  Instance();
63 
64  virtual bool valid() const;
65 
71  const Account contact_account() const;
72 
78  const string description() const;
79 
86  const string email() const;
87 
94  const std::vector<string> languages() const;
95 
101  const string title() const;
102 
108  const string uri() const;
109 
115  const string version() const;
116 
122  const string streaming_api() const;
123 
132  uint_fast64_t max_toot_chars() const;
133  };
134 }
135 
136 #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:92
Class to hold instances.
Definition: instance.hpp:45
virtual bool valid() const
Returns true if the Entity holds valid data.
Definition: instance.cpp:33
const std::vector< string > languages() const
Returns a vector of ISO 6391 language codes the instance has chosen to advertise. ...
Definition: instance.cpp:72
const string uri() const
Returns the URI of the instance.
Definition: instance.cpp:82
const string email() const
Returns the email address which can be used to contact the instance administrator.
Definition: instance.cpp:67
const string title() const
Returns the title of the instance.
Definition: instance.cpp:77
const Account contact_account() const
Returns the Account of the admin or another contact person.
Definition: instance.cpp:50
Class to hold accounts.
Definition: account.hpp:46
Definition: mastodon-cpp.hpp:52
Base class for all entities.
Definition: easy.hpp:304
uint_fast64_t max_toot_chars() const
Returns the maximum chars a post can have.
Definition: instance.cpp:97
const string description() const
Returns the description of the instance.
Definition: instance.cpp:62
const string version() const
Returns the version used by the instance.
Definition: instance.cpp:87