Skip to content

Commit

Permalink
refactor: cleanup namespaces and unneeded includes (#1295)
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis authored Oct 20, 2024
1 parent 3d24041 commit 8f26e78
Show file tree
Hide file tree
Showing 126 changed files with 141 additions and 233 deletions.
2 changes: 1 addition & 1 deletion include/dpp/appcommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -1591,4 +1591,4 @@ typedef std::unordered_map<snowflake, slashcommand> slashcommand_map;
*/
typedef std::unordered_map<snowflake, guild_command_permissions> guild_command_permissions_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,4 +472,4 @@ class DPP_EXPORT application : public managed, public json_interface<application
*/
typedef std::unordered_map<snowflake, application> application_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/auditlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,4 @@ class DPP_EXPORT auditlog : public json_interface<auditlog> {
virtual ~auditlog() = default;
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/automod.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,4 @@ class DPP_EXPORT automod_rule : public managed, public json_interface<automod_ru
*/
typedef std::unordered_map<snowflake, automod_rule> automod_rule_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/ban.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ class DPP_EXPORT ban : public json_interface<ban> {
*/
typedef std::unordered_map<snowflake, ban> ban_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/bignum.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ class DPP_EXPORT bignumber {
[[nodiscard]] std::vector<uint64_t> get_binary() const;
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,5 @@ cache_decl(role, find_role, get_role_cache, get_role_count);
cache_decl(channel, find_channel, get_channel_cache, get_channel_count);
cache_decl(emoji, find_emoji, get_emoji_cache, get_emoji_count);

} // namespace dpp
}

2 changes: 1 addition & 1 deletion include/dpp/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -878,5 +878,5 @@ void to_json(nlohmann::json& j, const permission_overwrite& po);
*/
typedef std::unordered_map<snowflake, channel> channel_map;

} // namespace dpp
}

2 changes: 1 addition & 1 deletion include/dpp/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -3982,4 +3982,4 @@ class DPP_EXPORT cluster {

};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,4 +470,4 @@ class scheduled_event_collector : public scheduled_event_collector_t {
virtual ~scheduled_event_collector() = default;
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/commandhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,4 +425,4 @@ class DPP_EXPORT DPP_DEPRECATED("commandhandler should not be used. Please consi

};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/coro/async.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ class async : public awaitable<R> {

DPP_CHECK_ABI_COMPAT(async<>, async_dummy);

} // namespace dpp
}

#endif /* DPP_CORO */
2 changes: 1 addition & 1 deletion include/dpp/coro/coroutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ namespace detail::coroutine {
DPP_CHECK_ABI_COMPAT(coroutine<void>, coroutine_dummy)
DPP_CHECK_ABI_COMPAT(coroutine<uint64_t>, coroutine_dummy)

} // namespace dpp
}

/**
* @brief Specialization of std::coroutine_traits, helps the standard library figure out a promise type from a coroutine function.
Expand Down
2 changes: 1 addition & 1 deletion include/dpp/coro/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ std_coroutine::coroutine_handle<> final_awaiter<R>::await_suspend(handle_t<R> ha
DPP_CHECK_ABI_COMPAT(task<void>, task_dummy)
DPP_CHECK_ABI_COMPAT(task<uint64_t>, task_dummy)

} // namespace dpp
}

/**
* @brief Specialization of std::coroutine_traits, helps the standard library figure out a promise_t type from a coroutine function.
Expand Down
2 changes: 1 addition & 1 deletion include/dpp/discordclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,4 +533,4 @@ class DPP_EXPORT discord_client : public websocket_client
voiceconn* get_voice(snowflake guild_id);
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/discordevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,4 @@ std::string DPP_EXPORT base64_encode(unsigned char const* buf, unsigned int buff
*/
std::string DPP_EXPORT ts_to_string(time_t ts);

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/discordvoiceclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -1271,5 +1271,5 @@ class DPP_EXPORT discord_voice_client : public websocket_client
void process_mls_group_rosters(const std::map<uint64_t, std::vector<uint8_t>>& rmap);
};

} // namespace dpp
}

2 changes: 1 addition & 1 deletion include/dpp/dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -2198,5 +2198,5 @@ struct DPP_EXPORT entitlement_delete_t : public event_dispatch_t {
entitlement deleted = {};
};

} // namespace dpp
}

2 changes: 1 addition & 1 deletion include/dpp/dtemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ class DPP_EXPORT dtemplate : public json_interface<dtemplate> {
*/
typedef std::unordered_map<snowflake, dtemplate> dtemplate_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/emoji.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ class DPP_EXPORT emoji : public managed, public json_interface<emoji> {
*/
typedef std::unordered_map<snowflake, emoji> emoji_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/entitlement.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ class DPP_EXPORT entitlement : public managed, public json_interface<entitlement
*/
typedef std::unordered_map<snowflake, entitlement> entitlement_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/etf.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,4 +708,4 @@ class DPP_EXPORT etf_parser {
std::string build(const nlohmann::json& j);
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ event_decl(entitlement_create, ENTITLEMENT_CREATE);
event_decl(entitlement_update, ENTITLEMENT_UPDATE);
event_decl(entitlement_delete, ENTITLEMENT_DELETE);

} // namespace dpp::events
}
2 changes: 1 addition & 1 deletion include/dpp/event_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -742,4 +742,4 @@ const T &awaitable<T>::await_resume() {
}
#endif

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,5 +602,5 @@ class exception : public std::exception
# endif /* DPP_CORO */
#endif

} // namespace dpp
}

