mastodon-cpp
0.21.0
|
Class to hold accounts. More...
#include <account.hpp>
Classes | |
class | Source |
Class to hold source attribute. More... | |
Public Types | |
using | fields_pair = std::pair< const string, const string > |
Describes a field. Format: name, value. More... | |
Public Member Functions | |
Account (const string &json) | |
Constructs an Account object from a JSON string. More... | |
Account () | |
Constructs an empty Account object. More... | |
virtual bool | valid () const |
Returns true if the Entity holds valid data. More... | |
const string | acct () const |
Returns username. More... | |
const string | avatar () const |
Returns URL of avatar. More... | |
Account | avatar (const string &avatar) |
Sets avatar. More... | |
const string | avatar_static () const |
Returns URL of static avatar. More... | |
bool | bot () const |
Returns true if the account performs automated actions. More... | |
const system_clock::time_point | created_at () const |
Returns time of creation. More... | |
const string | display_name () const |
Returns display name. More... | |
Account | display_name (const string &display_name) |
Sets display name. More... | |
const std::vector< fields_pair > | fields () const |
Returns metadata fields. More... | |
Account | fields (std::vector< fields_pair > &fields) |
Sets metadata fields. More... | |
uint_fast64_t | followers_count () const |
Returns number of followers. More... | |
uint_fast64_t | following_count () const |
Returns number of people this account follows. More... | |
const string | header () const |
Returns URL of header image. More... | |
Account | header (const string &header) |
Sets header image. More... | |
const string | header_static () const |
Returns URL of static header image. More... | |
uint_fast64_t | id () const |
Returns account-ID. More... | |
bool | locked () const |
Returns true if the account is locked. More... | |
Account | locked (const bool &locked) |
Sets locked state. More... | |
bool | has_moved () const |
Returns true if the account has been moved. More... | |
const Account | moved () const |
If the owner decided to switch accounts, new account is in this attribute. More... | |
const string | note () const |
Returns note. More... | |
Account | note (const string ¬e) |
Sets note. More... | |
const string | note_plain () const |
Returns plaintext version of note. More... | |
visibility_type | privacy () const |
Returns default privacy of new toots. More... | |
bool | sensitive () const |
Returns if media is marked as sensitive by default. More... | |
const Source | source () const |
Account | source (const Source &source) |
uint_fast64_t | statuses_count () const |
Returns number of statuses. More... | |
const string | url () const |
Returns URL of the profile. More... | |
const string | username () const |
Returns username (without ) More... | |
Public Member Functions inherited from Mastodon::Easy::Entity | |
Entity (const string &json) | |
Constructs an Entity object from a JSON string. More... | |
Entity () | |
Constructs an empty Entity object. More... | |
void | from_string (const string &json) |
Replaces the Entity with a new one from a JSON string. More... | |
const Json::Value | to_object () const |
Returns the JSON object of the Entity. More... | |
const string | error () const |
Returns error string sent by the server. More... | |
bool | was_set () const |
Returns true if the last requested value was set, false if it was unset. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Mastodon::Easy::Entity | |
const Json::Value | get (const string &key) const |
Returns the value of key as Json::Value. More... | |
const string | get_string (const string &key) const |
Returns the value of key as std::string. More... | |
uint_fast64_t | get_uint64 (const string &key) const |
Returns the value of key as std::uint_fast64_t. More... | |
double | get_double (const string &key) const |
Returns the value of key as double. More... | |
bool | get_bool (const string &key) const |
Returns the value of key as bool. More... | |
const system_clock::time_point | get_time_point (const string &key) const |
Returns the value of key as time_point. More... | |
const std::vector< string > | get_vector (const string &key) const |
Returns the value of key as vector. More... | |
void | set (const string &key, const Json::Value &value) |
Sets the value of key. More... | |
std::uint_fast64_t | stouint64 (const string &str) const |
bool | check_valid (const std::vector< string > &attributes) const |
Checks if an Entity is valid. More... | |
Class to hold accounts.
using Mastodon::Easy::Account::fields_pair = std::pair<const string, const string> |
Describes a field. Format: name, value.
|
explicit |
Account::Account | ( | ) |
const string Account::acct | ( | ) | const |
Returns username.
username
for users on the same instance, user@hostname
for users on other instances.
const string Account::avatar | ( | ) | const |
Returns URL of avatar.
Account Account::avatar | ( | const string & | avatar | ) |
Sets avatar.
Filename or base64-encoded
const string Account::avatar_static | ( | ) | const |
Returns URL of static avatar.
bool Account::bot | ( | ) | const |
Returns true if the account performs automated actions.
const system_clock::time_point Account::created_at | ( | ) | const |
Returns time of creation.
const string Account::display_name | ( | ) | const |
Returns display name.
Account Account::display_name | ( | const string & | display_name | ) |
Sets display name.
const std::vector< Account::fields_pair > Account::fields | ( | ) | const |
Returns metadata fields.
Account Mastodon::Easy::Account::fields | ( | std::vector< fields_pair > & | fields | ) |
Sets metadata fields.
std::uint_fast64_t Account::followers_count | ( | ) | const |
Returns number of followers.
std::uint_fast64_t Account::following_count | ( | ) | const |
Returns number of people this account follows.
bool Account::has_moved | ( | ) | const |
const string Account::header | ( | ) | const |
Returns URL of header image.
Account Account::header | ( | const string & | header | ) |
Sets header image.
Filename or base64-encoded.
const string Account::header_static | ( | ) | const |
Returns URL of static header image.
std::uint_fast64_t Account::id | ( | ) | const |
Returns account-ID.
bool Account::locked | ( | ) | const |
Returns true if the account is locked.
Account Account::locked | ( | const bool & | locked | ) |
Sets locked state.
const Account Account::moved | ( | ) | const |
If the owner decided to switch accounts, new account is in this attribute.
const string Account::note | ( | ) | const |
Returns note.
Account Account::note | ( | const string & | note | ) |
Sets note.
const string Account::note_plain | ( | ) | const |
Returns plaintext version of note.
Easy::visibility_type Account::privacy | ( | ) | const |
Returns default privacy of new toots.
bool Account::sensitive | ( | ) | const |
Returns if media is marked as sensitive by default.
std::uint_fast64_t Account::statuses_count | ( | ) | const |
Returns number of statuses.
const string Account::url | ( | ) | const |
Returns URL of the profile.
const string Account::username | ( | ) | const |
Returns username (without )
|
virtual |
Returns true if the Entity holds valid data.
Implements Mastodon::Easy::Entity.