From c847d008fbddaae348370c613e4c3b07662ab204 Mon Sep 17 00:00:00 2001 From: Jessica James Date: Wed, 10 Nov 2021 21:22:30 -0600 Subject: [PATCH] Moved public headers to a jessilib subfolder; adjusted code as necessary --- src/bot/base_commands.cpp | 4 ++-- src/bot/console/console.cpp | 4 ++-- src/bot/console/console_command_context.cpp | 2 +- src/bot/console/console_command_context.hpp | 2 +- src/bot/main.cpp | 4 ++-- src/common/CMakeLists.txt | 1 + src/common/parsers/json.cpp | 4 ++-- src/include/impl/timer_manager.hpp | 6 +++--- src/include/{ => jessilib}/app_parameters.hpp | 0 src/include/{ => jessilib}/asio.hpp | 0 src/include/{ => jessilib}/assert.hpp | 0 src/include/{ => jessilib}/config.hpp | 0 src/include/{ => jessilib}/duration.hpp | 0 src/include/{ => jessilib}/io/ansi/ansi_text.hpp | 2 +- src/include/{ => jessilib}/io/color.hpp | 2 +- src/include/{ => jessilib}/io/command.hpp | 0 src/include/{ => jessilib}/io/command_context.hpp | 2 +- src/include/{ => jessilib}/io/command_manager.hpp | 0 src/include/{ => jessilib}/io/irc/irc_text.hpp | 0 src/include/{ => jessilib}/io/message.hpp | 0 src/include/{ => jessilib}/object.hpp | 0 src/include/{ => jessilib}/parser.hpp | 0 src/include/{ => jessilib}/parsers/json.hpp | 4 ++-- src/include/{ => jessilib}/serialize.hpp | 0 src/include/{ => jessilib}/split.hpp | 0 src/include/{ => jessilib}/thread_pool.hpp | 0 src/include/{ => jessilib}/timer.hpp | 0 src/include/{ => jessilib}/type_traits.hpp | 0 src/include/{ => jessilib}/unicode.hpp | 0 src/include/{ => jessilib}/util.hpp | 0 src/test/app_parameters.cpp | 2 +- src/test/config.cpp | 4 ++-- src/test/duration.cpp | 2 +- src/test/io/color.cpp | 2 +- src/test/object.cpp | 3 +-- src/test/parser.cpp | 5 ++--- src/test/parsers/json.cpp | 2 +- src/test/split.cpp | 2 -- src/test/split_compilation.cpp | 2 +- src/test/test_split.hpp | 2 +- src/test/thread_pool.cpp | 2 +- src/test/timer.cpp | 2 +- src/test/unicode.cpp | 2 +- src/test/util.cpp | 3 +-- 44 files changed, 34 insertions(+), 38 deletions(-) rename src/include/{ => jessilib}/app_parameters.hpp (100%) rename src/include/{ => jessilib}/asio.hpp (100%) rename src/include/{ => jessilib}/assert.hpp (100%) rename src/include/{ => jessilib}/config.hpp (100%) rename src/include/{ => jessilib}/duration.hpp (100%) rename src/include/{ => jessilib}/io/ansi/ansi_text.hpp (99%) rename src/include/{ => jessilib}/io/color.hpp (98%) rename src/include/{ => jessilib}/io/command.hpp (100%) rename src/include/{ => jessilib}/io/command_context.hpp (98%) rename src/include/{ => jessilib}/io/command_manager.hpp (100%) rename src/include/{ => jessilib}/io/irc/irc_text.hpp (100%) rename src/include/{ => jessilib}/io/message.hpp (100%) rename src/include/{ => jessilib}/object.hpp (100%) rename src/include/{ => jessilib}/parser.hpp (100%) rename src/include/{ => jessilib}/parsers/json.hpp (95%) rename src/include/{ => jessilib}/serialize.hpp (100%) rename src/include/{ => jessilib}/split.hpp (100%) rename src/include/{ => jessilib}/thread_pool.hpp (100%) rename src/include/{ => jessilib}/timer.hpp (100%) rename src/include/{ => jessilib}/type_traits.hpp (100%) rename src/include/{ => jessilib}/unicode.hpp (100%) rename src/include/{ => jessilib}/util.hpp (100%) diff --git a/src/bot/base_commands.cpp b/src/bot/base_commands.cpp index 3dae801..25b708e 100644 --- a/src/bot/base_commands.cpp +++ b/src/bot/base_commands.cpp @@ -16,8 +16,8 @@ * Written by Jessica James */ -#include "io/command.hpp" -#include "io/command_manager.hpp" +#include "jessilib/io/command.hpp" +#include "jessilib/io/command_manager.hpp" #include "shutdown.hpp" namespace jessibot { diff --git a/src/bot/console/console.cpp b/src/bot/console/console.cpp index 94b31ce..ef1138b 100644 --- a/src/bot/console/console.cpp +++ b/src/bot/console/console.cpp @@ -19,8 +19,8 @@ #include "console.hpp" #include -#include "io/command_manager.hpp" -#include "io/ansi/ansi_text.hpp" +#include "jessilib/io/command_manager.hpp" +#include "jessilib/io/ansi/ansi_text.hpp" #include "shutdown.hpp" #include "console/console_command_context.hpp" diff --git a/src/bot/console/console_command_context.cpp b/src/bot/console/console_command_context.cpp index 8eedd58..1a6c31a 100644 --- a/src/bot/console/console_command_context.cpp +++ b/src/bot/console/console_command_context.cpp @@ -19,7 +19,7 @@ #include "console_command_context.hpp" #include -#include "io/ansi/ansi_text.hpp" +#include "jessilib/io/ansi/ansi_text.hpp" namespace jessibot { namespace io { diff --git a/src/bot/console/console_command_context.hpp b/src/bot/console/console_command_context.hpp index b4678dd..ef07c70 100644 --- a/src/bot/console/console_command_context.hpp +++ b/src/bot/console/console_command_context.hpp @@ -18,7 +18,7 @@ #pragma once -#include "io/command_context.hpp" +#include "jessilib/io/command_context.hpp" namespace jessibot { namespace io { diff --git a/src/bot/main.cpp b/src/bot/main.cpp index ea0467e..1e4e7c0 100644 --- a/src/bot/main.cpp +++ b/src/bot/main.cpp @@ -17,8 +17,8 @@ */ #include -#include "app_parameters.hpp" -#include "parsers/json.hpp" +#include "jessilib/app_parameters.hpp" +#include "jessilib/parsers/json.hpp" #include "console/console.hpp" int main(int argc, char** argv) { diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 11ae70b..201367e 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -7,6 +7,7 @@ add_library(jessilib ${SOURCE_FILES}) # Setup include directories target_include_directories(jessilib PUBLIC ../include) +target_include_directories(jessilib PRIVATE ../include/jessilib) target_include_directories(jessilib PRIVATE ../include/impl/asio/include) # Setup additionally needed libs diff --git a/src/common/parsers/json.cpp b/src/common/parsers/json.cpp index 5bbf36e..01858e5 100644 --- a/src/common/parsers/json.cpp +++ b/src/common/parsers/json.cpp @@ -221,7 +221,7 @@ std::string read_json_string(std::string_view& in_data) { if (is_low_surrogate(second_codepoint)) { // We've got a valid surrogate pair; serialize the represented codepoint; decode it - codepoint = decode_surrogate_pair(codepoint, second_codepoint).codepoint; + codepoint = static_cast(decode_surrogate_pair(codepoint, second_codepoint).codepoint); encode_codepoint(result, codepoint); // serialize the real codepoint } else { @@ -296,7 +296,7 @@ object read_json_number(std::string_view& in_data) { // parse_decimal_part method in_data.remove_prefix(1); // strip leading '.' - long double decimal_value = integer_value; + long double decimal_value = static_cast(integer_value); from_chars_end = parse_decimal_part(in_data.data(), in_data.data() + in_data.size(), decimal_value); // TODO: parse exponent diff --git a/src/include/impl/timer_manager.hpp b/src/include/impl/timer_manager.hpp index 94e5d06..efbf61b 100644 --- a/src/include/impl/timer_manager.hpp +++ b/src/include/impl/timer_manager.hpp @@ -24,8 +24,8 @@ #include #include #include -#include "../timer.hpp" -#include "../thread_pool.hpp" +#include "timer.hpp" +#include "thread_pool.hpp" #include "timer_context.hpp" namespace jessilib { @@ -76,4 +76,4 @@ class timer_manager { }; // class timer_manager } // namespace impl -} // namespace jessilib \ No newline at end of file +} // namespace jessilib diff --git a/src/include/app_parameters.hpp b/src/include/jessilib/app_parameters.hpp similarity index 100% rename from src/include/app_parameters.hpp rename to src/include/jessilib/app_parameters.hpp diff --git a/src/include/asio.hpp b/src/include/jessilib/asio.hpp similarity index 100% rename from src/include/asio.hpp rename to src/include/jessilib/asio.hpp diff --git a/src/include/assert.hpp b/src/include/jessilib/assert.hpp similarity index 100% rename from src/include/assert.hpp rename to src/include/jessilib/assert.hpp diff --git a/src/include/config.hpp b/src/include/jessilib/config.hpp similarity index 100% rename from src/include/config.hpp rename to src/include/jessilib/config.hpp diff --git a/src/include/duration.hpp b/src/include/jessilib/duration.hpp similarity index 100% rename from src/include/duration.hpp rename to src/include/jessilib/duration.hpp diff --git a/src/include/io/ansi/ansi_text.hpp b/src/include/jessilib/io/ansi/ansi_text.hpp similarity index 99% rename from src/include/io/ansi/ansi_text.hpp rename to src/include/jessilib/io/ansi/ansi_text.hpp index 85723fe..b0230d8 100644 --- a/src/include/io/ansi/ansi_text.hpp +++ b/src/include/jessilib/io/ansi/ansi_text.hpp @@ -18,7 +18,7 @@ #pragma once -#include "io/message.hpp" +#include "jessilib/io/message.hpp" namespace jessilib { namespace io { diff --git a/src/include/io/color.hpp b/src/include/jessilib/io/color.hpp similarity index 98% rename from src/include/io/color.hpp rename to src/include/jessilib/io/color.hpp index 0a24097..5194611 100644 --- a/src/include/io/color.hpp +++ b/src/include/jessilib/io/color.hpp @@ -23,7 +23,7 @@ #include #include #include -#include "util.hpp" +#include "jessilib/util.hpp" namespace jessilib { namespace io { diff --git a/src/include/io/command.hpp b/src/include/jessilib/io/command.hpp similarity index 100% rename from src/include/io/command.hpp rename to src/include/jessilib/io/command.hpp diff --git a/src/include/io/command_context.hpp b/src/include/jessilib/io/command_context.hpp similarity index 98% rename from src/include/io/command_context.hpp rename to src/include/jessilib/io/command_context.hpp index 98953f3..7df7f82 100644 --- a/src/include/io/command_context.hpp +++ b/src/include/jessilib/io/command_context.hpp @@ -19,7 +19,7 @@ #pragma once #include -#include "object.hpp" +#include "jessilib/object.hpp" #include "message.hpp" namespace jessilib { diff --git a/src/include/io/command_manager.hpp b/src/include/jessilib/io/command_manager.hpp similarity index 100% rename from src/include/io/command_manager.hpp rename to src/include/jessilib/io/command_manager.hpp diff --git a/src/include/io/irc/irc_text.hpp b/src/include/jessilib/io/irc/irc_text.hpp similarity index 100% rename from src/include/io/irc/irc_text.hpp rename to src/include/jessilib/io/irc/irc_text.hpp diff --git a/src/include/io/message.hpp b/src/include/jessilib/io/message.hpp similarity index 100% rename from src/include/io/message.hpp rename to src/include/jessilib/io/message.hpp diff --git a/src/include/object.hpp b/src/include/jessilib/object.hpp similarity index 100% rename from src/include/object.hpp rename to src/include/jessilib/object.hpp diff --git a/src/include/parser.hpp b/src/include/jessilib/parser.hpp similarity index 100% rename from src/include/parser.hpp rename to src/include/jessilib/parser.hpp diff --git a/src/include/parsers/json.hpp b/src/include/jessilib/parsers/json.hpp similarity index 95% rename from src/include/parsers/json.hpp rename to src/include/jessilib/parsers/json.hpp index e9f7689..bfd34e7 100644 --- a/src/include/parsers/json.hpp +++ b/src/include/jessilib/parsers/json.hpp @@ -18,7 +18,7 @@ #pragma once -#include "parser.hpp" +#include "jessilib/parser.hpp" namespace jessilib { @@ -29,4 +29,4 @@ public: virtual std::string serialize(const object& in_object) override; }; -} // namespace jessilib \ No newline at end of file +} // namespace jessilib diff --git a/src/include/serialize.hpp b/src/include/jessilib/serialize.hpp similarity index 100% rename from src/include/serialize.hpp rename to src/include/jessilib/serialize.hpp diff --git a/src/include/split.hpp b/src/include/jessilib/split.hpp similarity index 100% rename from src/include/split.hpp rename to src/include/jessilib/split.hpp diff --git a/src/include/thread_pool.hpp b/src/include/jessilib/thread_pool.hpp similarity index 100% rename from src/include/thread_pool.hpp rename to src/include/jessilib/thread_pool.hpp diff --git a/src/include/timer.hpp b/src/include/jessilib/timer.hpp similarity index 100% rename from src/include/timer.hpp rename to src/include/jessilib/timer.hpp diff --git a/src/include/type_traits.hpp b/src/include/jessilib/type_traits.hpp similarity index 100% rename from src/include/type_traits.hpp rename to src/include/jessilib/type_traits.hpp diff --git a/src/include/unicode.hpp b/src/include/jessilib/unicode.hpp similarity index 100% rename from src/include/unicode.hpp rename to src/include/jessilib/unicode.hpp diff --git a/src/include/util.hpp b/src/include/jessilib/util.hpp similarity index 100% rename from src/include/util.hpp rename to src/include/jessilib/util.hpp diff --git a/src/test/app_parameters.cpp b/src/test/app_parameters.cpp index 383bb9b..275ba54 100644 --- a/src/test/app_parameters.cpp +++ b/src/test/app_parameters.cpp @@ -17,7 +17,7 @@ */ #include "test.hpp" -#include "app_parameters.hpp" +#include "jessilib/app_parameters.hpp" using namespace jessilib; using namespace std::literals; diff --git a/src/test/config.cpp b/src/test/config.cpp index 03f49bd..3b8402b 100644 --- a/src/test/config.cpp +++ b/src/test/config.cpp @@ -20,8 +20,8 @@ #include #include #include "test.hpp" -#include "config.hpp" -#include "serialize.hpp" // format_not_available +#include "jessilib/config.hpp" +#include "jessilib/serialize.hpp" // format_not_available using namespace jessilib; using namespace std::literals; diff --git a/src/test/duration.cpp b/src/test/duration.cpp index d3df9ee..becaf28 100644 --- a/src/test/duration.cpp +++ b/src/test/duration.cpp @@ -16,7 +16,7 @@ * Written by Jessica James */ -#include "duration.hpp" +#include "jessilib/duration.hpp" #include "test.hpp" using namespace jessilib; diff --git a/src/test/io/color.cpp b/src/test/io/color.cpp index 348dbf6..d98ebc2 100644 --- a/src/test/io/color.cpp +++ b/src/test/io/color.cpp @@ -16,7 +16,7 @@ * Written by Jessica James */ -#include "io/color.hpp" +#include "jessilib/io/color.hpp" #include "test.hpp" using namespace jessilib; diff --git a/src/test/object.cpp b/src/test/object.cpp index bcd324e..b074f78 100644 --- a/src/test/object.cpp +++ b/src/test/object.cpp @@ -16,9 +16,8 @@ * Written by Jessica James */ -#include #include "test.hpp" -#include "object.hpp" +#include "jessilib/object.hpp" using namespace jessilib; using namespace std::literals; diff --git a/src/test/parser.cpp b/src/test/parser.cpp index 3a3c48a..2dfd8e2 100644 --- a/src/test/parser.cpp +++ b/src/test/parser.cpp @@ -16,11 +16,10 @@ * Written by Jessica James */ -#include #include #include "test.hpp" -#include "parser.hpp" -#include "serialize.hpp" +#include "jessilib/parser.hpp" +#include "jessilib/serialize.hpp" using namespace jessilib; using namespace std::literals; diff --git a/src/test/parsers/json.cpp b/src/test/parsers/json.cpp index e954551..688080f 100644 --- a/src/test/parsers/json.cpp +++ b/src/test/parsers/json.cpp @@ -17,7 +17,7 @@ */ #include "test.hpp" -#include "parsers/json.hpp" +#include "jessilib/parsers/json.hpp" using namespace jessilib; using namespace std::literals; diff --git a/src/test/split.cpp b/src/test/split.cpp index 23f6581..e94634b 100644 --- a/src/test/split.cpp +++ b/src/test/split.cpp @@ -16,8 +16,6 @@ * Written by Jessica James */ -#include "split.hpp" -#include #include "test_split.hpp" using namespace jessilib; diff --git a/src/test/split_compilation.cpp b/src/test/split_compilation.cpp index 715e0a2..5742ba5 100644 --- a/src/test/split_compilation.cpp +++ b/src/test/split_compilation.cpp @@ -20,7 +20,7 @@ * Tests which exist solely test test compilation for split.hpp, because MSVC demands /bigobj, and I don't want to */ -#include "split.hpp" +#include "jessilib/split.hpp" #include #include #include "test_split.hpp" diff --git a/src/test/test_split.hpp b/src/test/test_split.hpp index 2efcb4e..8900cfa 100644 --- a/src/test/test_split.hpp +++ b/src/test/test_split.hpp @@ -18,7 +18,7 @@ #pragma once -#include "split.hpp" +#include "jessilib/split.hpp" #include "test.hpp" #include diff --git a/src/test/thread_pool.cpp b/src/test/thread_pool.cpp index 36ae8fd..57ea5ce 100644 --- a/src/test/thread_pool.cpp +++ b/src/test/thread_pool.cpp @@ -18,7 +18,7 @@ #include #include "test.hpp" -#include "thread_pool.hpp" +#include "jessilib/thread_pool.hpp" using namespace jessilib; using namespace std::literals; diff --git a/src/test/timer.cpp b/src/test/timer.cpp index 1e47837..61fc153 100644 --- a/src/test/timer.cpp +++ b/src/test/timer.cpp @@ -18,7 +18,7 @@ #include #include "test.hpp" -#include "timer.hpp" +#include "jessilib/timer.hpp" using namespace jessilib; using namespace std::literals; diff --git a/src/test/unicode.cpp b/src/test/unicode.cpp index d491c69..d200b79 100644 --- a/src/test/unicode.cpp +++ b/src/test/unicode.cpp @@ -16,7 +16,7 @@ * Written by Jessica James */ -#include "unicode.hpp" +#include "jessilib/unicode.hpp" #include "test.hpp" using namespace jessilib; diff --git a/src/test/util.cpp b/src/test/util.cpp index f22e7ee..299bc87 100644 --- a/src/test/util.cpp +++ b/src/test/util.cpp @@ -16,9 +16,8 @@ * Written by Jessica James */ -#include "util.hpp" +#include "jessilib/util.hpp" #include "test.hpp" -#include "object.hpp" using namespace jessilib; using namespace std::literals;