2 changes: 1 addition & 1 deletion include/dpp/guild.h
Original file line number Diff line number Diff line change
Expand Up @@ -2048,4 +2048,4 @@ typedef std::unordered_map<snowflake, guild_member> guild_member_map;
*/
guild_member DPP_EXPORT find_guild_member(const snowflake guild_id, const snowflake user_id);

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/httpsclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,4 @@ class DPP_EXPORT https_client : public ssl_client {

};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/integration.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,5 +335,5 @@ typedef std::unordered_map<snowflake, integration> integration_map;
*/
typedef std::unordered_map<snowflake, connection> connection_map;

} // namespace dpp
}

2 changes: 1 addition & 1 deletion include/dpp/intents.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ enum intents {
i_unverified_default_intents = dpp::i_default_intents | dpp::i_message_content
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/invite.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,4 @@ class DPP_EXPORT invite : public json_interface<invite> {
*/
typedef std::unordered_map<std::string, invite> invite_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/isa/avx.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ namespace dpp {
}
};

} // namespace dpp
}

#endif
2 changes: 1 addition & 1 deletion include/dpp/isa/avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@ namespace dpp {
}
};

} // namespace dpp
}

#endif
2 changes: 1 addition & 1 deletion include/dpp/isa/avx512.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ namespace dpp {
}
};

} // namespace dpp
}

#endif
2 changes: 1 addition & 1 deletion include/dpp/isa/fallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ namespace dpp {
}
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/json_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ struct json_interface {
}
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/managed.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ class DPP_EXPORT managed {
}
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -2651,4 +2651,4 @@ typedef std::unordered_map<snowflake, sticker> sticker_map;
*/
typedef std::unordered_map<snowflake, sticker_pack> sticker_pack_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/misc-enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ enum loglevel {
ll_critical
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/once.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ template <typename T> auto run_once() {
return !std::exchange(called, true);
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/permissions.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,4 +456,4 @@ class DPP_EXPORT permission {
}
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/presence.h
Original file line number Diff line number Diff line change
Expand Up @@ -595,4 +595,4 @@ class DPP_EXPORT presence : public json_interface<presence> {
*/
typedef std::unordered_map<snowflake, presence> presence_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/prune.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ struct DPP_EXPORT prune : public json_interface<prune> {
json to_json(bool with_id = false) const; // Intentional shadow of json_interface, mostly present for documentation
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/queues.h
Original file line number Diff line number Diff line change
Expand Up @@ -671,4 +671,4 @@ class DPP_EXPORT request_queue {
bool is_globally_ratelimited() const;
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/restrequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,4 @@ template<class T> inline void rest_request_vector(dpp::cluster* c, const char* b
}


} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/restresults.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,4 @@ typedef std::function<void(const confirmation_callback_t&)> command_completion_e
* @brief Automatically JSON encoded HTTP result
*/
typedef std::function<void(json&, const http_request_completion_t&)> json_encode_t;
} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/role.h
Original file line number Diff line number Diff line change
Expand Up @@ -994,5 +994,5 @@ typedef std::unordered_map<snowflake, role> role_map;
*/
typedef std::vector<application_role_connection_metadata> application_role_connection_metadata_list;

} // namespace dpp
}

2 changes: 1 addition & 1 deletion include/dpp/sku.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ class DPP_EXPORT sku : public managed, public json_interface<sku> {
*/
typedef std::unordered_map<snowflake, sku> sku_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/snowflake.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class DPP_EXPORT snowflake final {
}
};

} // namespace dpp
}

template<>
struct std::hash<dpp::snowflake>
Expand Down
2 changes: 1 addition & 1 deletion include/dpp/sslclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,4 @@ class DPP_EXPORT ssl_client
virtual void log(dpp::loglevel severity, const std::string &msg) const;
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/stage_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ struct DPP_EXPORT stage_instance : public managed, public json_interface<stage_i
*/
typedef std::unordered_map<snowflake, stage_instance> stage_instance_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/stringops.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ template <typename T> std::string leading_zeroes(T i, size_t width)
return stream.str();
}

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ template<typename T, class F, class... Ts> T sync(class cluster* c, F func, Ts&&
return _f.get();
}

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/timed_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ template <typename attached_event, class listening_function> class timed_listene
}
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ class DPP_EXPORT oneshot_timer
~oneshot_timer();
};

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/user.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,4 +581,4 @@ void from_json(const nlohmann::json& j, user_identified& u);
*/
typedef std::unordered_map<snowflake, user> user_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -1066,4 +1066,4 @@ struct alignas(T) dummy {
};

} // namespace utility
} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/voiceregion.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ class DPP_EXPORT voiceregion : public json_interface<voiceregion> {
*/
typedef std::unordered_map<std::string, voiceregion> voiceregion_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/voicestate.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ class DPP_EXPORT voicestate : public json_interface<voicestate> {
/** A container of voicestates */
typedef std::unordered_map<std::string, voicestate> voicestate_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/webhook.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,4 @@ class DPP_EXPORT webhook : public managed, public json_interface<webhook> {
*/
typedef std::unordered_map<snowflake, webhook> webhook_map;

} // namespace dpp
}
2 changes: 1 addition & 1 deletion include/dpp/wsclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ class DPP_EXPORT websocket_client : public ssl_client {
void send_close_packet();
};

} // namespace dpp
}
Loading

0 comments on commit 8f26e78

Please sign in to comment.