Rewrote enums for consistency

This commit is contained in:
tastytea 2018-04-01 05:14:02 +02:00
parent 3acd8536d8
commit f298de7cff
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
5 changed files with 31 additions and 33 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7)
project (mastodon-cpp
VERSION 0.7.21
VERSION 0.7.22
LANGUAGES CXX
)

View File

@ -135,16 +135,16 @@ const Easy::attachment_type Attachment::type() const
{
const string strtype = get_string("type");
if (strtype.compare("image") == 0)
return attachment_type::image;
return attachment_type::Image;
else if (strtype.compare("video") == 0)
return attachment_type::video;
return attachment_type::Video;
else if (strtype.compare("gifv") == 0)
return attachment_type::gifv;
return attachment_type::Gifv;
else if (strtype.compare("unknown") == 0)
return attachment_type::unknown;
return attachment_type::Unknown;
ttdebug << "Could not get data: type\n";
return attachment_type::unknown;
return attachment_type::Undefined;
}
const string Attachment::url() const

View File

@ -77,16 +77,16 @@ const Easy::card_type Card::type() const
{
const string strtype = get_string("type");
if (strtype.compare("link") == 0)
return card_type::link;
return card_type::Link;
else if (strtype.compare("photo") == 0)
return card_type::photo;
return card_type::Photo;
else if (strtype.compare("video") == 0)
return card_type::video;
return card_type::Video;
else if (strtype.compare("rich") == 0)
return card_type::rich;
return card_type::Rich;
ttdebug << "Could not get data: type\n";
return card_type::unknown;
return card_type::Undefined;
}
const string Card::url() const

View File

@ -56,9 +56,6 @@ public:
/*!
* @brief Describes visibility of toots.
*
* The names begin with a capital letter because some of them
* are reserved keywords when written in all-lowercase.
*/
enum class visibility_type
{
@ -74,10 +71,11 @@ public:
*/
enum class attachment_type
{
image,
video,
gifv,
unknown
Image,
Video,
Gifv,
Unknown,
Undefined
};
/*!
@ -85,11 +83,11 @@ public:
*/
enum class card_type
{
link,
photo,
video,
rich,
unknown
Link,
Photo,
Video,
Rich,
Undefined
};
/*!
@ -97,11 +95,11 @@ public:
*/
enum class notification_type
{
mention,
reblog,
favourite,
follow,
unknown
Mention,
Reblog,
Favourite,
Follow,
Undefined
};
typedef std::pair<event_type, string> stream_event;

View File

@ -66,13 +66,13 @@ const Easy::notification_type Notification::type() const
{
const string strtype = get_string("type");
if (strtype.compare("mention") == 0)
return notification_type::mention;
return notification_type::Mention;
else if (strtype.compare("reblog") == 0)
return notification_type::reblog;
return notification_type::Reblog;
else if (strtype.compare("favourite") == 0)
return notification_type::favourite;
return notification_type::Favourite;
else if (strtype.compare("follow") == 0)
return notification_type::follow;
return notification_type::Follow;
return notification_type::unknown;
return notification_type::Undefined;
}