Skip to content

Commit

Permalink
DiscordCoreAPI v2.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
RealTimeChris committed Dec 3, 2024
1 parent a6d1022 commit d8881ee
Show file tree
Hide file tree
Showing 20 changed files with 284 additions and 444 deletions.
2 changes: 0 additions & 2 deletions CMake/BuildFeatureTester.bat

This file was deleted.

3 changes: 0 additions & 3 deletions CMake/BuildFeatureTester.sh

This file was deleted.

5 changes: 0 additions & 5 deletions CMake/CMakeLists.txt

This file was deleted.

117 changes: 0 additions & 117 deletions CMake/DCADetectArchitecture.cmake

This file was deleted.

184 changes: 0 additions & 184 deletions CMake/main.cpp

This file was deleted.

7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ set(Opus_DIR "C:/Vcpkg/installed/x64-windows-static/share/opus") # Set this one
set(unofficial-sodium_DIR "C:/Vcpkg/installed/x64-windows-static/share/unofficial-sodium") # Set this one to the folder location of the file "unofficial-sodiumConfig.cmake".
set(Jsonifier_DIR "") # Set this one to the folder location of the file "JsonifierConfig.cmake".
set(OPENSSL_ROOT_DIR "C:/Vcpkg/installed/x64-windows-static/") # Set this one to the folder location of the include folder and library folders of OpenSSL.
set(VCPKG_ROOT_DIR "C:/Vcpkg")
set(CMAKE_BUILD_TYPES "Release;Debug")
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
set(DEV TRUE)

if (EXISTS "${VCPKG_ROOT_DIR}")
if (EXISTS "${_VCPKG_ROOT_DIR}")
set(VCPKG_ROOT_DIR "${_VCPKG_ROOT_DIR}")
set(ENV{VCPKG_INSTALLATION_ROOT} "${_VCPKG_ROOT_DIR}")
else()
set(VCPKG_ROOT_DIR "C:/Vcpkg")
set(ENV{VCPKG_INSTALLATION_ROOT} "${VCPKG_ROOT_DIR}")
endif()

Expand Down
19 changes: 10 additions & 9 deletions Include/discordcoreapi/JsonSpecializations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,17 @@ namespace jsonifier_internal {

template<jsonifier::serialize_options options, snowflake_t value_type, jsonifier::concepts::buffer_like buffer_type, typename index_type, typename indent_type>
struct serialize_impl<options, value_type, buffer_type, index_type, indent_type> {
template<typename value_type_new> JSONIFIER_ALWAYS_INLINE static void impl(value_type_new&& value, buffer_type& buffer, index_type&index, indent_type& indent) noexcept {
template<typename value_type_new> DCA_ALWAYS_INLINE static void impl(value_type_new&& value, buffer_type& buffer, index_type&index, indent_type& indent) noexcept {
jsonifier::string newString{ static_cast<jsonifier::string>(value) };
serialize<options>::impl(newString, buffer, index, indent);
}
};

template<bool minified, jsonifier::parse_options options, snowflake_t value_type, typename parse_context_type> struct parse_impl<minified, options, value_type, parse_context_type> {
JSONIFIER_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
template<bool minified, jsonifier::parse_options options, snowflake_t value_type, typename buffer_type, typename parse_context_type>
struct parse_impl<minified, options, value_type, buffer_type, parse_context_type> {
DCA_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
jsonifier::raw_json_data newString{};
parse<minified, options>::impl(newString, context);
parse<minified, options>::template impl(newString, context);
if (newString.getType() == jsonifier::json_type::String) {
value = newString.get<jsonifier::string>();
} else {
Expand All @@ -92,17 +93,17 @@ namespace jsonifier_internal {

template<jsonifier::serialize_options options, time_stamp_t value_type, jsonifier::concepts::buffer_like buffer_type, typename index_type, typename indent_type>
struct serialize_impl<options, value_type, buffer_type, index_type, indent_type> {
template<typename value_type_new> JSONIFIER_ALWAYS_INLINE static void impl(value_type_new&& value, buffer_type& buffer, index_type& index, indent_type& indent) noexcept {
template<typename value_type_new> DCA_ALWAYS_INLINE static void impl(value_type_new&& value, buffer_type& buffer, index_type& index, indent_type& indent) noexcept {
jsonifier::string newString{ static_cast<jsonifier::string>(value) };
serialize<options>::impl(newString, buffer, index, indent);
}
};

template<bool minified, jsonifier::parse_options options, time_stamp_t value_type, typename parse_context_type>
struct parse_impl<minified, options, value_type, parse_context_type> {
JSONIFIER_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
template<bool minified, jsonifier::parse_options options, time_stamp_t value_type, typename buffer_type, typename parse_context_type>
struct parse_impl<minified, options, value_type, buffer_type, parse_context_type> {
DCA_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
jsonifier::raw_json_data newString{};
parse<minified, options>::impl(newString, context);
parse<minified, options>::template impl(newString, context);
if (newString.getType() == jsonifier::json_type::String) {
value = newString.get<jsonifier::string>();
} else {
Expand Down
Loading

0 comments on commit d8881ee

Please sign in to comment.