├── .gitattributes ├── .gitignore ├── LICENSE.txt ├── README.md ├── link_files ├── 3rdparty │ └── include │ │ └── spdlog │ │ ├── async.h │ │ ├── async_logger-inl.h │ │ ├── async_logger.h │ │ ├── cfg │ │ ├── argv.h │ │ ├── env.h │ │ ├── helpers-inl.h │ │ └── helpers.h │ │ ├── common-inl.h │ │ ├── common.h │ │ ├── details │ │ ├── backtracer-inl.h │ │ ├── backtracer.h │ │ ├── circular_q.h │ │ ├── console_globals.h │ │ ├── file_helper-inl.h │ │ ├── file_helper.h │ │ ├── fmt_helper.h │ │ ├── log_msg-inl.h │ │ ├── log_msg.h │ │ ├── log_msg_buffer-inl.h │ │ ├── log_msg_buffer.h │ │ ├── mpmc_blocking_q.h │ │ ├── null_mutex.h │ │ ├── os-inl.h │ │ ├── os.h │ │ ├── periodic_worker-inl.h │ │ ├── periodic_worker.h │ │ ├── registry-inl.h │ │ ├── registry.h │ │ ├── synchronous_factory.h │ │ ├── tcp_client-windows.h │ │ ├── tcp_client.h │ │ ├── thread_pool-inl.h │ │ ├── thread_pool.h │ │ ├── udp_client-windows.h │ │ ├── udp_client.h │ │ └── windows_include.h │ │ ├── fmt │ │ ├── bin_to_hex.h │ │ ├── bundled │ │ │ ├── args.h │ │ │ ├── chrono.h │ │ │ ├── color.h │ │ │ ├── compile.h │ │ │ ├── core.h │ │ │ ├── fmt.license.rst │ │ │ ├── format-inl.h │ │ │ ├── format.h │ │ │ ├── locale.h │ │ │ ├── os.h │ │ │ ├── ostream.h │ │ │ ├── printf.h │ │ │ ├── ranges.h │ │ │ ├── std.h │ │ │ └── xchar.h │ │ ├── chrono.h │ │ ├── compile.h │ │ ├── fmt.h │ │ ├── ostr.h │ │ ├── ranges.h │ │ ├── std.h │ │ └── xchar.h │ │ ├── formatter.h │ │ ├── fwd.h │ │ ├── logger-inl.h │ │ ├── logger.h │ │ ├── pattern_formatter-inl.h │ │ ├── pattern_formatter.h │ │ ├── sinks │ │ ├── android_sink.h │ │ ├── ansicolor_sink-inl.h │ │ ├── ansicolor_sink.h │ │ ├── base_sink-inl.h │ │ ├── base_sink.h │ │ ├── basic_file_sink-inl.h │ │ ├── basic_file_sink.h │ │ ├── callback_sink.h │ │ ├── daily_file_sink.h │ │ ├── dist_sink.h │ │ ├── dup_filter_sink.h │ │ ├── hourly_file_sink.h │ │ ├── kafka_sink.h │ │ ├── mongo_sink.h │ │ ├── msvc_sink.h │ │ ├── null_sink.h │ │ ├── ostream_sink.h │ │ ├── qt_sinks.h │ │ ├── ringbuffer_sink.h │ │ ├── rotating_file_sink-inl.h │ │ ├── rotating_file_sink.h │ │ ├── sink-inl.h │ │ ├── sink.h │ │ ├── stdout_color_sinks-inl.h │ │ ├── stdout_color_sinks.h │ │ ├── stdout_sinks-inl.h │ │ ├── stdout_sinks.h │ │ ├── syslog_sink.h │ │ ├── systemd_sink.h │ │ ├── tcp_sink.h │ │ ├── udp_sink.h │ │ ├── win_eventlog_sink.h │ │ ├── wincolor_sink-inl.h │ │ └── wincolor_sink.h │ │ ├── spdlog-inl.h │ │ ├── spdlog.h │ │ ├── stopwatch.h │ │ ├── tweakme.h │ │ └── version.h ├── link_files.cpp ├── link_files.vcxproj └── link_files.vcxproj.filters ├── nfo_scraper.sln └── nfo_scraper ├── .clang-format ├── 3rdparty ├── include │ ├── curl │ │ ├── curl.h │ │ ├── curlver.h │ │ ├── easy.h │ │ ├── header.h │ │ ├── mprintf.h │ │ ├── multi.h │ │ ├── options.h │ │ ├── stdcheaders.h │ │ ├── system.h │ │ ├── typecheck-gcc.h │ │ ├── urlapi.h │ │ └── websockets.h │ ├── pugixml │ │ ├── pugiconfig.hpp │ │ └── pugixml.hpp │ ├── rapidjson │ │ ├── allocators.h │ │ ├── cursorstreamwrapper.h │ │ ├── document.h │ │ ├── encodedstream.h │ │ ├── encodings.h │ │ ├── error │ │ │ ├── en.h │ │ │ └── error.h │ │ ├── filereadstream.h │ │ ├── filewritestream.h │ │ ├── fwd.h │ │ ├── internal │ │ │ ├── biginteger.h │ │ │ ├── clzll.h │ │ │ ├── diyfp.h │ │ │ ├── dtoa.h │ │ │ ├── ieee754.h │ │ │ ├── itoa.h │ │ │ ├── meta.h │ │ │ ├── pow10.h │ │ │ ├── regex.h │ │ │ ├── stack.h │ │ │ ├── strfunc.h │ │ │ ├── strtod.h │ │ │ └── swap.h │ │ ├── istreamwrapper.h │ │ ├── memorybuffer.h │ │ ├── memorystream.h │ │ ├── msinttypes │ │ │ ├── inttypes.h │ │ │ └── stdint.h │ │ ├── ostreamwrapper.h │ │ ├── pointer.h │ │ ├── prettywriter.h │ │ ├── rapidjson.h │ │ ├── reader.h │ │ ├── schema.h │ │ ├── stream.h │ │ ├── stringbuffer.h │ │ ├── uri.h │ │ └── writer.h │ └── spdlog │ │ ├── async.h │ │ ├── async_logger-inl.h │ │ ├── async_logger.h │ │ ├── cfg │ │ ├── argv.h │ │ ├── env.h │ │ ├── helpers-inl.h │ │ └── helpers.h │ │ ├── common-inl.h │ │ ├── common.h │ │ ├── details │ │ ├── backtracer-inl.h │ │ ├── backtracer.h │ │ ├── circular_q.h │ │ ├── console_globals.h │ │ ├── file_helper-inl.h │ │ ├── file_helper.h │ │ ├── fmt_helper.h │ │ ├── log_msg-inl.h │ │ ├── log_msg.h │ │ ├── log_msg_buffer-inl.h │ │ ├── log_msg_buffer.h │ │ ├── mpmc_blocking_q.h │ │ ├── null_mutex.h │ │ ├── os-inl.h │ │ ├── os.h │ │ ├── periodic_worker-inl.h │ │ ├── periodic_worker.h │ │ ├── registry-inl.h │ │ ├── registry.h │ │ ├── synchronous_factory.h │ │ ├── tcp_client-windows.h │ │ ├── tcp_client.h │ │ ├── thread_pool-inl.h │ │ ├── thread_pool.h │ │ ├── udp_client-windows.h │ │ ├── udp_client.h │ │ └── windows_include.h │ │ ├── fmt │ │ ├── bin_to_hex.h │ │ ├── bundled │ │ │ ├── args.h │ │ │ ├── chrono.h │ │ │ ├── color.h │ │ │ ├── compile.h │ │ │ ├── core.h │ │ │ ├── fmt.license.rst │ │ │ ├── format-inl.h │ │ │ ├── format.h │ │ │ ├── locale.h │ │ │ ├── os.h │ │ │ ├── ostream.h │ │ │ ├── printf.h │ │ │ ├── ranges.h │ │ │ ├── std.h │ │ │ └── xchar.h │ │ ├── chrono.h │ │ ├── compile.h │ │ ├── fmt.h │ │ ├── ostr.h │ │ ├── ranges.h │ │ ├── std.h │ │ └── xchar.h │ │ ├── formatter.h │ │ ├── fwd.h │ │ ├── logger-inl.h │ │ ├── logger.h │ │ ├── pattern_formatter-inl.h │ │ ├── pattern_formatter.h │ │ ├── sinks │ │ ├── android_sink.h │ │ ├── ansicolor_sink-inl.h │ │ ├── ansicolor_sink.h │ │ ├── base_sink-inl.h │ │ ├── base_sink.h │ │ ├── basic_file_sink-inl.h │ │ ├── basic_file_sink.h │ │ ├── callback_sink.h │ │ ├── daily_file_sink.h │ │ ├── dist_sink.h │ │ ├── dup_filter_sink.h │ │ ├── hourly_file_sink.h │ │ ├── kafka_sink.h │ │ ├── mongo_sink.h │ │ ├── msvc_sink.h │ │ ├── null_sink.h │ │ ├── ostream_sink.h │ │ ├── qt_sinks.h │ │ ├── ringbuffer_sink.h │ │ ├── rotating_file_sink-inl.h │ │ ├── rotating_file_sink.h │ │ ├── sink-inl.h │ │ ├── sink.h │ │ ├── stdout_color_sinks-inl.h │ │ ├── stdout_color_sinks.h │ │ ├── stdout_sinks-inl.h │ │ ├── stdout_sinks.h │ │ ├── syslog_sink.h │ │ ├── systemd_sink.h │ │ ├── tcp_sink.h │ │ ├── udp_sink.h │ │ ├── win_eventlog_sink.h │ │ ├── wincolor_sink-inl.h │ │ └── wincolor_sink.h │ │ ├── spdlog-inl.h │ │ ├── spdlog.h │ │ ├── stopwatch.h │ │ ├── tweakme.h │ │ └── version.h └── lib │ ├── libcurl_a.lib │ ├── libcurl_a_debug.lib │ ├── pugixml.lib │ └── pugixml_debug.lib ├── add_episodes_dialog.cpp ├── add_episodes_dialog.h ├── add_episodes_dialog.ui ├── config.cpp ├── config.h ├── config.json ├── fetch_episode.cpp ├── fetch_episode.h ├── fetch_episode.ui ├── fetch_seasons.cpp ├── fetch_seasons.h ├── fetch_seasons.ui ├── fetch_shows.cpp ├── fetch_shows.h ├── fetch_shows.ui ├── input_paths.cpp ├── input_paths.h ├── input_paths.ico ├── input_paths.qrc ├── input_paths.rc ├── input_paths.ui ├── main.cpp ├── nfo_scraper.vcxproj ├── nfo_scraper.vcxproj.filters ├── process_shows.cpp ├── process_shows.h ├── process_shows.ui ├── qlist_widget_drag_drop.cpp ├── qlist_widget_drag_drop.h ├── search_dialog.cpp ├── search_dialog.h ├── search_dialog.ui ├── setting.ui ├── tools.cpp ├── tools.h ├── write_ignore.cpp ├── write_ignore.h └── write_ignore.ui /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/async_logger-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | SPDLOG_INLINE spdlog::async_logger::async_logger(std::string logger_name, 17 | sinks_init_list sinks_list, 18 | std::weak_ptr tp, 19 | async_overflow_policy overflow_policy) 20 | : async_logger(std::move(logger_name), 21 | sinks_list.begin(), 22 | sinks_list.end(), 23 | std::move(tp), 24 | overflow_policy) {} 25 | 26 | SPDLOG_INLINE spdlog::async_logger::async_logger(std::string logger_name, 27 | sink_ptr single_sink, 28 | std::weak_ptr tp, 29 | async_overflow_policy overflow_policy) 30 | : async_logger( 31 | std::move(logger_name), {std::move(single_sink)}, std::move(tp), overflow_policy) {} 32 | 33 | // send the log message to the thread pool 34 | SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg){ 35 | SPDLOG_TRY{if (auto pool_ptr = thread_pool_.lock()){ 36 | pool_ptr->post_log(shared_from_this(), msg, overflow_policy_); 37 | } 38 | else { 39 | throw_spdlog_ex("async log: thread pool doesn't exist anymore"); 40 | } 41 | } 42 | SPDLOG_LOGGER_CATCH(msg.source) 43 | } 44 | 45 | // send flush request to the thread pool 46 | SPDLOG_INLINE void spdlog::async_logger::flush_(){ 47 | SPDLOG_TRY{if (auto pool_ptr = thread_pool_.lock()){ 48 | pool_ptr->post_flush(shared_from_this(), overflow_policy_); 49 | } 50 | else { 51 | throw_spdlog_ex("async flush: thread pool doesn't exist anymore"); 52 | } 53 | } 54 | SPDLOG_LOGGER_CATCH(source_loc()) 55 | } 56 | 57 | // 58 | // backend functions - called from the thread pool to do the actual job 59 | // 60 | SPDLOG_INLINE void spdlog::async_logger::backend_sink_it_(const details::log_msg &msg) { 61 | for (auto &sink : sinks_) { 62 | if (sink->should_log(msg.level)) { 63 | SPDLOG_TRY { sink->log(msg); } 64 | SPDLOG_LOGGER_CATCH(msg.source) 65 | } 66 | } 67 | 68 | if (should_flush_(msg)) { 69 | backend_flush_(); 70 | } 71 | } 72 | 73 | SPDLOG_INLINE void spdlog::async_logger::backend_flush_() { 74 | for (auto &sink : sinks_) { 75 | SPDLOG_TRY { sink->flush(); } 76 | SPDLOG_LOGGER_CATCH(source_loc()) 77 | } 78 | } 79 | 80 | SPDLOG_INLINE std::shared_ptr spdlog::async_logger::clone(std::string new_name) { 81 | auto cloned = std::make_shared(*this); 82 | cloned->name_ = std::move(new_name); 83 | return cloned; 84 | } 85 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/async_logger.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | // Fast asynchronous logger. 7 | // Uses pre allocated queue. 8 | // Creates a single back thread to pop messages from the queue and log them. 9 | // 10 | // Upon each log write the logger: 11 | // 1. Checks if its log level is enough to log the message 12 | // 2. Push a new copy of the message to a queue (or block the caller until 13 | // space is available in the queue) 14 | // Upon destruction, logs all remaining messages in the queue before 15 | // destructing.. 16 | 17 | #include 18 | 19 | namespace spdlog { 20 | 21 | // Async overflow policy - block by default. 22 | enum class async_overflow_policy { 23 | block, // Block until message can be enqueued 24 | overrun_oldest, // Discard oldest message in the queue if full when trying to 25 | // add new item. 26 | discard_new // Discard new message if the queue is full when trying to add new item. 27 | }; 28 | 29 | namespace details { 30 | class thread_pool; 31 | } 32 | 33 | class SPDLOG_API async_logger final : public std::enable_shared_from_this, 34 | public logger { 35 | friend class details::thread_pool; 36 | 37 | public: 38 | template 39 | async_logger(std::string logger_name, 40 | It begin, 41 | It end, 42 | std::weak_ptr tp, 43 | async_overflow_policy overflow_policy = async_overflow_policy::block) 44 | : logger(std::move(logger_name), begin, end), 45 | thread_pool_(std::move(tp)), 46 | overflow_policy_(overflow_policy) {} 47 | 48 | async_logger(std::string logger_name, 49 | sinks_init_list sinks_list, 50 | std::weak_ptr tp, 51 | async_overflow_policy overflow_policy = async_overflow_policy::block); 52 | 53 | async_logger(std::string logger_name, 54 | sink_ptr single_sink, 55 | std::weak_ptr tp, 56 | async_overflow_policy overflow_policy = async_overflow_policy::block); 57 | 58 | std::shared_ptr clone(std::string new_name) override; 59 | 60 | protected: 61 | void sink_it_(const details::log_msg &msg) override; 62 | void flush_() override; 63 | void backend_sink_it_(const details::log_msg &incoming_log_msg); 64 | void backend_flush_(); 65 | 66 | private: 67 | std::weak_ptr thread_pool_; 68 | async_overflow_policy overflow_policy_; 69 | }; 70 | } // namespace spdlog 71 | 72 | #ifdef SPDLOG_HEADER_ONLY 73 | #include "async_logger-inl.h" 74 | #endif 75 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/cfg/argv.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | #include 6 | #include 7 | 8 | // 9 | // Init log levels using each argv entry that starts with "SPDLOG_LEVEL=" 10 | // 11 | // set all loggers to debug level: 12 | // example.exe "SPDLOG_LEVEL=debug" 13 | 14 | // set logger1 to trace level 15 | // example.exe "SPDLOG_LEVEL=logger1=trace" 16 | 17 | // turn off all logging except for logger1 and logger2: 18 | // example.exe "SPDLOG_LEVEL=off,logger1=debug,logger2=info" 19 | 20 | namespace spdlog { 21 | namespace cfg { 22 | 23 | // search for SPDLOG_LEVEL= in the args and use it to init the levels 24 | inline void load_argv_levels(int argc, const char **argv) { 25 | const std::string spdlog_level_prefix = "SPDLOG_LEVEL="; 26 | for (int i = 1; i < argc; i++) { 27 | std::string arg = argv[i]; 28 | if (arg.find(spdlog_level_prefix) == 0) { 29 | auto levels_string = arg.substr(spdlog_level_prefix.size()); 30 | helpers::load_levels(levels_string); 31 | } 32 | } 33 | } 34 | 35 | inline void load_argv_levels(int argc, char **argv) { 36 | load_argv_levels(argc, const_cast(argv)); 37 | } 38 | 39 | } // namespace cfg 40 | } // namespace spdlog 41 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/cfg/env.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | #include 6 | #include 7 | #include 8 | 9 | // 10 | // Init levels and patterns from env variables SPDLOG_LEVEL 11 | // Inspired from Rust's "env_logger" crate (https://crates.io/crates/env_logger). 12 | // Note - fallback to "info" level on unrecognized levels 13 | // 14 | // Examples: 15 | // 16 | // set global level to debug: 17 | // export SPDLOG_LEVEL=debug 18 | // 19 | // turn off all logging except for logger1: 20 | // export SPDLOG_LEVEL="*=off,logger1=debug" 21 | // 22 | 23 | // turn off all logging except for logger1 and logger2: 24 | // export SPDLOG_LEVEL="off,logger1=debug,logger2=info" 25 | 26 | namespace spdlog { 27 | namespace cfg { 28 | inline void load_env_levels() { 29 | auto env_val = details::os::getenv("SPDLOG_LEVEL"); 30 | if (!env_val.empty()) { 31 | helpers::load_levels(env_val); 32 | } 33 | } 34 | 35 | } // namespace cfg 36 | } // namespace spdlog 37 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/cfg/helpers.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace cfg { 11 | namespace helpers { 12 | // 13 | // Init levels from given string 14 | // 15 | // Examples: 16 | // 17 | // set global level to debug: "debug" 18 | // turn off all logging except for logger1: "off,logger1=debug" 19 | // turn off all logging except for logger1 and logger2: "off,logger1=debug,logger2=info" 20 | // 21 | SPDLOG_API void load_levels(const std::string &txt); 22 | } // namespace helpers 23 | 24 | } // namespace cfg 25 | } // namespace spdlog 26 | 27 | #ifdef SPDLOG_HEADER_ONLY 28 | #include "helpers-inl.h" 29 | #endif // SPDLOG_HEADER_ONLY 30 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/common-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | namespace level { 15 | 16 | #if __cplusplus >= 201703L 17 | constexpr 18 | #endif 19 | static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES; 20 | 21 | static const char *short_level_names[] SPDLOG_SHORT_LEVEL_NAMES; 22 | 23 | SPDLOG_INLINE const string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT { 24 | return level_string_views[l]; 25 | } 26 | 27 | SPDLOG_INLINE const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT { 28 | return short_level_names[l]; 29 | } 30 | 31 | SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT { 32 | auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name); 33 | if (it != std::end(level_string_views)) 34 | return static_cast(std::distance(std::begin(level_string_views), it)); 35 | 36 | // check also for "warn" and "err" before giving up.. 37 | if (name == "warn") { 38 | return level::warn; 39 | } 40 | if (name == "err") { 41 | return level::err; 42 | } 43 | return level::off; 44 | } 45 | } // namespace level 46 | 47 | SPDLOG_INLINE spdlog_ex::spdlog_ex(std::string msg) 48 | : msg_(std::move(msg)) {} 49 | 50 | SPDLOG_INLINE spdlog_ex::spdlog_ex(const std::string &msg, int last_errno) { 51 | #ifdef SPDLOG_USE_STD_FORMAT 52 | msg_ = std::system_error(std::error_code(last_errno, std::generic_category()), msg).what(); 53 | #else 54 | memory_buf_t outbuf; 55 | fmt::format_system_error(outbuf, last_errno, msg.c_str()); 56 | msg_ = fmt::to_string(outbuf); 57 | #endif 58 | } 59 | 60 | SPDLOG_INLINE const char *spdlog_ex::what() const SPDLOG_NOEXCEPT { return msg_.c_str(); } 61 | 62 | SPDLOG_INLINE void throw_spdlog_ex(const std::string &msg, int last_errno) { 63 | SPDLOG_THROW(spdlog_ex(msg, last_errno)); 64 | } 65 | 66 | SPDLOG_INLINE void throw_spdlog_ex(std::string msg) { SPDLOG_THROW(spdlog_ex(std::move(msg))); } 67 | 68 | } // namespace spdlog 69 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/backtracer-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | namespace spdlog { 10 | namespace details { 11 | SPDLOG_INLINE backtracer::backtracer(const backtracer &other) { 12 | std::lock_guard lock(other.mutex_); 13 | enabled_ = other.enabled(); 14 | messages_ = other.messages_; 15 | } 16 | 17 | SPDLOG_INLINE backtracer::backtracer(backtracer &&other) SPDLOG_NOEXCEPT { 18 | std::lock_guard lock(other.mutex_); 19 | enabled_ = other.enabled(); 20 | messages_ = std::move(other.messages_); 21 | } 22 | 23 | SPDLOG_INLINE backtracer &backtracer::operator=(backtracer other) { 24 | std::lock_guard lock(mutex_); 25 | enabled_ = other.enabled(); 26 | messages_ = std::move(other.messages_); 27 | return *this; 28 | } 29 | 30 | SPDLOG_INLINE void backtracer::enable(size_t size) { 31 | std::lock_guard lock{mutex_}; 32 | enabled_.store(true, std::memory_order_relaxed); 33 | messages_ = circular_q{size}; 34 | } 35 | 36 | SPDLOG_INLINE void backtracer::disable() { 37 | std::lock_guard lock{mutex_}; 38 | enabled_.store(false, std::memory_order_relaxed); 39 | } 40 | 41 | SPDLOG_INLINE bool backtracer::enabled() const { return enabled_.load(std::memory_order_relaxed); } 42 | 43 | SPDLOG_INLINE void backtracer::push_back(const log_msg &msg) { 44 | std::lock_guard lock{mutex_}; 45 | messages_.push_back(log_msg_buffer{msg}); 46 | } 47 | 48 | SPDLOG_INLINE bool backtracer::empty() const { 49 | std::lock_guard lock{mutex_}; 50 | return messages_.empty(); 51 | } 52 | 53 | // pop all items in the q and apply the given fun on each of them. 54 | SPDLOG_INLINE void backtracer::foreach_pop(std::function fun) { 55 | std::lock_guard lock{mutex_}; 56 | while (!messages_.empty()) { 57 | auto &front_msg = messages_.front(); 58 | fun(front_msg); 59 | messages_.pop_front(); 60 | } 61 | } 62 | } // namespace details 63 | } // namespace spdlog 64 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/backtracer.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | // Store log messages in circular buffer. 14 | // Useful for storing debug data in case of error/warning happens. 15 | 16 | namespace spdlog { 17 | namespace details { 18 | class SPDLOG_API backtracer { 19 | mutable std::mutex mutex_; 20 | std::atomic enabled_{false}; 21 | circular_q messages_; 22 | 23 | public: 24 | backtracer() = default; 25 | backtracer(const backtracer &other); 26 | 27 | backtracer(backtracer &&other) SPDLOG_NOEXCEPT; 28 | backtracer &operator=(backtracer other); 29 | 30 | void enable(size_t size); 31 | void disable(); 32 | bool enabled() const; 33 | void push_back(const log_msg &msg); 34 | bool empty() const; 35 | 36 | // pop all items in the q and apply the given fun on each of them. 37 | void foreach_pop(std::function fun); 38 | }; 39 | 40 | } // namespace details 41 | } // namespace spdlog 42 | 43 | #ifdef SPDLOG_HEADER_ONLY 44 | #include "backtracer-inl.h" 45 | #endif 46 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/console_globals.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | 12 | struct console_mutex { 13 | using mutex_t = std::mutex; 14 | static mutex_t &mutex() { 15 | static mutex_t s_mutex; 16 | return s_mutex; 17 | } 18 | }; 19 | 20 | struct console_nullmutex { 21 | using mutex_t = null_mutex; 22 | static mutex_t &mutex() { 23 | static mutex_t s_mutex; 24 | return s_mutex; 25 | } 26 | }; 27 | } // namespace details 28 | } // namespace spdlog 29 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/file_helper.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | 12 | // Helper class for file sinks. 13 | // When failing to open a file, retry several times(5) with a delay interval(10 ms). 14 | // Throw spdlog_ex exception on errors. 15 | 16 | class SPDLOG_API file_helper { 17 | public: 18 | file_helper() = default; 19 | explicit file_helper(const file_event_handlers &event_handlers); 20 | 21 | file_helper(const file_helper &) = delete; 22 | file_helper &operator=(const file_helper &) = delete; 23 | ~file_helper(); 24 | 25 | void open(const filename_t &fname, bool truncate = false); 26 | void reopen(bool truncate); 27 | void flush(); 28 | void sync(); 29 | void close(); 30 | void write(const memory_buf_t &buf); 31 | size_t size() const; 32 | const filename_t &filename() const; 33 | 34 | // 35 | // return file path and its extension: 36 | // 37 | // "mylog.txt" => ("mylog", ".txt") 38 | // "mylog" => ("mylog", "") 39 | // "mylog." => ("mylog.", "") 40 | // "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt") 41 | // 42 | // the starting dot in filenames is ignored (hidden files): 43 | // 44 | // ".mylog" => (".mylog". "") 45 | // "my_folder/.mylog" => ("my_folder/.mylog", "") 46 | // "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt") 47 | static std::tuple split_by_extension(const filename_t &fname); 48 | 49 | private: 50 | const int open_tries_ = 5; 51 | const unsigned int open_interval_ = 10; 52 | std::FILE *fd_{nullptr}; 53 | filename_t filename_; 54 | file_event_handlers event_handlers_; 55 | }; 56 | } // namespace details 57 | } // namespace spdlog 58 | 59 | #ifdef SPDLOG_HEADER_ONLY 60 | #include "file_helper-inl.h" 61 | #endif 62 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/log_msg-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | namespace spdlog { 13 | namespace details { 14 | 15 | SPDLOG_INLINE log_msg::log_msg(spdlog::log_clock::time_point log_time, 16 | spdlog::source_loc loc, 17 | string_view_t a_logger_name, 18 | spdlog::level::level_enum lvl, 19 | spdlog::string_view_t msg) 20 | : logger_name(a_logger_name), 21 | level(lvl), 22 | time(log_time) 23 | #ifndef SPDLOG_NO_THREAD_ID 24 | , 25 | thread_id(os::thread_id()) 26 | #endif 27 | , 28 | source(loc), 29 | payload(msg) { 30 | } 31 | 32 | SPDLOG_INLINE log_msg::log_msg(spdlog::source_loc loc, 33 | string_view_t a_logger_name, 34 | spdlog::level::level_enum lvl, 35 | spdlog::string_view_t msg) 36 | : log_msg(os::now(), loc, a_logger_name, lvl, msg) {} 37 | 38 | SPDLOG_INLINE log_msg::log_msg(string_view_t a_logger_name, 39 | spdlog::level::level_enum lvl, 40 | spdlog::string_view_t msg) 41 | : log_msg(os::now(), source_loc{}, a_logger_name, lvl, msg) {} 42 | 43 | } // namespace details 44 | } // namespace spdlog 45 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/log_msg.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | struct SPDLOG_API log_msg { 12 | log_msg() = default; 13 | log_msg(log_clock::time_point log_time, 14 | source_loc loc, 15 | string_view_t logger_name, 16 | level::level_enum lvl, 17 | string_view_t msg); 18 | log_msg(source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg); 19 | log_msg(string_view_t logger_name, level::level_enum lvl, string_view_t msg); 20 | log_msg(const log_msg &other) = default; 21 | log_msg &operator=(const log_msg &other) = default; 22 | 23 | string_view_t logger_name; 24 | level::level_enum level{level::off}; 25 | log_clock::time_point time; 26 | size_t thread_id{0}; 27 | 28 | // wrapping the formatted text with color (updated by pattern_formatter). 29 | mutable size_t color_range_start{0}; 30 | mutable size_t color_range_end{0}; 31 | 32 | source_loc source; 33 | string_view_t payload; 34 | }; 35 | } // namespace details 36 | } // namespace spdlog 37 | 38 | #ifdef SPDLOG_HEADER_ONLY 39 | #include "log_msg-inl.h" 40 | #endif 41 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/log_msg_buffer-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | namespace spdlog { 11 | namespace details { 12 | 13 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg &orig_msg) 14 | : log_msg{orig_msg} { 15 | buffer.append(logger_name.begin(), logger_name.end()); 16 | buffer.append(payload.begin(), payload.end()); 17 | update_string_views(); 18 | } 19 | 20 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg_buffer &other) 21 | : log_msg{other} { 22 | buffer.append(logger_name.begin(), logger_name.end()); 23 | buffer.append(payload.begin(), payload.end()); 24 | update_string_views(); 25 | } 26 | 27 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT 28 | : log_msg{other}, 29 | buffer{std::move(other.buffer)} { 30 | update_string_views(); 31 | } 32 | 33 | SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(const log_msg_buffer &other) { 34 | log_msg::operator=(other); 35 | buffer.clear(); 36 | buffer.append(other.buffer.data(), other.buffer.data() + other.buffer.size()); 37 | update_string_views(); 38 | return *this; 39 | } 40 | 41 | SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT { 42 | log_msg::operator=(other); 43 | buffer = std::move(other.buffer); 44 | update_string_views(); 45 | return *this; 46 | } 47 | 48 | SPDLOG_INLINE void log_msg_buffer::update_string_views() { 49 | logger_name = string_view_t{buffer.data(), logger_name.size()}; 50 | payload = string_view_t{buffer.data() + logger_name.size(), payload.size()}; 51 | } 52 | 53 | } // namespace details 54 | } // namespace spdlog 55 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/log_msg_buffer.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | namespace spdlog { 9 | namespace details { 10 | 11 | // Extend log_msg with internal buffer to store its payload. 12 | // This is needed since log_msg holds string_views that points to stack data. 13 | 14 | class SPDLOG_API log_msg_buffer : public log_msg { 15 | memory_buf_t buffer; 16 | void update_string_views(); 17 | 18 | public: 19 | log_msg_buffer() = default; 20 | explicit log_msg_buffer(const log_msg &orig_msg); 21 | log_msg_buffer(const log_msg_buffer &other); 22 | log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT; 23 | log_msg_buffer &operator=(const log_msg_buffer &other); 24 | log_msg_buffer &operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT; 25 | }; 26 | 27 | } // namespace details 28 | } // namespace spdlog 29 | 30 | #ifdef SPDLOG_HEADER_ONLY 31 | #include "log_msg_buffer-inl.h" 32 | #endif 33 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/null_mutex.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | // null, no cost dummy "mutex" and dummy "atomic" int 9 | 10 | namespace spdlog { 11 | namespace details { 12 | struct null_mutex { 13 | void lock() const {} 14 | void unlock() const {} 15 | }; 16 | 17 | struct null_atomic_int { 18 | int value; 19 | null_atomic_int() = default; 20 | 21 | explicit null_atomic_int(int new_value) 22 | : value(new_value) {} 23 | 24 | int load(std::memory_order = std::memory_order_relaxed) const { return value; } 25 | 26 | void store(int new_value, std::memory_order = std::memory_order_relaxed) { value = new_value; } 27 | 28 | int exchange(int new_value, std::memory_order = std::memory_order_relaxed) { 29 | std::swap(new_value, value); 30 | return new_value; // return value before the call 31 | } 32 | }; 33 | 34 | } // namespace details 35 | } // namespace spdlog 36 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/periodic_worker-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | namespace spdlog { 11 | namespace details { 12 | 13 | // stop the worker thread and join it 14 | SPDLOG_INLINE periodic_worker::~periodic_worker() { 15 | if (worker_thread_.joinable()) { 16 | { 17 | std::lock_guard lock(mutex_); 18 | active_ = false; 19 | } 20 | cv_.notify_one(); 21 | worker_thread_.join(); 22 | } 23 | } 24 | 25 | } // namespace details 26 | } // namespace spdlog 27 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/periodic_worker.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | // periodic worker thread - periodically executes the given callback function. 7 | // 8 | // RAII over the owned thread: 9 | // creates the thread on construction. 10 | // stops and joins the thread on destruction (if the thread is executing a callback, wait for it 11 | // to finish first). 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | namespace spdlog { 19 | namespace details { 20 | 21 | class SPDLOG_API periodic_worker { 22 | public: 23 | template 24 | periodic_worker(const std::function &callback_fun, 25 | std::chrono::duration interval) { 26 | active_ = (interval > std::chrono::duration::zero()); 27 | if (!active_) { 28 | return; 29 | } 30 | 31 | worker_thread_ = std::thread([this, callback_fun, interval]() { 32 | for (;;) { 33 | std::unique_lock lock(this->mutex_); 34 | if (this->cv_.wait_for(lock, interval, [this] { return !this->active_; })) { 35 | return; // active_ == false, so exit this thread 36 | } 37 | callback_fun(); 38 | } 39 | }); 40 | } 41 | periodic_worker(const periodic_worker &) = delete; 42 | periodic_worker &operator=(const periodic_worker &) = delete; 43 | // stop the worker thread and join it 44 | ~periodic_worker(); 45 | 46 | private: 47 | bool active_; 48 | std::thread worker_thread_; 49 | std::mutex mutex_; 50 | std::condition_variable cv_; 51 | }; 52 | } // namespace details 53 | } // namespace spdlog 54 | 55 | #ifdef SPDLOG_HEADER_ONLY 56 | #include "periodic_worker-inl.h" 57 | #endif 58 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/synchronous_factory.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include "registry.h" 7 | 8 | namespace spdlog { 9 | 10 | // Default logger factory- creates synchronous loggers 11 | class logger; 12 | 13 | struct synchronous_factory { 14 | template 15 | static std::shared_ptr create(std::string logger_name, SinkArgs &&...args) { 16 | auto sink = std::make_shared(std::forward(args)...); 17 | auto new_logger = std::make_shared(std::move(logger_name), std::move(sink)); 18 | details::registry::instance().initialize_logger(new_logger); 19 | return new_logger; 20 | } 21 | }; 22 | } // namespace spdlog 23 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/udp_client.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | // Helper RAII over unix udp client socket. 7 | // Will throw on construction if the socket creation failed. 8 | 9 | #ifdef _WIN32 10 | #error "include udp_client-windows.h instead" 11 | #endif 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | namespace spdlog { 26 | namespace details { 27 | 28 | class udp_client { 29 | static constexpr int TX_BUFFER_SIZE = 1024 * 10; 30 | int socket_ = -1; 31 | struct sockaddr_in sockAddr_; 32 | 33 | void cleanup_() { 34 | if (socket_ != -1) { 35 | ::close(socket_); 36 | socket_ = -1; 37 | } 38 | } 39 | 40 | public: 41 | udp_client(const std::string &host, uint16_t port) { 42 | socket_ = ::socket(PF_INET, SOCK_DGRAM, 0); 43 | if (socket_ < 0) { 44 | throw_spdlog_ex("error: Create Socket Failed!"); 45 | } 46 | 47 | int option_value = TX_BUFFER_SIZE; 48 | if (::setsockopt(socket_, SOL_SOCKET, SO_SNDBUF, 49 | reinterpret_cast(&option_value), sizeof(option_value)) < 0) { 50 | cleanup_(); 51 | throw_spdlog_ex("error: setsockopt(SO_SNDBUF) Failed!"); 52 | } 53 | 54 | sockAddr_.sin_family = AF_INET; 55 | sockAddr_.sin_port = htons(port); 56 | 57 | if (::inet_aton(host.c_str(), &sockAddr_.sin_addr) == 0) { 58 | cleanup_(); 59 | throw_spdlog_ex("error: Invalid address!"); 60 | } 61 | 62 | ::memset(sockAddr_.sin_zero, 0x00, sizeof(sockAddr_.sin_zero)); 63 | } 64 | 65 | ~udp_client() { cleanup_(); } 66 | 67 | int fd() const { return socket_; } 68 | 69 | // Send exactly n_bytes of the given data. 70 | // On error close the connection and throw. 71 | void send(const char *data, size_t n_bytes) { 72 | ssize_t toslen = 0; 73 | socklen_t tolen = sizeof(struct sockaddr); 74 | if ((toslen = ::sendto(socket_, data, n_bytes, 0, (struct sockaddr *)&sockAddr_, tolen)) == 75 | -1) { 76 | throw_spdlog_ex("sendto(2) failed", errno); 77 | } 78 | } 79 | }; 80 | } // namespace details 81 | } // namespace spdlog 82 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/details/windows_include.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef NOMINMAX 4 | #define NOMINMAX // prevent windows redefining min/max 5 | #endif 6 | 7 | #ifndef WIN32_LEAN_AND_MEAN 8 | #define WIN32_LEAN_AND_MEAN 9 | #endif 10 | 11 | #include 12 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/fmt/bundled/fmt.license.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - present, Victor Zverovich 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | --- Optional exception to the license --- 23 | 24 | As an exception, if, as a result of your compiling your source code, portions 25 | of this Software are embedded into a machine-executable object form of such 26 | source code, you may redistribute such embedded portions in such object form 27 | without including the above copyright and permission notices. 28 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/fmt/bundled/locale.h: -------------------------------------------------------------------------------- 1 | #include "xchar.h" 2 | #warning fmt/locale.h is deprecated, include fmt/format.h or fmt/xchar.h instead 3 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/fmt/chrono.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's chrono support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/fmt/compile.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's compile-time support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/fmt/fmt.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016-2018 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | // 9 | // Include a bundled header-only copy of fmtlib or an external one. 10 | // By default spdlog include its own copy. 11 | // 12 | #include 13 | 14 | #if defined(SPDLOG_USE_STD_FORMAT) // SPDLOG_USE_STD_FORMAT is defined - use std::format 15 | #include 16 | #elif !defined(SPDLOG_FMT_EXTERNAL) 17 | #if !defined(SPDLOG_COMPILED_LIB) && !defined(FMT_HEADER_ONLY) 18 | #define FMT_HEADER_ONLY 19 | #endif 20 | #ifndef FMT_USE_WINDOWS_H 21 | #define FMT_USE_WINDOWS_H 0 22 | #endif 23 | // enable the 'n' flag in for backward compatibility with fmt 6.x 24 | #define FMT_DEPRECATED_N_SPECIFIER 25 | // enable ostream formatting for backward compatibility with fmt 8.x 26 | #define FMT_DEPRECATED_OSTREAM 27 | 28 | #include 29 | #include 30 | 31 | #else // SPDLOG_FMT_EXTERNAL is defined - use external fmtlib 32 | #include 33 | #include 34 | #endif 35 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/fmt/ostr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's ostream support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/fmt/ranges.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's ranges support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/fmt/std.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's std support (for formatting e.g. 9 | // std::filesystem::path, std::thread::id, std::monostate, std::variant, ...) 10 | // 11 | #include 12 | 13 | #if !defined(SPDLOG_USE_STD_FORMAT) 14 | #if !defined(SPDLOG_FMT_EXTERNAL) 15 | #ifdef SPDLOG_HEADER_ONLY 16 | #ifndef FMT_HEADER_ONLY 17 | #define FMT_HEADER_ONLY 18 | #endif 19 | #endif 20 | #include 21 | #else 22 | #include 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/fmt/xchar.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's xchar support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/formatter.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | 11 | class formatter { 12 | public: 13 | virtual ~formatter() = default; 14 | virtual void format(const details::log_msg &msg, memory_buf_t &dest) = 0; 15 | virtual std::unique_ptr clone() const = 0; 16 | }; 17 | } // namespace spdlog 18 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/fwd.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | namespace spdlog { 7 | class logger; 8 | class formatter; 9 | 10 | namespace sinks { 11 | class sink; 12 | } 13 | 14 | namespace level { 15 | enum level_enum : int; 16 | } 17 | 18 | } // namespace spdlog 19 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/base_sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | template 17 | SPDLOG_INLINE spdlog::sinks::base_sink::base_sink() 18 | : formatter_{details::make_unique()} {} 19 | 20 | template 21 | SPDLOG_INLINE spdlog::sinks::base_sink::base_sink( 22 | std::unique_ptr formatter) 23 | : formatter_{std::move(formatter)} {} 24 | 25 | template 26 | void SPDLOG_INLINE spdlog::sinks::base_sink::log(const details::log_msg &msg) { 27 | std::lock_guard lock(mutex_); 28 | sink_it_(msg); 29 | } 30 | 31 | template 32 | void SPDLOG_INLINE spdlog::sinks::base_sink::flush() { 33 | std::lock_guard lock(mutex_); 34 | flush_(); 35 | } 36 | 37 | template 38 | void SPDLOG_INLINE spdlog::sinks::base_sink::set_pattern(const std::string &pattern) { 39 | std::lock_guard lock(mutex_); 40 | set_pattern_(pattern); 41 | } 42 | 43 | template 44 | void SPDLOG_INLINE 45 | spdlog::sinks::base_sink::set_formatter(std::unique_ptr sink_formatter) { 46 | std::lock_guard lock(mutex_); 47 | set_formatter_(std::move(sink_formatter)); 48 | } 49 | 50 | template 51 | void SPDLOG_INLINE spdlog::sinks::base_sink::set_pattern_(const std::string &pattern) { 52 | set_formatter_(details::make_unique(pattern)); 53 | } 54 | 55 | template 56 | void SPDLOG_INLINE 57 | spdlog::sinks::base_sink::set_formatter_(std::unique_ptr sink_formatter) { 58 | formatter_ = std::move(sink_formatter); 59 | } 60 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/base_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | // 6 | // base sink templated over a mutex (either dummy or real) 7 | // concrete implementation should override the sink_it_() and flush_() methods. 8 | // locking is taken care of in this class - no locking needed by the 9 | // implementers.. 10 | // 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | namespace spdlog { 17 | namespace sinks { 18 | template 19 | class SPDLOG_API base_sink : public sink { 20 | public: 21 | base_sink(); 22 | explicit base_sink(std::unique_ptr formatter); 23 | ~base_sink() override = default; 24 | 25 | base_sink(const base_sink &) = delete; 26 | base_sink(base_sink &&) = delete; 27 | 28 | base_sink &operator=(const base_sink &) = delete; 29 | base_sink &operator=(base_sink &&) = delete; 30 | 31 | void log(const details::log_msg &msg) final; 32 | void flush() final; 33 | void set_pattern(const std::string &pattern) final; 34 | void set_formatter(std::unique_ptr sink_formatter) final; 35 | 36 | protected: 37 | // sink formatter 38 | std::unique_ptr formatter_; 39 | Mutex mutex_; 40 | 41 | virtual void sink_it_(const details::log_msg &msg) = 0; 42 | virtual void flush_() = 0; 43 | virtual void set_pattern_(const std::string &pattern); 44 | virtual void set_formatter_(std::unique_ptr sink_formatter); 45 | }; 46 | } // namespace sinks 47 | } // namespace spdlog 48 | 49 | #ifdef SPDLOG_HEADER_ONLY 50 | #include "base_sink-inl.h" 51 | #endif 52 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/basic_file_sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | namespace sinks { 15 | 16 | template 17 | SPDLOG_INLINE basic_file_sink::basic_file_sink(const filename_t &filename, 18 | bool truncate, 19 | const file_event_handlers &event_handlers) 20 | : file_helper_{event_handlers} { 21 | file_helper_.open(filename, truncate); 22 | } 23 | 24 | template 25 | SPDLOG_INLINE const filename_t &basic_file_sink::filename() const { 26 | return file_helper_.filename(); 27 | } 28 | 29 | template 30 | SPDLOG_INLINE void basic_file_sink::sink_it_(const details::log_msg &msg) { 31 | memory_buf_t formatted; 32 | base_sink::formatter_->format(msg, formatted); 33 | file_helper_.write(formatted); 34 | } 35 | 36 | template 37 | SPDLOG_INLINE void basic_file_sink::flush_() { 38 | file_helper_.flush(); 39 | } 40 | 41 | } // namespace sinks 42 | } // namespace spdlog 43 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/basic_file_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | namespace spdlog { 15 | namespace sinks { 16 | /* 17 | * Trivial file sink with single file as target 18 | */ 19 | template 20 | class basic_file_sink final : public base_sink { 21 | public: 22 | explicit basic_file_sink(const filename_t &filename, 23 | bool truncate = false, 24 | const file_event_handlers &event_handlers = {}); 25 | const filename_t &filename() const; 26 | 27 | protected: 28 | void sink_it_(const details::log_msg &msg) override; 29 | void flush_() override; 30 | 31 | private: 32 | details::file_helper file_helper_; 33 | }; 34 | 35 | using basic_file_sink_mt = basic_file_sink; 36 | using basic_file_sink_st = basic_file_sink; 37 | 38 | } // namespace sinks 39 | 40 | // 41 | // factory functions 42 | // 43 | template 44 | inline std::shared_ptr basic_logger_mt(const std::string &logger_name, 45 | const filename_t &filename, 46 | bool truncate = false, 47 | const file_event_handlers &event_handlers = {}) { 48 | return Factory::template create(logger_name, filename, truncate, 49 | event_handlers); 50 | } 51 | 52 | template 53 | inline std::shared_ptr basic_logger_st(const std::string &logger_name, 54 | const filename_t &filename, 55 | bool truncate = false, 56 | const file_event_handlers &event_handlers = {}) { 57 | return Factory::template create(logger_name, filename, truncate, 58 | event_handlers); 59 | } 60 | 61 | } // namespace spdlog 62 | 63 | #ifdef SPDLOG_HEADER_ONLY 64 | #include "basic_file_sink-inl.h" 65 | #endif 66 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/callback_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | 15 | // callbacks type 16 | typedef std::function custom_log_callback; 17 | 18 | namespace sinks { 19 | /* 20 | * Trivial callback sink, gets a callback function and calls it on each log 21 | */ 22 | template 23 | class callback_sink final : public base_sink { 24 | public: 25 | explicit callback_sink(const custom_log_callback &callback) 26 | : callback_{callback} {} 27 | 28 | protected: 29 | void sink_it_(const details::log_msg &msg) override { callback_(msg); } 30 | void flush_() override{}; 31 | 32 | private: 33 | custom_log_callback callback_; 34 | }; 35 | 36 | using callback_sink_mt = callback_sink; 37 | using callback_sink_st = callback_sink; 38 | 39 | } // namespace sinks 40 | 41 | // 42 | // factory functions 43 | // 44 | template 45 | inline std::shared_ptr callback_logger_mt(const std::string &logger_name, 46 | const custom_log_callback &callback) { 47 | return Factory::template create(logger_name, callback); 48 | } 49 | 50 | template 51 | inline std::shared_ptr callback_logger_st(const std::string &logger_name, 52 | const custom_log_callback &callback) { 53 | return Factory::template create(logger_name, callback); 54 | } 55 | 56 | } // namespace spdlog 57 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/dist_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include "base_sink.h" 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | // Distribution sink (mux). Stores a vector of sinks which get called when log 17 | // is called 18 | 19 | namespace spdlog { 20 | namespace sinks { 21 | 22 | template 23 | class dist_sink : public base_sink { 24 | public: 25 | dist_sink() = default; 26 | explicit dist_sink(std::vector> sinks) 27 | : sinks_(sinks) {} 28 | 29 | dist_sink(const dist_sink &) = delete; 30 | dist_sink &operator=(const dist_sink &) = delete; 31 | 32 | void add_sink(std::shared_ptr sub_sink) { 33 | std::lock_guard lock(base_sink::mutex_); 34 | sinks_.push_back(sub_sink); 35 | } 36 | 37 | void remove_sink(std::shared_ptr sub_sink) { 38 | std::lock_guard lock(base_sink::mutex_); 39 | sinks_.erase(std::remove(sinks_.begin(), sinks_.end(), sub_sink), sinks_.end()); 40 | } 41 | 42 | void set_sinks(std::vector> sinks) { 43 | std::lock_guard lock(base_sink::mutex_); 44 | sinks_ = std::move(sinks); 45 | } 46 | 47 | std::vector> &sinks() { return sinks_; } 48 | 49 | protected: 50 | void sink_it_(const details::log_msg &msg) override { 51 | for (auto &sub_sink : sinks_) { 52 | if (sub_sink->should_log(msg.level)) { 53 | sub_sink->log(msg); 54 | } 55 | } 56 | } 57 | 58 | void flush_() override { 59 | for (auto &sub_sink : sinks_) { 60 | sub_sink->flush(); 61 | } 62 | } 63 | 64 | void set_pattern_(const std::string &pattern) override { 65 | set_formatter_(details::make_unique(pattern)); 66 | } 67 | 68 | void set_formatter_(std::unique_ptr sink_formatter) override { 69 | base_sink::formatter_ = std::move(sink_formatter); 70 | for (auto &sub_sink : sinks_) { 71 | sub_sink->set_formatter(base_sink::formatter_->clone()); 72 | } 73 | } 74 | std::vector> sinks_; 75 | }; 76 | 77 | using dist_sink_mt = dist_sink; 78 | using dist_sink_st = dist_sink; 79 | 80 | } // namespace sinks 81 | } // namespace spdlog 82 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/msvc_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2016 Alexander Dalshov & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #if defined(_WIN32) 7 | 8 | #include 9 | #if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) 10 | #include 11 | #endif 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | // Avoid including windows.h (https://stackoverflow.com/a/30741042) 18 | #if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) 19 | extern "C" __declspec(dllimport) void __stdcall OutputDebugStringW(const wchar_t *lpOutputString); 20 | #else 21 | extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char *lpOutputString); 22 | #endif 23 | extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); 24 | 25 | namespace spdlog { 26 | namespace sinks { 27 | /* 28 | * MSVC sink (logging using OutputDebugStringA) 29 | */ 30 | template 31 | class msvc_sink : public base_sink { 32 | public: 33 | msvc_sink() = default; 34 | msvc_sink(bool check_debugger_present) 35 | : check_debugger_present_{check_debugger_present} {}; 36 | 37 | protected: 38 | void sink_it_(const details::log_msg &msg) override { 39 | if (check_debugger_present_ && !IsDebuggerPresent()) { 40 | return; 41 | } 42 | memory_buf_t formatted; 43 | base_sink::formatter_->format(msg, formatted); 44 | formatted.push_back('\0'); // add a null terminator for OutputDebugString 45 | #if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) 46 | wmemory_buf_t wformatted; 47 | details::os::utf8_to_wstrbuf(string_view_t(formatted.data(), formatted.size()), wformatted); 48 | OutputDebugStringW(wformatted.data()); 49 | #else 50 | OutputDebugStringA(formatted.data()); 51 | #endif 52 | } 53 | 54 | void flush_() override {} 55 | 56 | bool check_debugger_present_ = true; 57 | }; 58 | 59 | using msvc_sink_mt = msvc_sink; 60 | using msvc_sink_st = msvc_sink; 61 | 62 | using windebug_sink_mt = msvc_sink_mt; 63 | using windebug_sink_st = msvc_sink_st; 64 | 65 | } // namespace sinks 66 | } // namespace spdlog 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/null_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | namespace spdlog { 13 | namespace sinks { 14 | 15 | template 16 | class null_sink : public base_sink { 17 | protected: 18 | void sink_it_(const details::log_msg &) override {} 19 | void flush_() override {} 20 | }; 21 | 22 | using null_sink_mt = null_sink; 23 | using null_sink_st = null_sink; 24 | 25 | } // namespace sinks 26 | 27 | template 28 | inline std::shared_ptr null_logger_mt(const std::string &logger_name) { 29 | auto null_logger = Factory::template create(logger_name); 30 | null_logger->set_level(level::off); 31 | return null_logger; 32 | } 33 | 34 | template 35 | inline std::shared_ptr null_logger_st(const std::string &logger_name) { 36 | auto null_logger = Factory::template create(logger_name); 37 | null_logger->set_level(level::off); 38 | return null_logger; 39 | } 40 | 41 | } // namespace spdlog 42 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/ostream_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | namespace spdlog { 13 | namespace sinks { 14 | template 15 | class ostream_sink final : public base_sink { 16 | public: 17 | explicit ostream_sink(std::ostream &os, bool force_flush = false) 18 | : ostream_(os), 19 | force_flush_(force_flush) {} 20 | ostream_sink(const ostream_sink &) = delete; 21 | ostream_sink &operator=(const ostream_sink &) = delete; 22 | 23 | protected: 24 | void sink_it_(const details::log_msg &msg) override { 25 | memory_buf_t formatted; 26 | base_sink::formatter_->format(msg, formatted); 27 | ostream_.write(formatted.data(), static_cast(formatted.size())); 28 | if (force_flush_) { 29 | ostream_.flush(); 30 | } 31 | } 32 | 33 | void flush_() override { ostream_.flush(); } 34 | 35 | std::ostream &ostream_; 36 | bool force_flush_; 37 | }; 38 | 39 | using ostream_sink_mt = ostream_sink; 40 | using ostream_sink_st = ostream_sink; 41 | 42 | } // namespace sinks 43 | } // namespace spdlog 44 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/ringbuffer_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include "spdlog/details/circular_q.h" 7 | #include "spdlog/details/log_msg_buffer.h" 8 | #include "spdlog/details/null_mutex.h" 9 | #include "spdlog/sinks/base_sink.h" 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace spdlog { 16 | namespace sinks { 17 | /* 18 | * Ring buffer sink 19 | */ 20 | template 21 | class ringbuffer_sink final : public base_sink { 22 | public: 23 | explicit ringbuffer_sink(size_t n_items) 24 | : q_{n_items} {} 25 | 26 | std::vector last_raw(size_t lim = 0) { 27 | std::lock_guard lock(base_sink::mutex_); 28 | auto items_available = q_.size(); 29 | auto n_items = lim > 0 ? (std::min)(lim, items_available) : items_available; 30 | std::vector ret; 31 | ret.reserve(n_items); 32 | for (size_t i = (items_available - n_items); i < items_available; i++) { 33 | ret.push_back(q_.at(i)); 34 | } 35 | return ret; 36 | } 37 | 38 | std::vector last_formatted(size_t lim = 0) { 39 | std::lock_guard lock(base_sink::mutex_); 40 | auto items_available = q_.size(); 41 | auto n_items = lim > 0 ? (std::min)(lim, items_available) : items_available; 42 | std::vector ret; 43 | ret.reserve(n_items); 44 | for (size_t i = (items_available - n_items); i < items_available; i++) { 45 | memory_buf_t formatted; 46 | base_sink::formatter_->format(q_.at(i), formatted); 47 | ret.push_back(SPDLOG_BUF_TO_STRING(formatted)); 48 | } 49 | return ret; 50 | } 51 | 52 | protected: 53 | void sink_it_(const details::log_msg &msg) override { 54 | q_.push_back(details::log_msg_buffer{msg}); 55 | } 56 | void flush_() override {} 57 | 58 | private: 59 | details::circular_q q_; 60 | }; 61 | 62 | using ringbuffer_sink_mt = ringbuffer_sink; 63 | using ringbuffer_sink_st = ringbuffer_sink; 64 | 65 | } // namespace sinks 66 | 67 | } // namespace spdlog 68 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | SPDLOG_INLINE bool spdlog::sinks::sink::should_log(spdlog::level::level_enum msg_level) const { 13 | return msg_level >= level_.load(std::memory_order_relaxed); 14 | } 15 | 16 | SPDLOG_INLINE void spdlog::sinks::sink::set_level(level::level_enum log_level) { 17 | level_.store(log_level, std::memory_order_relaxed); 18 | } 19 | 20 | SPDLOG_INLINE spdlog::level::level_enum spdlog::sinks::sink::level() const { 21 | return static_cast(level_.load(std::memory_order_relaxed)); 22 | } 23 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | 11 | namespace sinks { 12 | class SPDLOG_API sink { 13 | public: 14 | virtual ~sink() = default; 15 | virtual void log(const details::log_msg &msg) = 0; 16 | virtual void flush() = 0; 17 | virtual void set_pattern(const std::string &pattern) = 0; 18 | virtual void set_formatter(std::unique_ptr sink_formatter) = 0; 19 | 20 | void set_level(level::level_enum log_level); 21 | level::level_enum level() const; 22 | bool should_log(level::level_enum msg_level) const; 23 | 24 | protected: 25 | // sink log level - default is all 26 | level_t level_{level::trace}; 27 | }; 28 | 29 | } // namespace sinks 30 | } // namespace spdlog 31 | 32 | #ifdef SPDLOG_HEADER_ONLY 33 | #include "sink-inl.h" 34 | #endif 35 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/stdout_color_sinks-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | 15 | template 16 | SPDLOG_INLINE std::shared_ptr stdout_color_mt(const std::string &logger_name, 17 | color_mode mode) { 18 | return Factory::template create(logger_name, mode); 19 | } 20 | 21 | template 22 | SPDLOG_INLINE std::shared_ptr stdout_color_st(const std::string &logger_name, 23 | color_mode mode) { 24 | return Factory::template create(logger_name, mode); 25 | } 26 | 27 | template 28 | SPDLOG_INLINE std::shared_ptr stderr_color_mt(const std::string &logger_name, 29 | color_mode mode) { 30 | return Factory::template create(logger_name, mode); 31 | } 32 | 33 | template 34 | SPDLOG_INLINE std::shared_ptr stderr_color_st(const std::string &logger_name, 35 | color_mode mode) { 36 | return Factory::template create(logger_name, mode); 37 | } 38 | } // namespace spdlog 39 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/stdout_color_sinks.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifdef _WIN32 7 | #include 8 | #else 9 | #include 10 | #endif 11 | 12 | #include 13 | 14 | namespace spdlog { 15 | namespace sinks { 16 | #ifdef _WIN32 17 | using stdout_color_sink_mt = wincolor_stdout_sink_mt; 18 | using stdout_color_sink_st = wincolor_stdout_sink_st; 19 | using stderr_color_sink_mt = wincolor_stderr_sink_mt; 20 | using stderr_color_sink_st = wincolor_stderr_sink_st; 21 | #else 22 | using stdout_color_sink_mt = ansicolor_stdout_sink_mt; 23 | using stdout_color_sink_st = ansicolor_stdout_sink_st; 24 | using stderr_color_sink_mt = ansicolor_stderr_sink_mt; 25 | using stderr_color_sink_st = ansicolor_stderr_sink_st; 26 | #endif 27 | } // namespace sinks 28 | 29 | template 30 | std::shared_ptr stdout_color_mt(const std::string &logger_name, 31 | color_mode mode = color_mode::automatic); 32 | 33 | template 34 | std::shared_ptr stdout_color_st(const std::string &logger_name, 35 | color_mode mode = color_mode::automatic); 36 | 37 | template 38 | std::shared_ptr stderr_color_mt(const std::string &logger_name, 39 | color_mode mode = color_mode::automatic); 40 | 41 | template 42 | std::shared_ptr stderr_color_st(const std::string &logger_name, 43 | color_mode mode = color_mode::automatic); 44 | 45 | } // namespace spdlog 46 | 47 | #ifdef SPDLOG_HEADER_ONLY 48 | #include "stdout_color_sinks-inl.h" 49 | #endif 50 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/stdout_sinks.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #ifdef _WIN32 12 | #include 13 | #endif 14 | 15 | namespace spdlog { 16 | 17 | namespace sinks { 18 | 19 | template 20 | class stdout_sink_base : public sink { 21 | public: 22 | using mutex_t = typename ConsoleMutex::mutex_t; 23 | explicit stdout_sink_base(FILE *file); 24 | ~stdout_sink_base() override = default; 25 | 26 | stdout_sink_base(const stdout_sink_base &other) = delete; 27 | stdout_sink_base(stdout_sink_base &&other) = delete; 28 | 29 | stdout_sink_base &operator=(const stdout_sink_base &other) = delete; 30 | stdout_sink_base &operator=(stdout_sink_base &&other) = delete; 31 | 32 | void log(const details::log_msg &msg) override; 33 | void flush() override; 34 | void set_pattern(const std::string &pattern) override; 35 | 36 | void set_formatter(std::unique_ptr sink_formatter) override; 37 | 38 | protected: 39 | mutex_t &mutex_; 40 | FILE *file_; 41 | std::unique_ptr formatter_; 42 | #ifdef _WIN32 43 | HANDLE handle_; 44 | #endif // WIN32 45 | }; 46 | 47 | template 48 | class stdout_sink : public stdout_sink_base { 49 | public: 50 | stdout_sink(); 51 | }; 52 | 53 | template 54 | class stderr_sink : public stdout_sink_base { 55 | public: 56 | stderr_sink(); 57 | }; 58 | 59 | using stdout_sink_mt = stdout_sink; 60 | using stdout_sink_st = stdout_sink; 61 | 62 | using stderr_sink_mt = stderr_sink; 63 | using stderr_sink_st = stderr_sink; 64 | 65 | } // namespace sinks 66 | 67 | // factory methods 68 | template 69 | std::shared_ptr stdout_logger_mt(const std::string &logger_name); 70 | 71 | template 72 | std::shared_ptr stdout_logger_st(const std::string &logger_name); 73 | 74 | template 75 | std::shared_ptr stderr_logger_mt(const std::string &logger_name); 76 | 77 | template 78 | std::shared_ptr stderr_logger_st(const std::string &logger_name); 79 | 80 | } // namespace spdlog 81 | 82 | #ifdef SPDLOG_HEADER_ONLY 83 | #include "stdout_sinks-inl.h" 84 | #endif 85 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/tcp_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #ifdef _WIN32 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #pragma once 21 | 22 | // Simple tcp client sink 23 | // Connects to remote address and send the formatted log. 24 | // Will attempt to reconnect if connection drops. 25 | // If more complicated behaviour is needed (i.e get responses), you can inherit it and override the 26 | // sink_it_ method. 27 | 28 | namespace spdlog { 29 | namespace sinks { 30 | 31 | struct tcp_sink_config { 32 | std::string server_host; 33 | int server_port; 34 | bool lazy_connect = false; // if true connect on first log call instead of on construction 35 | 36 | tcp_sink_config(std::string host, int port) 37 | : server_host{std::move(host)}, 38 | server_port{port} {} 39 | }; 40 | 41 | template 42 | class tcp_sink : public spdlog::sinks::base_sink { 43 | public: 44 | // connect to tcp host/port or throw if failed 45 | // host can be hostname or ip address 46 | 47 | explicit tcp_sink(tcp_sink_config sink_config) 48 | : config_{std::move(sink_config)} { 49 | if (!config_.lazy_connect) { 50 | this->client_.connect(config_.server_host, config_.server_port); 51 | } 52 | } 53 | 54 | ~tcp_sink() override = default; 55 | 56 | protected: 57 | void sink_it_(const spdlog::details::log_msg &msg) override { 58 | spdlog::memory_buf_t formatted; 59 | spdlog::sinks::base_sink::formatter_->format(msg, formatted); 60 | if (!client_.is_connected()) { 61 | client_.connect(config_.server_host, config_.server_port); 62 | } 63 | client_.send(formatted.data(), formatted.size()); 64 | } 65 | 66 | void flush_() override {} 67 | tcp_sink_config config_; 68 | details::tcp_client client_; 69 | }; 70 | 71 | using tcp_sink_mt = tcp_sink; 72 | using tcp_sink_st = tcp_sink; 73 | 74 | } // namespace sinks 75 | } // namespace spdlog 76 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/udp_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #ifdef _WIN32 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | // Simple udp client sink 21 | // Sends formatted log via udp 22 | 23 | namespace spdlog { 24 | namespace sinks { 25 | 26 | struct udp_sink_config { 27 | std::string server_host; 28 | uint16_t server_port; 29 | 30 | udp_sink_config(std::string host, uint16_t port) 31 | : server_host{std::move(host)}, 32 | server_port{port} {} 33 | }; 34 | 35 | template 36 | class udp_sink : public spdlog::sinks::base_sink { 37 | public: 38 | // host can be hostname or ip address 39 | explicit udp_sink(udp_sink_config sink_config) 40 | : client_{sink_config.server_host, sink_config.server_port} {} 41 | 42 | ~udp_sink() override = default; 43 | 44 | protected: 45 | void sink_it_(const spdlog::details::log_msg &msg) override { 46 | spdlog::memory_buf_t formatted; 47 | spdlog::sinks::base_sink::formatter_->format(msg, formatted); 48 | client_.send(formatted.data(), formatted.size()); 49 | } 50 | 51 | void flush_() override {} 52 | details::udp_client client_; 53 | }; 54 | 55 | using udp_sink_mt = udp_sink; 56 | using udp_sink_st = udp_sink; 57 | 58 | } // namespace sinks 59 | 60 | // 61 | // factory functions 62 | // 63 | template 64 | inline std::shared_ptr udp_logger_mt(const std::string &logger_name, 65 | sinks::udp_sink_config skin_config) { 66 | return Factory::template create(logger_name, skin_config); 67 | } 68 | 69 | } // namespace spdlog 70 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/sinks/wincolor_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | namespace spdlog { 18 | namespace sinks { 19 | /* 20 | * Windows color console sink. Uses WriteConsoleA to write to the console with 21 | * colors 22 | */ 23 | template 24 | class wincolor_sink : public sink { 25 | public: 26 | wincolor_sink(void *out_handle, color_mode mode); 27 | ~wincolor_sink() override; 28 | 29 | wincolor_sink(const wincolor_sink &other) = delete; 30 | wincolor_sink &operator=(const wincolor_sink &other) = delete; 31 | 32 | // change the color for the given level 33 | void set_color(level::level_enum level, std::uint16_t color); 34 | void log(const details::log_msg &msg) final override; 35 | void flush() final override; 36 | void set_pattern(const std::string &pattern) override final; 37 | void set_formatter(std::unique_ptr sink_formatter) override final; 38 | void set_color_mode(color_mode mode); 39 | 40 | protected: 41 | using mutex_t = typename ConsoleMutex::mutex_t; 42 | void *out_handle_; 43 | mutex_t &mutex_; 44 | bool should_do_colors_; 45 | std::unique_ptr formatter_; 46 | std::array colors_; 47 | 48 | // set foreground color and return the orig console attributes (for resetting later) 49 | std::uint16_t set_foreground_color_(std::uint16_t attribs); 50 | 51 | // print a range of formatted message to console 52 | void print_range_(const memory_buf_t &formatted, size_t start, size_t end); 53 | 54 | // in case we are redirected to file (not in console mode) 55 | void write_to_file_(const memory_buf_t &formatted); 56 | 57 | void set_color_mode_impl(color_mode mode); 58 | }; 59 | 60 | template 61 | class wincolor_stdout_sink : public wincolor_sink { 62 | public: 63 | explicit wincolor_stdout_sink(color_mode mode = color_mode::automatic); 64 | }; 65 | 66 | template 67 | class wincolor_stderr_sink : public wincolor_sink { 68 | public: 69 | explicit wincolor_stderr_sink(color_mode mode = color_mode::automatic); 70 | }; 71 | 72 | using wincolor_stdout_sink_mt = wincolor_stdout_sink; 73 | using wincolor_stdout_sink_st = wincolor_stdout_sink; 74 | 75 | using wincolor_stderr_sink_mt = wincolor_stderr_sink; 76 | using wincolor_stderr_sink_st = wincolor_stderr_sink; 77 | } // namespace sinks 78 | } // namespace spdlog 79 | 80 | #ifdef SPDLOG_HEADER_ONLY 81 | #include "wincolor_sink-inl.h" 82 | #endif 83 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/stopwatch.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | // Stopwatch support for spdlog (using std::chrono::steady_clock). 10 | // Displays elapsed seconds since construction as double. 11 | // 12 | // Usage: 13 | // 14 | // spdlog::stopwatch sw; 15 | // ... 16 | // spdlog::debug("Elapsed: {} seconds", sw); => "Elapsed 0.005116733 seconds" 17 | // spdlog::info("Elapsed: {:.6} seconds", sw); => "Elapsed 0.005163 seconds" 18 | // 19 | // 20 | // If other units are needed (e.g. millis instead of double), include "fmt/chrono.h" and use 21 | // "duration_cast<..>(sw.elapsed())": 22 | // 23 | // #include 24 | //.. 25 | // using std::chrono::duration_cast; 26 | // using std::chrono::milliseconds; 27 | // spdlog::info("Elapsed {}", duration_cast(sw.elapsed())); => "Elapsed 5ms" 28 | 29 | namespace spdlog { 30 | class stopwatch { 31 | using clock = std::chrono::steady_clock; 32 | std::chrono::time_point start_tp_; 33 | 34 | public: 35 | stopwatch() 36 | : start_tp_{clock::now()} {} 37 | 38 | std::chrono::duration elapsed() const { 39 | return std::chrono::duration(clock::now() - start_tp_); 40 | } 41 | 42 | void reset() { start_tp_ = clock::now(); } 43 | }; 44 | } // namespace spdlog 45 | 46 | // Support for fmt formatting (e.g. "{:012.9}" or just "{}") 47 | namespace 48 | #ifdef SPDLOG_USE_STD_FORMAT 49 | std 50 | #else 51 | fmt 52 | #endif 53 | { 54 | 55 | template <> 56 | struct formatter : formatter { 57 | template 58 | auto format(const spdlog::stopwatch &sw, FormatContext &ctx) const -> decltype(ctx.out()) { 59 | return formatter::format(sw.elapsed().count(), ctx); 60 | } 61 | }; 62 | } // namespace std 63 | -------------------------------------------------------------------------------- /link_files/3rdparty/include/spdlog/version.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #define SPDLOG_VER_MAJOR 1 7 | #define SPDLOG_VER_MINOR 12 8 | #define SPDLOG_VER_PATCH 0 9 | 10 | #define SPDLOG_TO_VERSION(major, minor, patch) (major * 10000 + minor * 100 + patch) 11 | #define SPDLOG_VERSION SPDLOG_TO_VERSION(SPDLOG_VER_MAJOR, SPDLOG_VER_MINOR, SPDLOG_VER_PATCH) 12 | -------------------------------------------------------------------------------- /link_files/link_files.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | -------------------------------------------------------------------------------- /nfo_scraper.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.8.34309.116 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nfo_scraper", "nfo_scraper\nfo_scraper.vcxproj", "{BB96D764-6D07-493B-B8ED-7D75B7F3D019}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "link_files", "link_files\link_files.vcxproj", "{40854397-A524-4167-8E79-5A936B0DEC25}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|x64 = Debug|x64 13 | Debug|x86 = Debug|x86 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {BB96D764-6D07-493B-B8ED-7D75B7F3D019}.Debug|x64.ActiveCfg = Debug|x64 19 | {BB96D764-6D07-493B-B8ED-7D75B7F3D019}.Debug|x64.Build.0 = Debug|x64 20 | {BB96D764-6D07-493B-B8ED-7D75B7F3D019}.Debug|x86.ActiveCfg = Debug|x64 21 | {BB96D764-6D07-493B-B8ED-7D75B7F3D019}.Debug|x86.Build.0 = Debug|x64 22 | {BB96D764-6D07-493B-B8ED-7D75B7F3D019}.Release|x64.ActiveCfg = Release|x64 23 | {BB96D764-6D07-493B-B8ED-7D75B7F3D019}.Release|x64.Build.0 = Release|x64 24 | {BB96D764-6D07-493B-B8ED-7D75B7F3D019}.Release|x86.ActiveCfg = Release|x64 25 | {BB96D764-6D07-493B-B8ED-7D75B7F3D019}.Release|x86.Build.0 = Release|x64 26 | {40854397-A524-4167-8E79-5A936B0DEC25}.Debug|x64.ActiveCfg = Debug|x64 27 | {40854397-A524-4167-8E79-5A936B0DEC25}.Debug|x64.Build.0 = Debug|x64 28 | {40854397-A524-4167-8E79-5A936B0DEC25}.Debug|x86.ActiveCfg = Debug|Win32 29 | {40854397-A524-4167-8E79-5A936B0DEC25}.Debug|x86.Build.0 = Debug|Win32 30 | {40854397-A524-4167-8E79-5A936B0DEC25}.Release|x64.ActiveCfg = Release|x64 31 | {40854397-A524-4167-8E79-5A936B0DEC25}.Release|x64.Build.0 = Release|x64 32 | {40854397-A524-4167-8E79-5A936B0DEC25}.Release|x86.ActiveCfg = Release|Win32 33 | {40854397-A524-4167-8E79-5A936B0DEC25}.Release|x86.Build.0 = Release|Win32 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(ExtensibilityGlobals) = postSolution 39 | SolutionGuid = {7CA79948-B3A8-4585-AD5F-4743A2DD5D83} 40 | EndGlobalSection 41 | EndGlobal 42 | -------------------------------------------------------------------------------- /nfo_scraper/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | UseTab: Never 3 | IndentWidth: 4 4 | TabWidth: 4 5 | # BreakBeforeBraces: Allman 6 | AllowShortIfStatementsOnASingleLine: AllIfsAndElse 7 | AllowShortBlocksOnASingleLine: Always 8 | AllowShortFunctionsOnASingleLine: All 9 | AllowShortLambdasOnASingleLine: All 10 | BreakStringLiterals: true 11 | IndentPPDirectives: AfterHash 12 | IndentCaseLabels: false 13 | ColumnLimit: 0 14 | AccessModifierOffset: -4 15 | NamespaceIndentation: All 16 | FixNamespaceComments: false 17 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/curl/mprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_MPRINTF_H 2 | #define CURLINC_MPRINTF_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | 27 | #include 28 | #include /* needed for FILE */ 29 | #include "curl.h" /* for CURL_EXTERN */ 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | #if (defined(__GNUC__) || defined(__clang__)) && \ 36 | defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ 37 | !defined(CURL_NO_FMT_CHECKS) 38 | #if defined(__MINGW32__) && !defined(__clang__) 39 | #define CURL_TEMP_PRINTF(fmt, arg) \ 40 | __attribute__((format(gnu_printf, fmt, arg))) 41 | #else 42 | #define CURL_TEMP_PRINTF(fmt, arg) \ 43 | __attribute__((format(printf, fmt, arg))) 44 | #endif 45 | #else 46 | #define CURL_TEMP_PRINTF(fmt, arg) 47 | #endif 48 | 49 | CURL_EXTERN int curl_mprintf(const char *format, ...) 50 | CURL_TEMP_PRINTF(1, 2); 51 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...) 52 | CURL_TEMP_PRINTF(2, 3); 53 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...) 54 | CURL_TEMP_PRINTF(2, 3); 55 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, 56 | const char *format, ...) 57 | CURL_TEMP_PRINTF(3, 4); 58 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args) 59 | CURL_TEMP_PRINTF(1, 0); 60 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args) 61 | CURL_TEMP_PRINTF(2, 0); 62 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args) 63 | CURL_TEMP_PRINTF(2, 0); 64 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, 65 | const char *format, va_list args) 66 | CURL_TEMP_PRINTF(3, 0); 67 | CURL_EXTERN char *curl_maprintf(const char *format, ...) 68 | CURL_TEMP_PRINTF(1, 2); 69 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args) 70 | CURL_TEMP_PRINTF(1, 0); 71 | 72 | #undef CURL_TEMP_PRINTF 73 | 74 | #ifdef __cplusplus 75 | } /* end of extern "C" */ 76 | #endif 77 | 78 | #endif /* CURLINC_MPRINTF_H */ 79 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/curl/options.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_OPTIONS_H 2 | #define CURLINC_OPTIONS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | typedef enum { 32 | CURLOT_LONG, /* long (a range of values) */ 33 | CURLOT_VALUES, /* (a defined set or bitmask) */ 34 | CURLOT_OFF_T, /* curl_off_t (a range of values) */ 35 | CURLOT_OBJECT, /* pointer (void *) */ 36 | CURLOT_STRING, /* (char * to null-terminated buffer) */ 37 | CURLOT_SLIST, /* (struct curl_slist *) */ 38 | CURLOT_CBPTR, /* (void * passed as-is to a callback) */ 39 | CURLOT_BLOB, /* blob (struct curl_blob *) */ 40 | CURLOT_FUNCTION /* function pointer */ 41 | } curl_easytype; 42 | 43 | /* Flag bits */ 44 | 45 | /* "alias" means it is provided for old programs to remain functional, 46 | we prefer another name */ 47 | #define CURLOT_FLAG_ALIAS (1<<0) 48 | 49 | /* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size 50 | to use for curl_easy_setopt() for the given id */ 51 | struct curl_easyoption { 52 | const char *name; 53 | CURLoption id; 54 | curl_easytype type; 55 | unsigned int flags; 56 | }; 57 | 58 | CURL_EXTERN const struct curl_easyoption * 59 | curl_easy_option_by_name(const char *name); 60 | 61 | CURL_EXTERN const struct curl_easyoption * 62 | curl_easy_option_by_id(CURLoption id); 63 | 64 | CURL_EXTERN const struct curl_easyoption * 65 | curl_easy_option_next(const struct curl_easyoption *prev); 66 | 67 | #ifdef __cplusplus 68 | } /* end of extern "C" */ 69 | #endif 70 | #endif /* CURLINC_OPTIONS_H */ 71 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_STDCHEADERS_H 2 | #define CURLINC_STDCHEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | 27 | #include 28 | 29 | size_t fread(void *, size_t, size_t, FILE *); 30 | size_t fwrite(const void *, size_t, size_t, FILE *); 31 | 32 | int strcasecmp(const char *, const char *); 33 | int strncasecmp(const char *, const char *, size_t); 34 | 35 | #endif /* CURLINC_STDCHEADERS_H */ 36 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/curl/websockets.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_WEBSOCKETS_H 2 | #define CURLINC_WEBSOCKETS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | struct curl_ws_frame { 32 | int age; /* zero */ 33 | int flags; /* See the CURLWS_* defines */ 34 | curl_off_t offset; /* the offset of this data into the frame */ 35 | curl_off_t bytesleft; /* number of pending bytes left of the payload */ 36 | size_t len; /* size of the current data chunk */ 37 | }; 38 | 39 | /* flag bits */ 40 | #define CURLWS_TEXT (1<<0) 41 | #define CURLWS_BINARY (1<<1) 42 | #define CURLWS_CONT (1<<2) 43 | #define CURLWS_CLOSE (1<<3) 44 | #define CURLWS_PING (1<<4) 45 | #define CURLWS_OFFSET (1<<5) 46 | 47 | /* 48 | * NAME curl_ws_recv() 49 | * 50 | * DESCRIPTION 51 | * 52 | * Receives data from the websocket connection. Use after successful 53 | * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. 54 | */ 55 | CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen, 56 | size_t *recv, 57 | const struct curl_ws_frame **metap); 58 | 59 | /* flags for curl_ws_send() */ 60 | #define CURLWS_PONG (1<<6) 61 | 62 | /* 63 | * NAME curl_ws_send() 64 | * 65 | * DESCRIPTION 66 | * 67 | * Sends data over the websocket connection. Use after successful 68 | * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. 69 | */ 70 | CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer, 71 | size_t buflen, size_t *sent, 72 | curl_off_t fragsize, 73 | unsigned int flags); 74 | 75 | /* bits for the CURLOPT_WS_OPTIONS bitmask: */ 76 | #define CURLWS_RAW_MODE (1<<0) 77 | 78 | CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(CURL *curl); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif /* CURLINC_WEBSOCKETS_H */ 85 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/rapidjson/cursorstreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_CURSORSTREAMWRAPPER_H_ 16 | #define RAPIDJSON_CURSORSTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | 20 | #if defined(__GNUC__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(effc++) 23 | #endif 24 | 25 | #if defined(_MSC_VER) && _MSC_VER <= 1800 26 | RAPIDJSON_DIAG_PUSH 27 | RAPIDJSON_DIAG_OFF(4702) // unreachable code 28 | RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated 29 | #endif 30 | 31 | RAPIDJSON_NAMESPACE_BEGIN 32 | 33 | 34 | //! Cursor stream wrapper for counting line and column number if error exists. 35 | /*! 36 | \tparam InputStream Any stream that implements Stream Concept 37 | */ 38 | template > 39 | class CursorStreamWrapper : public GenericStreamWrapper { 40 | public: 41 | typedef typename Encoding::Ch Ch; 42 | 43 | CursorStreamWrapper(InputStream& is): 44 | GenericStreamWrapper(is), line_(1), col_(0) {} 45 | 46 | // counting line and column number 47 | Ch Take() { 48 | Ch ch = this->is_.Take(); 49 | if(ch == '\n') { 50 | line_ ++; 51 | col_ = 0; 52 | } else { 53 | col_ ++; 54 | } 55 | return ch; 56 | } 57 | 58 | //! Get the error line number, if error exists. 59 | size_t GetLine() const { return line_; } 60 | //! Get the error column number, if error exists. 61 | size_t GetColumn() const { return col_; } 62 | 63 | private: 64 | size_t line_; //!< Current Line 65 | size_t col_; //!< Current Column 66 | }; 67 | 68 | #if defined(_MSC_VER) && _MSC_VER <= 1800 69 | RAPIDJSON_DIAG_POP 70 | #endif 71 | 72 | #if defined(__GNUC__) 73 | RAPIDJSON_DIAG_POP 74 | #endif 75 | 76 | RAPIDJSON_NAMESPACE_END 77 | 78 | #endif // RAPIDJSON_CURSORSTREAMWRAPPER_H_ 79 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/rapidjson/internal/clzll.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_CLZLL_H_ 16 | #define RAPIDJSON_CLZLL_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(_MSC_VER) && !defined(UNDER_CE) 21 | #include 22 | #if defined(_WIN64) 23 | #pragma intrinsic(_BitScanReverse64) 24 | #else 25 | #pragma intrinsic(_BitScanReverse) 26 | #endif 27 | #endif 28 | 29 | RAPIDJSON_NAMESPACE_BEGIN 30 | namespace internal { 31 | 32 | inline uint32_t clzll(uint64_t x) { 33 | // Passing 0 to __builtin_clzll is UB in GCC and results in an 34 | // infinite loop in the software implementation. 35 | RAPIDJSON_ASSERT(x != 0); 36 | 37 | #if defined(_MSC_VER) && !defined(UNDER_CE) 38 | unsigned long r = 0; 39 | #if defined(_WIN64) 40 | _BitScanReverse64(&r, x); 41 | #else 42 | // Scan the high 32 bits. 43 | if (_BitScanReverse(&r, static_cast(x >> 32))) 44 | return 63 - (r + 32); 45 | 46 | // Scan the low 32 bits. 47 | _BitScanReverse(&r, static_cast(x & 0xFFFFFFFF)); 48 | #endif // _WIN64 49 | 50 | return 63 - r; 51 | #elif (defined(__GNUC__) && __GNUC__ >= 4) || RAPIDJSON_HAS_BUILTIN(__builtin_clzll) 52 | // __builtin_clzll wrapper 53 | return static_cast(__builtin_clzll(x)); 54 | #else 55 | // naive version 56 | uint32_t r = 0; 57 | while (!(x & (static_cast(1) << 63))) { 58 | x <<= 1; 59 | ++r; 60 | } 61 | 62 | return r; 63 | #endif // _MSC_VER 64 | } 65 | 66 | #define RAPIDJSON_CLZLL RAPIDJSON_NAMESPACE::internal::clzll 67 | 68 | } // namespace internal 69 | RAPIDJSON_NAMESPACE_END 70 | 71 | #endif // RAPIDJSON_CLZLL_H_ 72 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ 16 | #define RAPIDJSON_INTERNAL_STRFUNC_H_ 17 | 18 | #include "../stream.h" 19 | #include 20 | 21 | RAPIDJSON_NAMESPACE_BEGIN 22 | namespace internal { 23 | 24 | //! Custom strlen() which works on different character types. 25 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 26 | \param s Null-terminated input string. 27 | \return Number of characters in the string. 28 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 29 | */ 30 | template 31 | inline SizeType StrLen(const Ch* s) { 32 | RAPIDJSON_ASSERT(s != 0); 33 | const Ch* p = s; 34 | while (*p) ++p; 35 | return SizeType(p - s); 36 | } 37 | 38 | template <> 39 | inline SizeType StrLen(const char* s) { 40 | return SizeType(std::strlen(s)); 41 | } 42 | 43 | template <> 44 | inline SizeType StrLen(const wchar_t* s) { 45 | return SizeType(std::wcslen(s)); 46 | } 47 | 48 | //! Custom strcmpn() which works on different character types. 49 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 50 | \param s1 Null-terminated input string. 51 | \param s2 Null-terminated input string. 52 | \return 0 if equal 53 | */ 54 | template 55 | inline int StrCmp(const Ch* s1, const Ch* s2) { 56 | RAPIDJSON_ASSERT(s1 != 0); 57 | RAPIDJSON_ASSERT(s2 != 0); 58 | while(*s1 && (*s1 == *s2)) { s1++; s2++; } 59 | return static_cast(*s1) < static_cast(*s2) ? -1 : static_cast(*s1) > static_cast(*s2); 60 | } 61 | 62 | //! Returns number of code points in a encoded string. 63 | template 64 | bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) { 65 | RAPIDJSON_ASSERT(s != 0); 66 | RAPIDJSON_ASSERT(outCount != 0); 67 | GenericStringStream is(s); 68 | const typename Encoding::Ch* end = s + length; 69 | SizeType count = 0; 70 | while (is.src_ < end) { 71 | unsigned codepoint; 72 | if (!Encoding::Decode(is, &codepoint)) 73 | return false; 74 | count++; 75 | } 76 | *outCount = count; 77 | return true; 78 | } 79 | 80 | } // namespace internal 81 | RAPIDJSON_NAMESPACE_END 82 | 83 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_ 84 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/rapidjson/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(c++98-compat) 23 | #endif 24 | 25 | RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { 34 | T tmp = a; 35 | a = b; 36 | b = tmp; 37 | } 38 | 39 | } // namespace internal 40 | RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/rapidjson/memorybuffer.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_MEMORYBUFFER_H_ 16 | #define RAPIDJSON_MEMORYBUFFER_H_ 17 | 18 | #include "stream.h" 19 | #include "internal/stack.h" 20 | 21 | RAPIDJSON_NAMESPACE_BEGIN 22 | 23 | //! Represents an in-memory output byte stream. 24 | /*! 25 | This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. 26 | 27 | It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. 28 | 29 | Differences between MemoryBuffer and StringBuffer: 30 | 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. 31 | 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. 32 | 33 | \tparam Allocator type for allocating memory buffer. 34 | \note implements Stream concept 35 | */ 36 | template 37 | struct GenericMemoryBuffer { 38 | typedef char Ch; // byte 39 | 40 | GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} 41 | 42 | void Put(Ch c) { *stack_.template Push() = c; } 43 | void Flush() {} 44 | 45 | void Clear() { stack_.Clear(); } 46 | void ShrinkToFit() { stack_.ShrinkToFit(); } 47 | Ch* Push(size_t count) { return stack_.template Push(count); } 48 | void Pop(size_t count) { stack_.template Pop(count); } 49 | 50 | const Ch* GetBuffer() const { 51 | return stack_.template Bottom(); 52 | } 53 | 54 | size_t GetSize() const { return stack_.GetSize(); } 55 | 56 | static const size_t kDefaultCapacity = 256; 57 | mutable internal::Stack stack_; 58 | }; 59 | 60 | typedef GenericMemoryBuffer<> MemoryBuffer; 61 | 62 | //! Implement specialized version of PutN() with memset() for better performance. 63 | template<> 64 | inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) { 65 | std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); 66 | } 67 | 68 | RAPIDJSON_NAMESPACE_END 69 | 70 | #endif // RAPIDJSON_MEMORYBUFFER_H_ 71 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/rapidjson/memorystream.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_MEMORYSTREAM_H_ 16 | #define RAPIDJSON_MEMORYSTREAM_H_ 17 | 18 | #include "stream.h" 19 | 20 | #ifdef __clang__ 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(unreachable-code) 23 | RAPIDJSON_DIAG_OFF(missing-noreturn) 24 | #endif 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | 28 | //! Represents an in-memory input byte stream. 29 | /*! 30 | This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. 31 | 32 | It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. 33 | 34 | Differences between MemoryStream and StringStream: 35 | 1. StringStream has encoding but MemoryStream is a byte stream. 36 | 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. 37 | 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). 38 | \note implements Stream concept 39 | */ 40 | struct MemoryStream { 41 | typedef char Ch; // byte 42 | 43 | MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} 44 | 45 | Ch Peek() const { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } 46 | Ch Take() { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } 47 | size_t Tell() const { return static_cast(src_ - begin_); } 48 | 49 | Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 50 | void Put(Ch) { RAPIDJSON_ASSERT(false); } 51 | void Flush() { RAPIDJSON_ASSERT(false); } 52 | size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } 53 | 54 | // For encoding detection only. 55 | const Ch* Peek4() const { 56 | return Tell() + 4 <= size_ ? src_ : 0; 57 | } 58 | 59 | const Ch* src_; //!< Current read position. 60 | const Ch* begin_; //!< Original head of the string. 61 | const Ch* end_; //!< End of stream. 62 | size_t size_; //!< Size of the stream. 63 | }; 64 | 65 | RAPIDJSON_NAMESPACE_END 66 | 67 | #ifdef __clang__ 68 | RAPIDJSON_DIAG_POP 69 | #endif 70 | 71 | #endif // RAPIDJSON_MEMORYBUFFER_H_ 72 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/rapidjson/ostreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_OSTREAMWRAPPER_H_ 16 | #define RAPIDJSON_OSTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | 21 | #ifdef __clang__ 22 | RAPIDJSON_DIAG_PUSH 23 | RAPIDJSON_DIAG_OFF(padded) 24 | #endif 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | 28 | //! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept. 29 | /*! 30 | The classes can be wrapped including but not limited to: 31 | 32 | - \c std::ostringstream 33 | - \c std::stringstream 34 | - \c std::wpstringstream 35 | - \c std::wstringstream 36 | - \c std::ifstream 37 | - \c std::fstream 38 | - \c std::wofstream 39 | - \c std::wfstream 40 | 41 | \tparam StreamType Class derived from \c std::basic_ostream. 42 | */ 43 | 44 | template 45 | class BasicOStreamWrapper { 46 | public: 47 | typedef typename StreamType::char_type Ch; 48 | BasicOStreamWrapper(StreamType& stream) : stream_(stream) {} 49 | 50 | void Put(Ch c) { 51 | stream_.put(c); 52 | } 53 | 54 | void Flush() { 55 | stream_.flush(); 56 | } 57 | 58 | // Not implemented 59 | char Peek() const { RAPIDJSON_ASSERT(false); return 0; } 60 | char Take() { RAPIDJSON_ASSERT(false); return 0; } 61 | size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } 62 | char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 63 | size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } 64 | 65 | private: 66 | BasicOStreamWrapper(const BasicOStreamWrapper&); 67 | BasicOStreamWrapper& operator=(const BasicOStreamWrapper&); 68 | 69 | StreamType& stream_; 70 | }; 71 | 72 | typedef BasicOStreamWrapper OStreamWrapper; 73 | typedef BasicOStreamWrapper WOStreamWrapper; 74 | 75 | #ifdef __clang__ 76 | RAPIDJSON_DIAG_POP 77 | #endif 78 | 79 | RAPIDJSON_NAMESPACE_END 80 | 81 | #endif // RAPIDJSON_OSTREAMWRAPPER_H_ 82 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/async_logger-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | SPDLOG_INLINE spdlog::async_logger::async_logger(std::string logger_name, 17 | sinks_init_list sinks_list, 18 | std::weak_ptr tp, 19 | async_overflow_policy overflow_policy) 20 | : async_logger(std::move(logger_name), 21 | sinks_list.begin(), 22 | sinks_list.end(), 23 | std::move(tp), 24 | overflow_policy) {} 25 | 26 | SPDLOG_INLINE spdlog::async_logger::async_logger(std::string logger_name, 27 | sink_ptr single_sink, 28 | std::weak_ptr tp, 29 | async_overflow_policy overflow_policy) 30 | : async_logger( 31 | std::move(logger_name), {std::move(single_sink)}, std::move(tp), overflow_policy) {} 32 | 33 | // send the log message to the thread pool 34 | SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg){ 35 | SPDLOG_TRY{if (auto pool_ptr = thread_pool_.lock()){ 36 | pool_ptr->post_log(shared_from_this(), msg, overflow_policy_); 37 | } 38 | else { 39 | throw_spdlog_ex("async log: thread pool doesn't exist anymore"); 40 | } 41 | } 42 | SPDLOG_LOGGER_CATCH(msg.source) 43 | } 44 | 45 | // send flush request to the thread pool 46 | SPDLOG_INLINE void spdlog::async_logger::flush_(){ 47 | SPDLOG_TRY{if (auto pool_ptr = thread_pool_.lock()){ 48 | pool_ptr->post_flush(shared_from_this(), overflow_policy_); 49 | } 50 | else { 51 | throw_spdlog_ex("async flush: thread pool doesn't exist anymore"); 52 | } 53 | } 54 | SPDLOG_LOGGER_CATCH(source_loc()) 55 | } 56 | 57 | // 58 | // backend functions - called from the thread pool to do the actual job 59 | // 60 | SPDLOG_INLINE void spdlog::async_logger::backend_sink_it_(const details::log_msg &msg) { 61 | for (auto &sink : sinks_) { 62 | if (sink->should_log(msg.level)) { 63 | SPDLOG_TRY { sink->log(msg); } 64 | SPDLOG_LOGGER_CATCH(msg.source) 65 | } 66 | } 67 | 68 | if (should_flush_(msg)) { 69 | backend_flush_(); 70 | } 71 | } 72 | 73 | SPDLOG_INLINE void spdlog::async_logger::backend_flush_() { 74 | for (auto &sink : sinks_) { 75 | SPDLOG_TRY { sink->flush(); } 76 | SPDLOG_LOGGER_CATCH(source_loc()) 77 | } 78 | } 79 | 80 | SPDLOG_INLINE std::shared_ptr spdlog::async_logger::clone(std::string new_name) { 81 | auto cloned = std::make_shared(*this); 82 | cloned->name_ = std::move(new_name); 83 | return cloned; 84 | } 85 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/async_logger.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | // Fast asynchronous logger. 7 | // Uses pre allocated queue. 8 | // Creates a single back thread to pop messages from the queue and log them. 9 | // 10 | // Upon each log write the logger: 11 | // 1. Checks if its log level is enough to log the message 12 | // 2. Push a new copy of the message to a queue (or block the caller until 13 | // space is available in the queue) 14 | // Upon destruction, logs all remaining messages in the queue before 15 | // destructing.. 16 | 17 | #include 18 | 19 | namespace spdlog { 20 | 21 | // Async overflow policy - block by default. 22 | enum class async_overflow_policy { 23 | block, // Block until message can be enqueued 24 | overrun_oldest, // Discard oldest message in the queue if full when trying to 25 | // add new item. 26 | discard_new // Discard new message if the queue is full when trying to add new item. 27 | }; 28 | 29 | namespace details { 30 | class thread_pool; 31 | } 32 | 33 | class SPDLOG_API async_logger final : public std::enable_shared_from_this, 34 | public logger { 35 | friend class details::thread_pool; 36 | 37 | public: 38 | template 39 | async_logger(std::string logger_name, 40 | It begin, 41 | It end, 42 | std::weak_ptr tp, 43 | async_overflow_policy overflow_policy = async_overflow_policy::block) 44 | : logger(std::move(logger_name), begin, end), 45 | thread_pool_(std::move(tp)), 46 | overflow_policy_(overflow_policy) {} 47 | 48 | async_logger(std::string logger_name, 49 | sinks_init_list sinks_list, 50 | std::weak_ptr tp, 51 | async_overflow_policy overflow_policy = async_overflow_policy::block); 52 | 53 | async_logger(std::string logger_name, 54 | sink_ptr single_sink, 55 | std::weak_ptr tp, 56 | async_overflow_policy overflow_policy = async_overflow_policy::block); 57 | 58 | std::shared_ptr clone(std::string new_name) override; 59 | 60 | protected: 61 | void sink_it_(const details::log_msg &msg) override; 62 | void flush_() override; 63 | void backend_sink_it_(const details::log_msg &incoming_log_msg); 64 | void backend_flush_(); 65 | 66 | private: 67 | std::weak_ptr thread_pool_; 68 | async_overflow_policy overflow_policy_; 69 | }; 70 | } // namespace spdlog 71 | 72 | #ifdef SPDLOG_HEADER_ONLY 73 | #include "async_logger-inl.h" 74 | #endif 75 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/cfg/argv.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | #include 6 | #include 7 | 8 | // 9 | // Init log levels using each argv entry that starts with "SPDLOG_LEVEL=" 10 | // 11 | // set all loggers to debug level: 12 | // example.exe "SPDLOG_LEVEL=debug" 13 | 14 | // set logger1 to trace level 15 | // example.exe "SPDLOG_LEVEL=logger1=trace" 16 | 17 | // turn off all logging except for logger1 and logger2: 18 | // example.exe "SPDLOG_LEVEL=off,logger1=debug,logger2=info" 19 | 20 | namespace spdlog { 21 | namespace cfg { 22 | 23 | // search for SPDLOG_LEVEL= in the args and use it to init the levels 24 | inline void load_argv_levels(int argc, const char **argv) { 25 | const std::string spdlog_level_prefix = "SPDLOG_LEVEL="; 26 | for (int i = 1; i < argc; i++) { 27 | std::string arg = argv[i]; 28 | if (arg.find(spdlog_level_prefix) == 0) { 29 | auto levels_string = arg.substr(spdlog_level_prefix.size()); 30 | helpers::load_levels(levels_string); 31 | } 32 | } 33 | } 34 | 35 | inline void load_argv_levels(int argc, char **argv) { 36 | load_argv_levels(argc, const_cast(argv)); 37 | } 38 | 39 | } // namespace cfg 40 | } // namespace spdlog 41 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/cfg/env.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | #include 6 | #include 7 | #include 8 | 9 | // 10 | // Init levels and patterns from env variables SPDLOG_LEVEL 11 | // Inspired from Rust's "env_logger" crate (https://crates.io/crates/env_logger). 12 | // Note - fallback to "info" level on unrecognized levels 13 | // 14 | // Examples: 15 | // 16 | // set global level to debug: 17 | // export SPDLOG_LEVEL=debug 18 | // 19 | // turn off all logging except for logger1: 20 | // export SPDLOG_LEVEL="*=off,logger1=debug" 21 | // 22 | 23 | // turn off all logging except for logger1 and logger2: 24 | // export SPDLOG_LEVEL="off,logger1=debug,logger2=info" 25 | 26 | namespace spdlog { 27 | namespace cfg { 28 | inline void load_env_levels() { 29 | auto env_val = details::os::getenv("SPDLOG_LEVEL"); 30 | if (!env_val.empty()) { 31 | helpers::load_levels(env_val); 32 | } 33 | } 34 | 35 | } // namespace cfg 36 | } // namespace spdlog 37 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/cfg/helpers.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace cfg { 11 | namespace helpers { 12 | // 13 | // Init levels from given string 14 | // 15 | // Examples: 16 | // 17 | // set global level to debug: "debug" 18 | // turn off all logging except for logger1: "off,logger1=debug" 19 | // turn off all logging except for logger1 and logger2: "off,logger1=debug,logger2=info" 20 | // 21 | SPDLOG_API void load_levels(const std::string &txt); 22 | } // namespace helpers 23 | 24 | } // namespace cfg 25 | } // namespace spdlog 26 | 27 | #ifdef SPDLOG_HEADER_ONLY 28 | #include "helpers-inl.h" 29 | #endif // SPDLOG_HEADER_ONLY 30 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/common-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | namespace level { 15 | 16 | #if __cplusplus >= 201703L 17 | constexpr 18 | #endif 19 | static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES; 20 | 21 | static const char *short_level_names[] SPDLOG_SHORT_LEVEL_NAMES; 22 | 23 | SPDLOG_INLINE const string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT { 24 | return level_string_views[l]; 25 | } 26 | 27 | SPDLOG_INLINE const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT { 28 | return short_level_names[l]; 29 | } 30 | 31 | SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT { 32 | auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name); 33 | if (it != std::end(level_string_views)) 34 | return static_cast(std::distance(std::begin(level_string_views), it)); 35 | 36 | // check also for "warn" and "err" before giving up.. 37 | if (name == "warn") { 38 | return level::warn; 39 | } 40 | if (name == "err") { 41 | return level::err; 42 | } 43 | return level::off; 44 | } 45 | } // namespace level 46 | 47 | SPDLOG_INLINE spdlog_ex::spdlog_ex(std::string msg) 48 | : msg_(std::move(msg)) {} 49 | 50 | SPDLOG_INLINE spdlog_ex::spdlog_ex(const std::string &msg, int last_errno) { 51 | #ifdef SPDLOG_USE_STD_FORMAT 52 | msg_ = std::system_error(std::error_code(last_errno, std::generic_category()), msg).what(); 53 | #else 54 | memory_buf_t outbuf; 55 | fmt::format_system_error(outbuf, last_errno, msg.c_str()); 56 | msg_ = fmt::to_string(outbuf); 57 | #endif 58 | } 59 | 60 | SPDLOG_INLINE const char *spdlog_ex::what() const SPDLOG_NOEXCEPT { return msg_.c_str(); } 61 | 62 | SPDLOG_INLINE void throw_spdlog_ex(const std::string &msg, int last_errno) { 63 | SPDLOG_THROW(spdlog_ex(msg, last_errno)); 64 | } 65 | 66 | SPDLOG_INLINE void throw_spdlog_ex(std::string msg) { SPDLOG_THROW(spdlog_ex(std::move(msg))); } 67 | 68 | } // namespace spdlog 69 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/backtracer-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | namespace spdlog { 10 | namespace details { 11 | SPDLOG_INLINE backtracer::backtracer(const backtracer &other) { 12 | std::lock_guard lock(other.mutex_); 13 | enabled_ = other.enabled(); 14 | messages_ = other.messages_; 15 | } 16 | 17 | SPDLOG_INLINE backtracer::backtracer(backtracer &&other) SPDLOG_NOEXCEPT { 18 | std::lock_guard lock(other.mutex_); 19 | enabled_ = other.enabled(); 20 | messages_ = std::move(other.messages_); 21 | } 22 | 23 | SPDLOG_INLINE backtracer &backtracer::operator=(backtracer other) { 24 | std::lock_guard lock(mutex_); 25 | enabled_ = other.enabled(); 26 | messages_ = std::move(other.messages_); 27 | return *this; 28 | } 29 | 30 | SPDLOG_INLINE void backtracer::enable(size_t size) { 31 | std::lock_guard lock{mutex_}; 32 | enabled_.store(true, std::memory_order_relaxed); 33 | messages_ = circular_q{size}; 34 | } 35 | 36 | SPDLOG_INLINE void backtracer::disable() { 37 | std::lock_guard lock{mutex_}; 38 | enabled_.store(false, std::memory_order_relaxed); 39 | } 40 | 41 | SPDLOG_INLINE bool backtracer::enabled() const { return enabled_.load(std::memory_order_relaxed); } 42 | 43 | SPDLOG_INLINE void backtracer::push_back(const log_msg &msg) { 44 | std::lock_guard lock{mutex_}; 45 | messages_.push_back(log_msg_buffer{msg}); 46 | } 47 | 48 | SPDLOG_INLINE bool backtracer::empty() const { 49 | std::lock_guard lock{mutex_}; 50 | return messages_.empty(); 51 | } 52 | 53 | // pop all items in the q and apply the given fun on each of them. 54 | SPDLOG_INLINE void backtracer::foreach_pop(std::function fun) { 55 | std::lock_guard lock{mutex_}; 56 | while (!messages_.empty()) { 57 | auto &front_msg = messages_.front(); 58 | fun(front_msg); 59 | messages_.pop_front(); 60 | } 61 | } 62 | } // namespace details 63 | } // namespace spdlog 64 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/backtracer.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | // Store log messages in circular buffer. 14 | // Useful for storing debug data in case of error/warning happens. 15 | 16 | namespace spdlog { 17 | namespace details { 18 | class SPDLOG_API backtracer { 19 | mutable std::mutex mutex_; 20 | std::atomic enabled_{false}; 21 | circular_q messages_; 22 | 23 | public: 24 | backtracer() = default; 25 | backtracer(const backtracer &other); 26 | 27 | backtracer(backtracer &&other) SPDLOG_NOEXCEPT; 28 | backtracer &operator=(backtracer other); 29 | 30 | void enable(size_t size); 31 | void disable(); 32 | bool enabled() const; 33 | void push_back(const log_msg &msg); 34 | bool empty() const; 35 | 36 | // pop all items in the q and apply the given fun on each of them. 37 | void foreach_pop(std::function fun); 38 | }; 39 | 40 | } // namespace details 41 | } // namespace spdlog 42 | 43 | #ifdef SPDLOG_HEADER_ONLY 44 | #include "backtracer-inl.h" 45 | #endif 46 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/console_globals.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | 12 | struct console_mutex { 13 | using mutex_t = std::mutex; 14 | static mutex_t &mutex() { 15 | static mutex_t s_mutex; 16 | return s_mutex; 17 | } 18 | }; 19 | 20 | struct console_nullmutex { 21 | using mutex_t = null_mutex; 22 | static mutex_t &mutex() { 23 | static mutex_t s_mutex; 24 | return s_mutex; 25 | } 26 | }; 27 | } // namespace details 28 | } // namespace spdlog 29 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/file_helper.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | 12 | // Helper class for file sinks. 13 | // When failing to open a file, retry several times(5) with a delay interval(10 ms). 14 | // Throw spdlog_ex exception on errors. 15 | 16 | class SPDLOG_API file_helper { 17 | public: 18 | file_helper() = default; 19 | explicit file_helper(const file_event_handlers &event_handlers); 20 | 21 | file_helper(const file_helper &) = delete; 22 | file_helper &operator=(const file_helper &) = delete; 23 | ~file_helper(); 24 | 25 | void open(const filename_t &fname, bool truncate = false); 26 | void reopen(bool truncate); 27 | void flush(); 28 | void sync(); 29 | void close(); 30 | void write(const memory_buf_t &buf); 31 | size_t size() const; 32 | const filename_t &filename() const; 33 | 34 | // 35 | // return file path and its extension: 36 | // 37 | // "mylog.txt" => ("mylog", ".txt") 38 | // "mylog" => ("mylog", "") 39 | // "mylog." => ("mylog.", "") 40 | // "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt") 41 | // 42 | // the starting dot in filenames is ignored (hidden files): 43 | // 44 | // ".mylog" => (".mylog". "") 45 | // "my_folder/.mylog" => ("my_folder/.mylog", "") 46 | // "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt") 47 | static std::tuple split_by_extension(const filename_t &fname); 48 | 49 | private: 50 | const int open_tries_ = 5; 51 | const unsigned int open_interval_ = 10; 52 | std::FILE *fd_{nullptr}; 53 | filename_t filename_; 54 | file_event_handlers event_handlers_; 55 | }; 56 | } // namespace details 57 | } // namespace spdlog 58 | 59 | #ifdef SPDLOG_HEADER_ONLY 60 | #include "file_helper-inl.h" 61 | #endif 62 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/log_msg-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | namespace spdlog { 13 | namespace details { 14 | 15 | SPDLOG_INLINE log_msg::log_msg(spdlog::log_clock::time_point log_time, 16 | spdlog::source_loc loc, 17 | string_view_t a_logger_name, 18 | spdlog::level::level_enum lvl, 19 | spdlog::string_view_t msg) 20 | : logger_name(a_logger_name), 21 | level(lvl), 22 | time(log_time) 23 | #ifndef SPDLOG_NO_THREAD_ID 24 | , 25 | thread_id(os::thread_id()) 26 | #endif 27 | , 28 | source(loc), 29 | payload(msg) { 30 | } 31 | 32 | SPDLOG_INLINE log_msg::log_msg(spdlog::source_loc loc, 33 | string_view_t a_logger_name, 34 | spdlog::level::level_enum lvl, 35 | spdlog::string_view_t msg) 36 | : log_msg(os::now(), loc, a_logger_name, lvl, msg) {} 37 | 38 | SPDLOG_INLINE log_msg::log_msg(string_view_t a_logger_name, 39 | spdlog::level::level_enum lvl, 40 | spdlog::string_view_t msg) 41 | : log_msg(os::now(), source_loc{}, a_logger_name, lvl, msg) {} 42 | 43 | } // namespace details 44 | } // namespace spdlog 45 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/log_msg.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | struct SPDLOG_API log_msg { 12 | log_msg() = default; 13 | log_msg(log_clock::time_point log_time, 14 | source_loc loc, 15 | string_view_t logger_name, 16 | level::level_enum lvl, 17 | string_view_t msg); 18 | log_msg(source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg); 19 | log_msg(string_view_t logger_name, level::level_enum lvl, string_view_t msg); 20 | log_msg(const log_msg &other) = default; 21 | log_msg &operator=(const log_msg &other) = default; 22 | 23 | string_view_t logger_name; 24 | level::level_enum level{level::off}; 25 | log_clock::time_point time; 26 | size_t thread_id{0}; 27 | 28 | // wrapping the formatted text with color (updated by pattern_formatter). 29 | mutable size_t color_range_start{0}; 30 | mutable size_t color_range_end{0}; 31 | 32 | source_loc source; 33 | string_view_t payload; 34 | }; 35 | } // namespace details 36 | } // namespace spdlog 37 | 38 | #ifdef SPDLOG_HEADER_ONLY 39 | #include "log_msg-inl.h" 40 | #endif 41 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/log_msg_buffer-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | namespace spdlog { 11 | namespace details { 12 | 13 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg &orig_msg) 14 | : log_msg{orig_msg} { 15 | buffer.append(logger_name.begin(), logger_name.end()); 16 | buffer.append(payload.begin(), payload.end()); 17 | update_string_views(); 18 | } 19 | 20 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg_buffer &other) 21 | : log_msg{other} { 22 | buffer.append(logger_name.begin(), logger_name.end()); 23 | buffer.append(payload.begin(), payload.end()); 24 | update_string_views(); 25 | } 26 | 27 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT 28 | : log_msg{other}, 29 | buffer{std::move(other.buffer)} { 30 | update_string_views(); 31 | } 32 | 33 | SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(const log_msg_buffer &other) { 34 | log_msg::operator=(other); 35 | buffer.clear(); 36 | buffer.append(other.buffer.data(), other.buffer.data() + other.buffer.size()); 37 | update_string_views(); 38 | return *this; 39 | } 40 | 41 | SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT { 42 | log_msg::operator=(other); 43 | buffer = std::move(other.buffer); 44 | update_string_views(); 45 | return *this; 46 | } 47 | 48 | SPDLOG_INLINE void log_msg_buffer::update_string_views() { 49 | logger_name = string_view_t{buffer.data(), logger_name.size()}; 50 | payload = string_view_t{buffer.data() + logger_name.size(), payload.size()}; 51 | } 52 | 53 | } // namespace details 54 | } // namespace spdlog 55 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/log_msg_buffer.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | namespace spdlog { 9 | namespace details { 10 | 11 | // Extend log_msg with internal buffer to store its payload. 12 | // This is needed since log_msg holds string_views that points to stack data. 13 | 14 | class SPDLOG_API log_msg_buffer : public log_msg { 15 | memory_buf_t buffer; 16 | void update_string_views(); 17 | 18 | public: 19 | log_msg_buffer() = default; 20 | explicit log_msg_buffer(const log_msg &orig_msg); 21 | log_msg_buffer(const log_msg_buffer &other); 22 | log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT; 23 | log_msg_buffer &operator=(const log_msg_buffer &other); 24 | log_msg_buffer &operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT; 25 | }; 26 | 27 | } // namespace details 28 | } // namespace spdlog 29 | 30 | #ifdef SPDLOG_HEADER_ONLY 31 | #include "log_msg_buffer-inl.h" 32 | #endif 33 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/null_mutex.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | // null, no cost dummy "mutex" and dummy "atomic" int 9 | 10 | namespace spdlog { 11 | namespace details { 12 | struct null_mutex { 13 | void lock() const {} 14 | void unlock() const {} 15 | }; 16 | 17 | struct null_atomic_int { 18 | int value; 19 | null_atomic_int() = default; 20 | 21 | explicit null_atomic_int(int new_value) 22 | : value(new_value) {} 23 | 24 | int load(std::memory_order = std::memory_order_relaxed) const { return value; } 25 | 26 | void store(int new_value, std::memory_order = std::memory_order_relaxed) { value = new_value; } 27 | 28 | int exchange(int new_value, std::memory_order = std::memory_order_relaxed) { 29 | std::swap(new_value, value); 30 | return new_value; // return value before the call 31 | } 32 | }; 33 | 34 | } // namespace details 35 | } // namespace spdlog 36 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/periodic_worker-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | namespace spdlog { 11 | namespace details { 12 | 13 | // stop the worker thread and join it 14 | SPDLOG_INLINE periodic_worker::~periodic_worker() { 15 | if (worker_thread_.joinable()) { 16 | { 17 | std::lock_guard lock(mutex_); 18 | active_ = false; 19 | } 20 | cv_.notify_one(); 21 | worker_thread_.join(); 22 | } 23 | } 24 | 25 | } // namespace details 26 | } // namespace spdlog 27 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/periodic_worker.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | // periodic worker thread - periodically executes the given callback function. 7 | // 8 | // RAII over the owned thread: 9 | // creates the thread on construction. 10 | // stops and joins the thread on destruction (if the thread is executing a callback, wait for it 11 | // to finish first). 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | namespace spdlog { 19 | namespace details { 20 | 21 | class SPDLOG_API periodic_worker { 22 | public: 23 | template 24 | periodic_worker(const std::function &callback_fun, 25 | std::chrono::duration interval) { 26 | active_ = (interval > std::chrono::duration::zero()); 27 | if (!active_) { 28 | return; 29 | } 30 | 31 | worker_thread_ = std::thread([this, callback_fun, interval]() { 32 | for (;;) { 33 | std::unique_lock lock(this->mutex_); 34 | if (this->cv_.wait_for(lock, interval, [this] { return !this->active_; })) { 35 | return; // active_ == false, so exit this thread 36 | } 37 | callback_fun(); 38 | } 39 | }); 40 | } 41 | periodic_worker(const periodic_worker &) = delete; 42 | periodic_worker &operator=(const periodic_worker &) = delete; 43 | // stop the worker thread and join it 44 | ~periodic_worker(); 45 | 46 | private: 47 | bool active_; 48 | std::thread worker_thread_; 49 | std::mutex mutex_; 50 | std::condition_variable cv_; 51 | }; 52 | } // namespace details 53 | } // namespace spdlog 54 | 55 | #ifdef SPDLOG_HEADER_ONLY 56 | #include "periodic_worker-inl.h" 57 | #endif 58 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/synchronous_factory.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include "registry.h" 7 | 8 | namespace spdlog { 9 | 10 | // Default logger factory- creates synchronous loggers 11 | class logger; 12 | 13 | struct synchronous_factory { 14 | template 15 | static std::shared_ptr create(std::string logger_name, SinkArgs &&...args) { 16 | auto sink = std::make_shared(std::forward(args)...); 17 | auto new_logger = std::make_shared(std::move(logger_name), std::move(sink)); 18 | details::registry::instance().initialize_logger(new_logger); 19 | return new_logger; 20 | } 21 | }; 22 | } // namespace spdlog 23 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/udp_client.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | // Helper RAII over unix udp client socket. 7 | // Will throw on construction if the socket creation failed. 8 | 9 | #ifdef _WIN32 10 | #error "include udp_client-windows.h instead" 11 | #endif 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | namespace spdlog { 26 | namespace details { 27 | 28 | class udp_client { 29 | static constexpr int TX_BUFFER_SIZE = 1024 * 10; 30 | int socket_ = -1; 31 | struct sockaddr_in sockAddr_; 32 | 33 | void cleanup_() { 34 | if (socket_ != -1) { 35 | ::close(socket_); 36 | socket_ = -1; 37 | } 38 | } 39 | 40 | public: 41 | udp_client(const std::string &host, uint16_t port) { 42 | socket_ = ::socket(PF_INET, SOCK_DGRAM, 0); 43 | if (socket_ < 0) { 44 | throw_spdlog_ex("error: Create Socket Failed!"); 45 | } 46 | 47 | int option_value = TX_BUFFER_SIZE; 48 | if (::setsockopt(socket_, SOL_SOCKET, SO_SNDBUF, 49 | reinterpret_cast(&option_value), sizeof(option_value)) < 0) { 50 | cleanup_(); 51 | throw_spdlog_ex("error: setsockopt(SO_SNDBUF) Failed!"); 52 | } 53 | 54 | sockAddr_.sin_family = AF_INET; 55 | sockAddr_.sin_port = htons(port); 56 | 57 | if (::inet_aton(host.c_str(), &sockAddr_.sin_addr) == 0) { 58 | cleanup_(); 59 | throw_spdlog_ex("error: Invalid address!"); 60 | } 61 | 62 | ::memset(sockAddr_.sin_zero, 0x00, sizeof(sockAddr_.sin_zero)); 63 | } 64 | 65 | ~udp_client() { cleanup_(); } 66 | 67 | int fd() const { return socket_; } 68 | 69 | // Send exactly n_bytes of the given data. 70 | // On error close the connection and throw. 71 | void send(const char *data, size_t n_bytes) { 72 | ssize_t toslen = 0; 73 | socklen_t tolen = sizeof(struct sockaddr); 74 | if ((toslen = ::sendto(socket_, data, n_bytes, 0, (struct sockaddr *)&sockAddr_, tolen)) == 75 | -1) { 76 | throw_spdlog_ex("sendto(2) failed", errno); 77 | } 78 | } 79 | }; 80 | } // namespace details 81 | } // namespace spdlog 82 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/details/windows_include.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef NOMINMAX 4 | #define NOMINMAX // prevent windows redefining min/max 5 | #endif 6 | 7 | #ifndef WIN32_LEAN_AND_MEAN 8 | #define WIN32_LEAN_AND_MEAN 9 | #endif 10 | 11 | #include 12 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/fmt/bundled/fmt.license.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - present, Victor Zverovich 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | --- Optional exception to the license --- 23 | 24 | As an exception, if, as a result of your compiling your source code, portions 25 | of this Software are embedded into a machine-executable object form of such 26 | source code, you may redistribute such embedded portions in such object form 27 | without including the above copyright and permission notices. 28 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/fmt/bundled/locale.h: -------------------------------------------------------------------------------- 1 | #include "xchar.h" 2 | #warning fmt/locale.h is deprecated, include fmt/format.h or fmt/xchar.h instead 3 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/fmt/chrono.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's chrono support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/fmt/compile.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's compile-time support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/fmt/fmt.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016-2018 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | // 9 | // Include a bundled header-only copy of fmtlib or an external one. 10 | // By default spdlog include its own copy. 11 | // 12 | #include 13 | 14 | #if defined(SPDLOG_USE_STD_FORMAT) // SPDLOG_USE_STD_FORMAT is defined - use std::format 15 | #include 16 | #elif !defined(SPDLOG_FMT_EXTERNAL) 17 | #if !defined(SPDLOG_COMPILED_LIB) && !defined(FMT_HEADER_ONLY) 18 | #define FMT_HEADER_ONLY 19 | #endif 20 | #ifndef FMT_USE_WINDOWS_H 21 | #define FMT_USE_WINDOWS_H 0 22 | #endif 23 | // enable the 'n' flag in for backward compatibility with fmt 6.x 24 | #define FMT_DEPRECATED_N_SPECIFIER 25 | // enable ostream formatting for backward compatibility with fmt 8.x 26 | #define FMT_DEPRECATED_OSTREAM 27 | 28 | #include 29 | #include 30 | 31 | #else // SPDLOG_FMT_EXTERNAL is defined - use external fmtlib 32 | #include 33 | #include 34 | #endif 35 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/fmt/ostr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's ostream support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/fmt/ranges.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's ranges support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/fmt/std.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's std support (for formatting e.g. 9 | // std::filesystem::path, std::thread::id, std::monostate, std::variant, ...) 10 | // 11 | #include 12 | 13 | #if !defined(SPDLOG_USE_STD_FORMAT) 14 | #if !defined(SPDLOG_FMT_EXTERNAL) 15 | #ifdef SPDLOG_HEADER_ONLY 16 | #ifndef FMT_HEADER_ONLY 17 | #define FMT_HEADER_ONLY 18 | #endif 19 | #endif 20 | #include 21 | #else 22 | #include 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/fmt/xchar.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's xchar support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/formatter.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | 11 | class formatter { 12 | public: 13 | virtual ~formatter() = default; 14 | virtual void format(const details::log_msg &msg, memory_buf_t &dest) = 0; 15 | virtual std::unique_ptr clone() const = 0; 16 | }; 17 | } // namespace spdlog 18 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/fwd.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | namespace spdlog { 7 | class logger; 8 | class formatter; 9 | 10 | namespace sinks { 11 | class sink; 12 | } 13 | 14 | namespace level { 15 | enum level_enum : int; 16 | } 17 | 18 | } // namespace spdlog 19 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/base_sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | template 17 | SPDLOG_INLINE spdlog::sinks::base_sink::base_sink() 18 | : formatter_{details::make_unique()} {} 19 | 20 | template 21 | SPDLOG_INLINE spdlog::sinks::base_sink::base_sink( 22 | std::unique_ptr formatter) 23 | : formatter_{std::move(formatter)} {} 24 | 25 | template 26 | void SPDLOG_INLINE spdlog::sinks::base_sink::log(const details::log_msg &msg) { 27 | std::lock_guard lock(mutex_); 28 | sink_it_(msg); 29 | } 30 | 31 | template 32 | void SPDLOG_INLINE spdlog::sinks::base_sink::flush() { 33 | std::lock_guard lock(mutex_); 34 | flush_(); 35 | } 36 | 37 | template 38 | void SPDLOG_INLINE spdlog::sinks::base_sink::set_pattern(const std::string &pattern) { 39 | std::lock_guard lock(mutex_); 40 | set_pattern_(pattern); 41 | } 42 | 43 | template 44 | void SPDLOG_INLINE 45 | spdlog::sinks::base_sink::set_formatter(std::unique_ptr sink_formatter) { 46 | std::lock_guard lock(mutex_); 47 | set_formatter_(std::move(sink_formatter)); 48 | } 49 | 50 | template 51 | void SPDLOG_INLINE spdlog::sinks::base_sink::set_pattern_(const std::string &pattern) { 52 | set_formatter_(details::make_unique(pattern)); 53 | } 54 | 55 | template 56 | void SPDLOG_INLINE 57 | spdlog::sinks::base_sink::set_formatter_(std::unique_ptr sink_formatter) { 58 | formatter_ = std::move(sink_formatter); 59 | } 60 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/base_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | // 6 | // base sink templated over a mutex (either dummy or real) 7 | // concrete implementation should override the sink_it_() and flush_() methods. 8 | // locking is taken care of in this class - no locking needed by the 9 | // implementers.. 10 | // 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | namespace spdlog { 17 | namespace sinks { 18 | template 19 | class SPDLOG_API base_sink : public sink { 20 | public: 21 | base_sink(); 22 | explicit base_sink(std::unique_ptr formatter); 23 | ~base_sink() override = default; 24 | 25 | base_sink(const base_sink &) = delete; 26 | base_sink(base_sink &&) = delete; 27 | 28 | base_sink &operator=(const base_sink &) = delete; 29 | base_sink &operator=(base_sink &&) = delete; 30 | 31 | void log(const details::log_msg &msg) final; 32 | void flush() final; 33 | void set_pattern(const std::string &pattern) final; 34 | void set_formatter(std::unique_ptr sink_formatter) final; 35 | 36 | protected: 37 | // sink formatter 38 | std::unique_ptr formatter_; 39 | Mutex mutex_; 40 | 41 | virtual void sink_it_(const details::log_msg &msg) = 0; 42 | virtual void flush_() = 0; 43 | virtual void set_pattern_(const std::string &pattern); 44 | virtual void set_formatter_(std::unique_ptr sink_formatter); 45 | }; 46 | } // namespace sinks 47 | } // namespace spdlog 48 | 49 | #ifdef SPDLOG_HEADER_ONLY 50 | #include "base_sink-inl.h" 51 | #endif 52 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/basic_file_sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | namespace sinks { 15 | 16 | template 17 | SPDLOG_INLINE basic_file_sink::basic_file_sink(const filename_t &filename, 18 | bool truncate, 19 | const file_event_handlers &event_handlers) 20 | : file_helper_{event_handlers} { 21 | file_helper_.open(filename, truncate); 22 | } 23 | 24 | template 25 | SPDLOG_INLINE const filename_t &basic_file_sink::filename() const { 26 | return file_helper_.filename(); 27 | } 28 | 29 | template 30 | SPDLOG_INLINE void basic_file_sink::sink_it_(const details::log_msg &msg) { 31 | memory_buf_t formatted; 32 | base_sink::formatter_->format(msg, formatted); 33 | file_helper_.write(formatted); 34 | } 35 | 36 | template 37 | SPDLOG_INLINE void basic_file_sink::flush_() { 38 | file_helper_.flush(); 39 | } 40 | 41 | } // namespace sinks 42 | } // namespace spdlog 43 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/basic_file_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | namespace spdlog { 15 | namespace sinks { 16 | /* 17 | * Trivial file sink with single file as target 18 | */ 19 | template 20 | class basic_file_sink final : public base_sink { 21 | public: 22 | explicit basic_file_sink(const filename_t &filename, 23 | bool truncate = false, 24 | const file_event_handlers &event_handlers = {}); 25 | const filename_t &filename() const; 26 | 27 | protected: 28 | void sink_it_(const details::log_msg &msg) override; 29 | void flush_() override; 30 | 31 | private: 32 | details::file_helper file_helper_; 33 | }; 34 | 35 | using basic_file_sink_mt = basic_file_sink; 36 | using basic_file_sink_st = basic_file_sink; 37 | 38 | } // namespace sinks 39 | 40 | // 41 | // factory functions 42 | // 43 | template 44 | inline std::shared_ptr basic_logger_mt(const std::string &logger_name, 45 | const filename_t &filename, 46 | bool truncate = false, 47 | const file_event_handlers &event_handlers = {}) { 48 | return Factory::template create(logger_name, filename, truncate, 49 | event_handlers); 50 | } 51 | 52 | template 53 | inline std::shared_ptr basic_logger_st(const std::string &logger_name, 54 | const filename_t &filename, 55 | bool truncate = false, 56 | const file_event_handlers &event_handlers = {}) { 57 | return Factory::template create(logger_name, filename, truncate, 58 | event_handlers); 59 | } 60 | 61 | } // namespace spdlog 62 | 63 | #ifdef SPDLOG_HEADER_ONLY 64 | #include "basic_file_sink-inl.h" 65 | #endif 66 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/callback_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | 15 | // callbacks type 16 | typedef std::function custom_log_callback; 17 | 18 | namespace sinks { 19 | /* 20 | * Trivial callback sink, gets a callback function and calls it on each log 21 | */ 22 | template 23 | class callback_sink final : public base_sink { 24 | public: 25 | explicit callback_sink(const custom_log_callback &callback) 26 | : callback_{callback} {} 27 | 28 | protected: 29 | void sink_it_(const details::log_msg &msg) override { callback_(msg); } 30 | void flush_() override{}; 31 | 32 | private: 33 | custom_log_callback callback_; 34 | }; 35 | 36 | using callback_sink_mt = callback_sink; 37 | using callback_sink_st = callback_sink; 38 | 39 | } // namespace sinks 40 | 41 | // 42 | // factory functions 43 | // 44 | template 45 | inline std::shared_ptr callback_logger_mt(const std::string &logger_name, 46 | const custom_log_callback &callback) { 47 | return Factory::template create(logger_name, callback); 48 | } 49 | 50 | template 51 | inline std::shared_ptr callback_logger_st(const std::string &logger_name, 52 | const custom_log_callback &callback) { 53 | return Factory::template create(logger_name, callback); 54 | } 55 | 56 | } // namespace spdlog 57 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/dist_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include "base_sink.h" 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | // Distribution sink (mux). Stores a vector of sinks which get called when log 17 | // is called 18 | 19 | namespace spdlog { 20 | namespace sinks { 21 | 22 | template 23 | class dist_sink : public base_sink { 24 | public: 25 | dist_sink() = default; 26 | explicit dist_sink(std::vector> sinks) 27 | : sinks_(sinks) {} 28 | 29 | dist_sink(const dist_sink &) = delete; 30 | dist_sink &operator=(const dist_sink &) = delete; 31 | 32 | void add_sink(std::shared_ptr sub_sink) { 33 | std::lock_guard lock(base_sink::mutex_); 34 | sinks_.push_back(sub_sink); 35 | } 36 | 37 | void remove_sink(std::shared_ptr sub_sink) { 38 | std::lock_guard lock(base_sink::mutex_); 39 | sinks_.erase(std::remove(sinks_.begin(), sinks_.end(), sub_sink), sinks_.end()); 40 | } 41 | 42 | void set_sinks(std::vector> sinks) { 43 | std::lock_guard lock(base_sink::mutex_); 44 | sinks_ = std::move(sinks); 45 | } 46 | 47 | std::vector> &sinks() { return sinks_; } 48 | 49 | protected: 50 | void sink_it_(const details::log_msg &msg) override { 51 | for (auto &sub_sink : sinks_) { 52 | if (sub_sink->should_log(msg.level)) { 53 | sub_sink->log(msg); 54 | } 55 | } 56 | } 57 | 58 | void flush_() override { 59 | for (auto &sub_sink : sinks_) { 60 | sub_sink->flush(); 61 | } 62 | } 63 | 64 | void set_pattern_(const std::string &pattern) override { 65 | set_formatter_(details::make_unique(pattern)); 66 | } 67 | 68 | void set_formatter_(std::unique_ptr sink_formatter) override { 69 | base_sink::formatter_ = std::move(sink_formatter); 70 | for (auto &sub_sink : sinks_) { 71 | sub_sink->set_formatter(base_sink::formatter_->clone()); 72 | } 73 | } 74 | std::vector> sinks_; 75 | }; 76 | 77 | using dist_sink_mt = dist_sink; 78 | using dist_sink_st = dist_sink; 79 | 80 | } // namespace sinks 81 | } // namespace spdlog 82 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/msvc_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2016 Alexander Dalshov & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #if defined(_WIN32) 7 | 8 | #include 9 | #if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) 10 | #include 11 | #endif 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | // Avoid including windows.h (https://stackoverflow.com/a/30741042) 18 | #if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) 19 | extern "C" __declspec(dllimport) void __stdcall OutputDebugStringW(const wchar_t *lpOutputString); 20 | #else 21 | extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char *lpOutputString); 22 | #endif 23 | extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); 24 | 25 | namespace spdlog { 26 | namespace sinks { 27 | /* 28 | * MSVC sink (logging using OutputDebugStringA) 29 | */ 30 | template 31 | class msvc_sink : public base_sink { 32 | public: 33 | msvc_sink() = default; 34 | msvc_sink(bool check_debugger_present) 35 | : check_debugger_present_{check_debugger_present} {}; 36 | 37 | protected: 38 | void sink_it_(const details::log_msg &msg) override { 39 | if (check_debugger_present_ && !IsDebuggerPresent()) { 40 | return; 41 | } 42 | memory_buf_t formatted; 43 | base_sink::formatter_->format(msg, formatted); 44 | formatted.push_back('\0'); // add a null terminator for OutputDebugString 45 | #if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) 46 | wmemory_buf_t wformatted; 47 | details::os::utf8_to_wstrbuf(string_view_t(formatted.data(), formatted.size()), wformatted); 48 | OutputDebugStringW(wformatted.data()); 49 | #else 50 | OutputDebugStringA(formatted.data()); 51 | #endif 52 | } 53 | 54 | void flush_() override {} 55 | 56 | bool check_debugger_present_ = true; 57 | }; 58 | 59 | using msvc_sink_mt = msvc_sink; 60 | using msvc_sink_st = msvc_sink; 61 | 62 | using windebug_sink_mt = msvc_sink_mt; 63 | using windebug_sink_st = msvc_sink_st; 64 | 65 | } // namespace sinks 66 | } // namespace spdlog 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/null_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | namespace spdlog { 13 | namespace sinks { 14 | 15 | template 16 | class null_sink : public base_sink { 17 | protected: 18 | void sink_it_(const details::log_msg &) override {} 19 | void flush_() override {} 20 | }; 21 | 22 | using null_sink_mt = null_sink; 23 | using null_sink_st = null_sink; 24 | 25 | } // namespace sinks 26 | 27 | template 28 | inline std::shared_ptr null_logger_mt(const std::string &logger_name) { 29 | auto null_logger = Factory::template create(logger_name); 30 | null_logger->set_level(level::off); 31 | return null_logger; 32 | } 33 | 34 | template 35 | inline std::shared_ptr null_logger_st(const std::string &logger_name) { 36 | auto null_logger = Factory::template create(logger_name); 37 | null_logger->set_level(level::off); 38 | return null_logger; 39 | } 40 | 41 | } // namespace spdlog 42 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/ostream_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | namespace spdlog { 13 | namespace sinks { 14 | template 15 | class ostream_sink final : public base_sink { 16 | public: 17 | explicit ostream_sink(std::ostream &os, bool force_flush = false) 18 | : ostream_(os), 19 | force_flush_(force_flush) {} 20 | ostream_sink(const ostream_sink &) = delete; 21 | ostream_sink &operator=(const ostream_sink &) = delete; 22 | 23 | protected: 24 | void sink_it_(const details::log_msg &msg) override { 25 | memory_buf_t formatted; 26 | base_sink::formatter_->format(msg, formatted); 27 | ostream_.write(formatted.data(), static_cast(formatted.size())); 28 | if (force_flush_) { 29 | ostream_.flush(); 30 | } 31 | } 32 | 33 | void flush_() override { ostream_.flush(); } 34 | 35 | std::ostream &ostream_; 36 | bool force_flush_; 37 | }; 38 | 39 | using ostream_sink_mt = ostream_sink; 40 | using ostream_sink_st = ostream_sink; 41 | 42 | } // namespace sinks 43 | } // namespace spdlog 44 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/ringbuffer_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include "spdlog/details/circular_q.h" 7 | #include "spdlog/details/log_msg_buffer.h" 8 | #include "spdlog/details/null_mutex.h" 9 | #include "spdlog/sinks/base_sink.h" 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace spdlog { 16 | namespace sinks { 17 | /* 18 | * Ring buffer sink 19 | */ 20 | template 21 | class ringbuffer_sink final : public base_sink { 22 | public: 23 | explicit ringbuffer_sink(size_t n_items) 24 | : q_{n_items} {} 25 | 26 | std::vector last_raw(size_t lim = 0) { 27 | std::lock_guard lock(base_sink::mutex_); 28 | auto items_available = q_.size(); 29 | auto n_items = lim > 0 ? (std::min)(lim, items_available) : items_available; 30 | std::vector ret; 31 | ret.reserve(n_items); 32 | for (size_t i = (items_available - n_items); i < items_available; i++) { 33 | ret.push_back(q_.at(i)); 34 | } 35 | return ret; 36 | } 37 | 38 | std::vector last_formatted(size_t lim = 0) { 39 | std::lock_guard lock(base_sink::mutex_); 40 | auto items_available = q_.size(); 41 | auto n_items = lim > 0 ? (std::min)(lim, items_available) : items_available; 42 | std::vector ret; 43 | ret.reserve(n_items); 44 | for (size_t i = (items_available - n_items); i < items_available; i++) { 45 | memory_buf_t formatted; 46 | base_sink::formatter_->format(q_.at(i), formatted); 47 | ret.push_back(SPDLOG_BUF_TO_STRING(formatted)); 48 | } 49 | return ret; 50 | } 51 | 52 | protected: 53 | void sink_it_(const details::log_msg &msg) override { 54 | q_.push_back(details::log_msg_buffer{msg}); 55 | } 56 | void flush_() override {} 57 | 58 | private: 59 | details::circular_q q_; 60 | }; 61 | 62 | using ringbuffer_sink_mt = ringbuffer_sink; 63 | using ringbuffer_sink_st = ringbuffer_sink; 64 | 65 | } // namespace sinks 66 | 67 | } // namespace spdlog 68 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | SPDLOG_INLINE bool spdlog::sinks::sink::should_log(spdlog::level::level_enum msg_level) const { 13 | return msg_level >= level_.load(std::memory_order_relaxed); 14 | } 15 | 16 | SPDLOG_INLINE void spdlog::sinks::sink::set_level(level::level_enum log_level) { 17 | level_.store(log_level, std::memory_order_relaxed); 18 | } 19 | 20 | SPDLOG_INLINE spdlog::level::level_enum spdlog::sinks::sink::level() const { 21 | return static_cast(level_.load(std::memory_order_relaxed)); 22 | } 23 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | 11 | namespace sinks { 12 | class SPDLOG_API sink { 13 | public: 14 | virtual ~sink() = default; 15 | virtual void log(const details::log_msg &msg) = 0; 16 | virtual void flush() = 0; 17 | virtual void set_pattern(const std::string &pattern) = 0; 18 | virtual void set_formatter(std::unique_ptr sink_formatter) = 0; 19 | 20 | void set_level(level::level_enum log_level); 21 | level::level_enum level() const; 22 | bool should_log(level::level_enum msg_level) const; 23 | 24 | protected: 25 | // sink log level - default is all 26 | level_t level_{level::trace}; 27 | }; 28 | 29 | } // namespace sinks 30 | } // namespace spdlog 31 | 32 | #ifdef SPDLOG_HEADER_ONLY 33 | #include "sink-inl.h" 34 | #endif 35 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/stdout_color_sinks-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | 15 | template 16 | SPDLOG_INLINE std::shared_ptr stdout_color_mt(const std::string &logger_name, 17 | color_mode mode) { 18 | return Factory::template create(logger_name, mode); 19 | } 20 | 21 | template 22 | SPDLOG_INLINE std::shared_ptr stdout_color_st(const std::string &logger_name, 23 | color_mode mode) { 24 | return Factory::template create(logger_name, mode); 25 | } 26 | 27 | template 28 | SPDLOG_INLINE std::shared_ptr stderr_color_mt(const std::string &logger_name, 29 | color_mode mode) { 30 | return Factory::template create(logger_name, mode); 31 | } 32 | 33 | template 34 | SPDLOG_INLINE std::shared_ptr stderr_color_st(const std::string &logger_name, 35 | color_mode mode) { 36 | return Factory::template create(logger_name, mode); 37 | } 38 | } // namespace spdlog 39 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/stdout_color_sinks.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifdef _WIN32 7 | #include 8 | #else 9 | #include 10 | #endif 11 | 12 | #include 13 | 14 | namespace spdlog { 15 | namespace sinks { 16 | #ifdef _WIN32 17 | using stdout_color_sink_mt = wincolor_stdout_sink_mt; 18 | using stdout_color_sink_st = wincolor_stdout_sink_st; 19 | using stderr_color_sink_mt = wincolor_stderr_sink_mt; 20 | using stderr_color_sink_st = wincolor_stderr_sink_st; 21 | #else 22 | using stdout_color_sink_mt = ansicolor_stdout_sink_mt; 23 | using stdout_color_sink_st = ansicolor_stdout_sink_st; 24 | using stderr_color_sink_mt = ansicolor_stderr_sink_mt; 25 | using stderr_color_sink_st = ansicolor_stderr_sink_st; 26 | #endif 27 | } // namespace sinks 28 | 29 | template 30 | std::shared_ptr stdout_color_mt(const std::string &logger_name, 31 | color_mode mode = color_mode::automatic); 32 | 33 | template 34 | std::shared_ptr stdout_color_st(const std::string &logger_name, 35 | color_mode mode = color_mode::automatic); 36 | 37 | template 38 | std::shared_ptr stderr_color_mt(const std::string &logger_name, 39 | color_mode mode = color_mode::automatic); 40 | 41 | template 42 | std::shared_ptr stderr_color_st(const std::string &logger_name, 43 | color_mode mode = color_mode::automatic); 44 | 45 | } // namespace spdlog 46 | 47 | #ifdef SPDLOG_HEADER_ONLY 48 | #include "stdout_color_sinks-inl.h" 49 | #endif 50 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/stdout_sinks.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #ifdef _WIN32 12 | #include 13 | #endif 14 | 15 | namespace spdlog { 16 | 17 | namespace sinks { 18 | 19 | template 20 | class stdout_sink_base : public sink { 21 | public: 22 | using mutex_t = typename ConsoleMutex::mutex_t; 23 | explicit stdout_sink_base(FILE *file); 24 | ~stdout_sink_base() override = default; 25 | 26 | stdout_sink_base(const stdout_sink_base &other) = delete; 27 | stdout_sink_base(stdout_sink_base &&other) = delete; 28 | 29 | stdout_sink_base &operator=(const stdout_sink_base &other) = delete; 30 | stdout_sink_base &operator=(stdout_sink_base &&other) = delete; 31 | 32 | void log(const details::log_msg &msg) override; 33 | void flush() override; 34 | void set_pattern(const std::string &pattern) override; 35 | 36 | void set_formatter(std::unique_ptr sink_formatter) override; 37 | 38 | protected: 39 | mutex_t &mutex_; 40 | FILE *file_; 41 | std::unique_ptr formatter_; 42 | #ifdef _WIN32 43 | HANDLE handle_; 44 | #endif // WIN32 45 | }; 46 | 47 | template 48 | class stdout_sink : public stdout_sink_base { 49 | public: 50 | stdout_sink(); 51 | }; 52 | 53 | template 54 | class stderr_sink : public stdout_sink_base { 55 | public: 56 | stderr_sink(); 57 | }; 58 | 59 | using stdout_sink_mt = stdout_sink; 60 | using stdout_sink_st = stdout_sink; 61 | 62 | using stderr_sink_mt = stderr_sink; 63 | using stderr_sink_st = stderr_sink; 64 | 65 | } // namespace sinks 66 | 67 | // factory methods 68 | template 69 | std::shared_ptr stdout_logger_mt(const std::string &logger_name); 70 | 71 | template 72 | std::shared_ptr stdout_logger_st(const std::string &logger_name); 73 | 74 | template 75 | std::shared_ptr stderr_logger_mt(const std::string &logger_name); 76 | 77 | template 78 | std::shared_ptr stderr_logger_st(const std::string &logger_name); 79 | 80 | } // namespace spdlog 81 | 82 | #ifdef SPDLOG_HEADER_ONLY 83 | #include "stdout_sinks-inl.h" 84 | #endif 85 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/tcp_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #ifdef _WIN32 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #pragma once 21 | 22 | // Simple tcp client sink 23 | // Connects to remote address and send the formatted log. 24 | // Will attempt to reconnect if connection drops. 25 | // If more complicated behaviour is needed (i.e get responses), you can inherit it and override the 26 | // sink_it_ method. 27 | 28 | namespace spdlog { 29 | namespace sinks { 30 | 31 | struct tcp_sink_config { 32 | std::string server_host; 33 | int server_port; 34 | bool lazy_connect = false; // if true connect on first log call instead of on construction 35 | 36 | tcp_sink_config(std::string host, int port) 37 | : server_host{std::move(host)}, 38 | server_port{port} {} 39 | }; 40 | 41 | template 42 | class tcp_sink : public spdlog::sinks::base_sink { 43 | public: 44 | // connect to tcp host/port or throw if failed 45 | // host can be hostname or ip address 46 | 47 | explicit tcp_sink(tcp_sink_config sink_config) 48 | : config_{std::move(sink_config)} { 49 | if (!config_.lazy_connect) { 50 | this->client_.connect(config_.server_host, config_.server_port); 51 | } 52 | } 53 | 54 | ~tcp_sink() override = default; 55 | 56 | protected: 57 | void sink_it_(const spdlog::details::log_msg &msg) override { 58 | spdlog::memory_buf_t formatted; 59 | spdlog::sinks::base_sink::formatter_->format(msg, formatted); 60 | if (!client_.is_connected()) { 61 | client_.connect(config_.server_host, config_.server_port); 62 | } 63 | client_.send(formatted.data(), formatted.size()); 64 | } 65 | 66 | void flush_() override {} 67 | tcp_sink_config config_; 68 | details::tcp_client client_; 69 | }; 70 | 71 | using tcp_sink_mt = tcp_sink; 72 | using tcp_sink_st = tcp_sink; 73 | 74 | } // namespace sinks 75 | } // namespace spdlog 76 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/udp_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #ifdef _WIN32 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | // Simple udp client sink 21 | // Sends formatted log via udp 22 | 23 | namespace spdlog { 24 | namespace sinks { 25 | 26 | struct udp_sink_config { 27 | std::string server_host; 28 | uint16_t server_port; 29 | 30 | udp_sink_config(std::string host, uint16_t port) 31 | : server_host{std::move(host)}, 32 | server_port{port} {} 33 | }; 34 | 35 | template 36 | class udp_sink : public spdlog::sinks::base_sink { 37 | public: 38 | // host can be hostname or ip address 39 | explicit udp_sink(udp_sink_config sink_config) 40 | : client_{sink_config.server_host, sink_config.server_port} {} 41 | 42 | ~udp_sink() override = default; 43 | 44 | protected: 45 | void sink_it_(const spdlog::details::log_msg &msg) override { 46 | spdlog::memory_buf_t formatted; 47 | spdlog::sinks::base_sink::formatter_->format(msg, formatted); 48 | client_.send(formatted.data(), formatted.size()); 49 | } 50 | 51 | void flush_() override {} 52 | details::udp_client client_; 53 | }; 54 | 55 | using udp_sink_mt = udp_sink; 56 | using udp_sink_st = udp_sink; 57 | 58 | } // namespace sinks 59 | 60 | // 61 | // factory functions 62 | // 63 | template 64 | inline std::shared_ptr udp_logger_mt(const std::string &logger_name, 65 | sinks::udp_sink_config skin_config) { 66 | return Factory::template create(logger_name, skin_config); 67 | } 68 | 69 | } // namespace spdlog 70 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/sinks/wincolor_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | namespace spdlog { 18 | namespace sinks { 19 | /* 20 | * Windows color console sink. Uses WriteConsoleA to write to the console with 21 | * colors 22 | */ 23 | template 24 | class wincolor_sink : public sink { 25 | public: 26 | wincolor_sink(void *out_handle, color_mode mode); 27 | ~wincolor_sink() override; 28 | 29 | wincolor_sink(const wincolor_sink &other) = delete; 30 | wincolor_sink &operator=(const wincolor_sink &other) = delete; 31 | 32 | // change the color for the given level 33 | void set_color(level::level_enum level, std::uint16_t color); 34 | void log(const details::log_msg &msg) final override; 35 | void flush() final override; 36 | void set_pattern(const std::string &pattern) override final; 37 | void set_formatter(std::unique_ptr sink_formatter) override final; 38 | void set_color_mode(color_mode mode); 39 | 40 | protected: 41 | using mutex_t = typename ConsoleMutex::mutex_t; 42 | void *out_handle_; 43 | mutex_t &mutex_; 44 | bool should_do_colors_; 45 | std::unique_ptr formatter_; 46 | std::array colors_; 47 | 48 | // set foreground color and return the orig console attributes (for resetting later) 49 | std::uint16_t set_foreground_color_(std::uint16_t attribs); 50 | 51 | // print a range of formatted message to console 52 | void print_range_(const memory_buf_t &formatted, size_t start, size_t end); 53 | 54 | // in case we are redirected to file (not in console mode) 55 | void write_to_file_(const memory_buf_t &formatted); 56 | 57 | void set_color_mode_impl(color_mode mode); 58 | }; 59 | 60 | template 61 | class wincolor_stdout_sink : public wincolor_sink { 62 | public: 63 | explicit wincolor_stdout_sink(color_mode mode = color_mode::automatic); 64 | }; 65 | 66 | template 67 | class wincolor_stderr_sink : public wincolor_sink { 68 | public: 69 | explicit wincolor_stderr_sink(color_mode mode = color_mode::automatic); 70 | }; 71 | 72 | using wincolor_stdout_sink_mt = wincolor_stdout_sink; 73 | using wincolor_stdout_sink_st = wincolor_stdout_sink; 74 | 75 | using wincolor_stderr_sink_mt = wincolor_stderr_sink; 76 | using wincolor_stderr_sink_st = wincolor_stderr_sink; 77 | } // namespace sinks 78 | } // namespace spdlog 79 | 80 | #ifdef SPDLOG_HEADER_ONLY 81 | #include "wincolor_sink-inl.h" 82 | #endif 83 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/stopwatch.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | // Stopwatch support for spdlog (using std::chrono::steady_clock). 10 | // Displays elapsed seconds since construction as double. 11 | // 12 | // Usage: 13 | // 14 | // spdlog::stopwatch sw; 15 | // ... 16 | // spdlog::debug("Elapsed: {} seconds", sw); => "Elapsed 0.005116733 seconds" 17 | // spdlog::info("Elapsed: {:.6} seconds", sw); => "Elapsed 0.005163 seconds" 18 | // 19 | // 20 | // If other units are needed (e.g. millis instead of double), include "fmt/chrono.h" and use 21 | // "duration_cast<..>(sw.elapsed())": 22 | // 23 | // #include 24 | //.. 25 | // using std::chrono::duration_cast; 26 | // using std::chrono::milliseconds; 27 | // spdlog::info("Elapsed {}", duration_cast(sw.elapsed())); => "Elapsed 5ms" 28 | 29 | namespace spdlog { 30 | class stopwatch { 31 | using clock = std::chrono::steady_clock; 32 | std::chrono::time_point start_tp_; 33 | 34 | public: 35 | stopwatch() 36 | : start_tp_{clock::now()} {} 37 | 38 | std::chrono::duration elapsed() const { 39 | return std::chrono::duration(clock::now() - start_tp_); 40 | } 41 | 42 | void reset() { start_tp_ = clock::now(); } 43 | }; 44 | } // namespace spdlog 45 | 46 | // Support for fmt formatting (e.g. "{:012.9}" or just "{}") 47 | namespace 48 | #ifdef SPDLOG_USE_STD_FORMAT 49 | std 50 | #else 51 | fmt 52 | #endif 53 | { 54 | 55 | template <> 56 | struct formatter : formatter { 57 | template 58 | auto format(const spdlog::stopwatch &sw, FormatContext &ctx) const -> decltype(ctx.out()) { 59 | return formatter::format(sw.elapsed().count(), ctx); 60 | } 61 | }; 62 | } // namespace std 63 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/include/spdlog/version.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #define SPDLOG_VER_MAJOR 1 7 | #define SPDLOG_VER_MINOR 12 8 | #define SPDLOG_VER_PATCH 0 9 | 10 | #define SPDLOG_TO_VERSION(major, minor, patch) (major * 10000 + minor * 100 + patch) 11 | #define SPDLOG_VERSION SPDLOG_TO_VERSION(SPDLOG_VER_MAJOR, SPDLOG_VER_MINOR, SPDLOG_VER_PATCH) 12 | -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/lib/libcurl_a.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spr-equinox/nfo_scraper/2d451b07201b3d8ce71e0a3e3962ca4bf6ffb762/nfo_scraper/3rdparty/lib/libcurl_a.lib -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/lib/libcurl_a_debug.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spr-equinox/nfo_scraper/2d451b07201b3d8ce71e0a3e3962ca4bf6ffb762/nfo_scraper/3rdparty/lib/libcurl_a_debug.lib -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/lib/pugixml.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spr-equinox/nfo_scraper/2d451b07201b3d8ce71e0a3e3962ca4bf6ffb762/nfo_scraper/3rdparty/lib/pugixml.lib -------------------------------------------------------------------------------- /nfo_scraper/3rdparty/lib/pugixml_debug.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spr-equinox/nfo_scraper/2d451b07201b3d8ce71e0a3e3962ca4bf6ffb762/nfo_scraper/3rdparty/lib/pugixml_debug.lib -------------------------------------------------------------------------------- /nfo_scraper/add_episodes_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "config.h" 5 | #include "fetch_episode.h" 6 | #include "fetch_seasons.h" 7 | #include "tools.h" 8 | #include "ui_add_episodes_dialog.h" 9 | 10 | class add_episodes_dialog : public QDialog { 11 | Q_OBJECT 12 | 13 | public: 14 | add_episodes_dialog(int id, config* cfg, QWidget* parent); 15 | ~add_episodes_dialog(); 16 | 17 | // id type name overview 18 | static fetch_episode::vec_remotes add_episodes(config* cfg, QWidget* parent = nullptr, const char* str = nullptr); 19 | 20 | private: 21 | int id; 22 | bool accepted; 23 | config* cfg; 24 | Ui_AddEpisodesDialog ui; 25 | fetch_episode::vec_remotes epis; 26 | std::vector seasons; 27 | private slots: 28 | void GetButton_Clicked(); 29 | void ConfirmButton_Clicked(); 30 | }; -------------------------------------------------------------------------------- /nfo_scraper/add_episodes_dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddEpisodesDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | 添加单集 15 | 16 | 17 | 18 | 19 | 20 | 请选择 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 0 34 | 0 35 | 36 | 37 | 38 | 获取 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | QAbstractItemView::SelectionMode::MultiSelection 48 | 49 | 50 | 51 | 52 | 53 | 54 | 确认 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /nfo_scraper/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "tools.h" 10 | class config { 11 | public: 12 | bool check_ext(const std::string &ext); 13 | bool check_ignore_directory(const std::string &name); 14 | bool check_ignore_file(const std::string &name); 15 | bool check_exist_path(const fs_path &path); 16 | std::string get_shows_name(const std::string &ext); 17 | std::string get_key(); 18 | char get_save_type(); 19 | fs_path get_save_path(); 20 | bool is_proxy(); 21 | bool is_incremental_update(); 22 | std::string proxy(); 23 | void set_exist_path(std::unordered_set &&path); 24 | config(const char *file); 25 | private: 26 | std::string key, proxy_addr; 27 | fs_path save_path; 28 | std::unordered_set exist_path; 29 | std::unordered_set media_exts; 30 | std::vector> reg_str; 31 | std::vector ignore_directory_reg, ignore_file_reg; 32 | bool use_proxy, incremental_update; 33 | char save_type; 34 | }; 35 | -------------------------------------------------------------------------------- /nfo_scraper/config.json: -------------------------------------------------------------------------------- 1 | { 2 | // 视频后缀名列表,用于识别视频文件,区分大小写 3 | "media_extension": [ 4 | ".mkv", 5 | ".mp4", 6 | ".m2ts" 7 | ], 8 | // 用来提取“搜索名称”的正则表达式,数字代表提取第n个子匹配(从1开始) 9 | "title_regex_expression": [ 10 | ["^([\\[\\(].*?[\\]\\)]\\[* *)*([^#\\[\\]\\.\\(\\)]*)+.*$", 2] 11 | ], 12 | // 忽略的路径的正则表达式 13 | "ignore_directory_expression": [ 14 | "BDMV" 15 | ], 16 | // 忽略的文件的正则表达式 17 | "ignore_file_expression": [ 18 | "NCOP", "NCED" 19 | ], 20 | // tmdb api 密钥,必填,否则无法使用 21 | // 申请链接 https://developer.themoviedb.org/docs/getting-started 22 | "tmdb_api_key": "", 23 | // 有需要的可以开启代理 24 | "using_proxy": true, 25 | "proxy_address": "http://127.0.0.1:7890", 26 | // 有两种模式:strm 和 nfo 27 | "save_type": "strm", 28 | // 如果是 strm 模式需要填写目标路径 29 | "save_path": "R:/媒体库", 30 | // 如果是 strm 模式可以开启增量更新,已经有 strm 文件的媒体会被忽略 31 | "incremental_update": true 32 | } -------------------------------------------------------------------------------- /nfo_scraper/fetch_shows.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "config.h" 10 | #include "ui_fetch_shows.h" 11 | 12 | class fetch_shows : public window_init_with_data { 13 | Q_OBJECT 14 | 15 | public: 16 | fetch_shows(config* cfg, window_init_with_data* next_window, QWidget* parent = nullptr); 17 | void init(void* pointer) override; 18 | ~fetch_shows(); 19 | 20 | private: 21 | class search_thread : public QRunnable { 22 | public: 23 | search_thread(std::string&& name, int row, config* cfg, QObject* object); 24 | 25 | private: 26 | std::string name; 27 | int row; 28 | QObject* obj; 29 | config* cfg; 30 | 31 | protected: 32 | void run(); 33 | }; 34 | class update_thread : public QRunnable { 35 | public: 36 | update_thread(int id, int row, bool type, config* cfg, QObject* object); 37 | 38 | private: 39 | int id, row; 40 | bool type; 41 | QObject* obj; 42 | config* cfg; 43 | 44 | protected: 45 | void run(); 46 | }; 47 | class write_thread : public QRunnable { 48 | public: 49 | write_thread(int id, bool type, fs_path path, config* cfg, QObject* object, shows_directories* shows); 50 | 51 | private: 52 | int id; 53 | bool type; 54 | fs_path path; 55 | QObject* obj; 56 | config* cfg; 57 | std::mutex lock; 58 | shows_directories* shows; 59 | 60 | protected: 61 | void run(); 62 | void write_nfo(); 63 | void write_strm(); 64 | }; 65 | void all_setEnable(bool status); 66 | library_directories library; 67 | shows_directories shows_path; 68 | vec_paths shows; 69 | Ui::fetch_showsClass ui; 70 | config* cfg; 71 | QMenu* menu; 72 | window_init_with_data* next_window; 73 | int running; 74 | Q_INVOKABLE void thread_return(QString result, int r, QString title, bool type, QString overview); 75 | Q_INVOKABLE void write_return(); 76 | Q_INVOKABLE int cover_check(const QString& title, const QString& content); 77 | private slots: 78 | void SearchSelected_Clicked(); 79 | void UpdateSelected_Clicked(); 80 | void WriteSelected_Clicked(); 81 | void Next_Clicked(); 82 | void RightMenu_Clicked(const QPoint& point); 83 | void RightMenuAction_Clicked(); 84 | void DialogSearchSelected_Clicked(); 85 | void Cell_DoubleClicked(int row, int column); 86 | }; 87 | -------------------------------------------------------------------------------- /nfo_scraper/input_paths.cpp: -------------------------------------------------------------------------------- 1 | #include "input_paths.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | input_paths::input_paths(window_init_with_data* next_window, QWidget* parent) 10 | : QMainWindow(parent), next_window(next_window) { 11 | ui.setupUi(this); 12 | connect(ui.Add, SIGNAL(clicked()), this, SLOT(Add_Clicked())); 13 | connect(ui.Remove, SIGNAL(clicked()), this, SLOT(Remove_Clicked())); 14 | connect(ui.Next, SIGNAL(clicked()), this, SLOT(Next_Clicked())); 15 | // connect(ui.Setting, SIGNAL(clicked()), this, SLOT(Setting_Clicked())); 16 | } 17 | 18 | input_paths::~input_paths() {} 19 | 20 | void input_paths::Add_Clicked() { 21 | QFileDialog* open = new QFileDialog(ui.Widget1); 22 | open->setAcceptMode(QFileDialog::AcceptOpen); 23 | open->setFileMode(QFileDialog::Directory); 24 | if (open->exec() != QDialog::Accepted) { 25 | spdlog::info("用户取消操作"); 26 | return; 27 | } 28 | for (auto&& it : open->selectedFiles()) { 29 | spdlog::info("添加文件夹:{}", it.toStdString()); 30 | ui.folderList->addItem(it); 31 | } 32 | } 33 | 34 | void input_paths::Remove_Clicked() { 35 | for (auto&& it : ui.folderList->selectedItems()) { 36 | spdlog::info("移除文件夹:{}", it->text().toStdString()); 37 | delete it; 38 | } 39 | } 40 | 41 | void input_paths::Next_Clicked() { 42 | vec_paths* search_paths = new vec_paths; 43 | const auto cnt = ui.folderList->count(); 44 | (*search_paths).reserve(cnt); 45 | for (int i = 0; i < cnt; ++i) 46 | (*search_paths).emplace_back(ui.folderList->item(i)->text().toStdWString()); 47 | spdlog::info("第一阶段结束"); 48 | close(); 49 | next_window->init(search_paths); 50 | destroy(); 51 | } 52 | 53 | void input_paths::Setting_Clicked() { 54 | // TODO 55 | } 56 | -------------------------------------------------------------------------------- /nfo_scraper/input_paths.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "tools.h" 7 | #include "ui_input_paths.h" 8 | 9 | class input_paths : public QMainWindow { 10 | Q_OBJECT 11 | 12 | public: 13 | input_paths(window_init_with_data *next_window, QWidget *parent = nullptr); 14 | ~input_paths(); 15 | 16 | private: 17 | Ui::input_pathsClass ui; 18 | window_init_with_data *next_window; 19 | 20 | private slots: 21 | void Add_Clicked(); 22 | void Remove_Clicked(); 23 | void Next_Clicked(); 24 | void Setting_Clicked(); 25 | }; 26 | -------------------------------------------------------------------------------- /nfo_scraper/input_paths.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spr-equinox/nfo_scraper/2d451b07201b3d8ce71e0a3e3962ca4bf6ffb762/nfo_scraper/input_paths.ico -------------------------------------------------------------------------------- /nfo_scraper/input_paths.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /nfo_scraper/input_paths.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "input_paths.ico" 2 | -------------------------------------------------------------------------------- /nfo_scraper/main.cpp: -------------------------------------------------------------------------------- 1 | #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) 2 | # include 3 | #endif 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "config.h" 10 | #include "fetch_episode.h" 11 | #include "fetch_seasons.h" 12 | #include "fetch_shows.h" 13 | #include "input_paths.h" 14 | #include "process_shows.h" 15 | #include "search_dialog.h" 16 | #include "write_ignore.h" 17 | 18 | const char version[] = "0.6-static"; 19 | 20 | int main(int argc, char *argv[]) { 21 | #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) 22 | SetConsoleCP(65001); 23 | SetConsoleOutputCP(65001); 24 | #endif 25 | config cfg("config.json"); 26 | if (cfg.get_save_type() == -1) { 27 | spdlog::error("保存方式初始化失败"); 28 | return -1; 29 | } 30 | QApplication a(argc, argv); 31 | curl_global_init(CURL_GLOBAL_ALL); 32 | spdlog::info("版本号:{}", version); 33 | spdlog::info("{}", curl_version()); 34 | write_ignore w6; 35 | fetch_episode w5(&cfg, &w6); 36 | fetch_seasons w4(&cfg, &w5); 37 | fetch_shows w3(&cfg, &w4); 38 | process_shows w2(&cfg, &w3); 39 | input_paths w1(&w2); 40 | w1.show(); 41 | a.exec(); 42 | curl_global_cleanup(); 43 | } 44 | -------------------------------------------------------------------------------- /nfo_scraper/process_shows.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "config.h" 11 | #include "ui_process_shows.h" 12 | 13 | class process_shows : public window_init_with_data { 14 | Q_OBJECT 15 | 16 | public: 17 | process_shows(config* cfg, window_init_with_data* next_window, QWidget* parent = nullptr); 18 | void init(void* pointer) override; 19 | ~process_shows(); 20 | 21 | private: 22 | class search_thread : public QThread { 23 | public: 24 | search_thread(process_shows* self); 25 | 26 | private: 27 | process_shows* self; 28 | 29 | protected: 30 | void run(); 31 | }* search; 32 | Ui::process_showsClass ui; 33 | vec_paths search_paths, ignore_paths; 34 | library_directories library; 35 | std::unordered_set exist_path; 36 | config* cfg; 37 | window_init_with_data* next_window; 38 | void dfs(const fs_path& now); 39 | private slots: 40 | void search_finished(); 41 | void Next_Clicked(); 42 | void CreateIgnore_Clicked(); 43 | }; 44 | -------------------------------------------------------------------------------- /nfo_scraper/qlist_widget_drag_drop.cpp: -------------------------------------------------------------------------------- 1 | #include "qlist_widget_drag_drop.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | QListWidgetDragDrop::QListWidgetDragDrop(QWidget* parent) 9 | : QListWidget(parent) { 10 | this->setAcceptDrops(true); 11 | } 12 | 13 | void QListWidgetDragDrop::dragEnterEvent(QDragEnterEvent* event) { 14 | event->acceptProposedAction(); 15 | } 16 | 17 | void QListWidgetDragDrop::dropEvent(QDropEvent* event) { 18 | // 不知道为什么,这个函数没有用 19 | if (event->mimeData()->hasUrls()) { 20 | QList files = event->mimeData()->urls(); 21 | for (auto&& it : files) { 22 | auto tmp = it.toLocalFile(); 23 | if (!QFileInfo(tmp).isDir()) continue; 24 | spdlog::info("拖入文件夹:{}", tmp.toStdString()); 25 | this->addItem(tmp); 26 | } 27 | } 28 | } 29 | 30 | void QListWidgetDragDrop::dragMoveEvent(QDragMoveEvent* event) { 31 | event->acceptProposedAction(); 32 | } 33 | -------------------------------------------------------------------------------- /nfo_scraper/qlist_widget_drag_drop.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class QListWidgetDragDrop : public QListWidget { 9 | Q_OBJECT 10 | 11 | public: 12 | QListWidgetDragDrop(QWidget* parent); 13 | ~QListWidgetDragDrop() = default; 14 | 15 | protected: 16 | void dragEnterEvent(QDragEnterEvent* event); 17 | void dropEvent(QDropEvent* event); 18 | void dragMoveEvent(QDragMoveEvent* event); 19 | }; -------------------------------------------------------------------------------- /nfo_scraper/search_dialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "config.h" 5 | #include "tools.h" 6 | #include "ui_search_dialog.h" 7 | class search_dialog : public QDialog { 8 | Q_OBJECT 9 | 10 | public: 11 | search_dialog(config* cfg, QWidget* parent = nullptr); 12 | ~search_dialog(); 13 | 14 | // id type name overview 15 | static std::tuple search_tvshow(config* cfg, QWidget* parent = nullptr, const char* str = nullptr); 16 | 17 | private: 18 | config* cfg; 19 | Ui_SearchDialog ui; 20 | std::vector > results; 21 | int result; 22 | private slots: 23 | void SearchButton_Clicked(); 24 | void ConfirmButton_Clicked(); 25 | void Cell_DoubleClicked(int row, int column); 26 | }; 27 | -------------------------------------------------------------------------------- /nfo_scraper/search_dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | SearchDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 424 10 | 502 11 | 12 | 13 | 14 | 搜索剧集 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 搜索 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | QAbstractItemView::EditTrigger::NoEditTriggers 35 | 36 | 37 | QAbstractItemView::SelectionMode::SingleSelection 38 | 39 | 40 | QAbstractItemView::SelectionBehavior::SelectRows 41 | 42 | 43 | QAbstractItemView::ScrollMode::ScrollPerPixel 44 | 45 | 46 | QAbstractItemView::ScrollMode::ScrollPerPixel 47 | 48 | 49 | 50 | 标题 51 | 52 | 53 | 54 | 55 | 编号 56 | 57 | 58 | 59 | 60 | 类型 61 | 62 | 63 | 64 | 65 | 简介 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 确定 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /nfo_scraper/tools.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | class config; 8 | 9 | using fs_path = std::filesystem::path; 10 | using vec_paths = std::vector; 11 | using shows_directories = std::map, std::pair>; 12 | using seasons_directories = std::map, std::pair>; 13 | using library_directories = std::unordered_map; 14 | 15 | std::string request(const char* url, config* cfg); 16 | bool create_directory_with_log(const fs_path& path); 17 | std::wstring utf8_to_wchar(const char* str, int len); 18 | void replace_illegal_char(std::wstring& str); 19 | 20 | class window_init_with_data : public QMainWindow { 21 | public: 22 | explicit window_init_with_data(QWidget* parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()) 23 | : QMainWindow(parent, flags){}; 24 | virtual void init(void* pointer) = 0; 25 | }; -------------------------------------------------------------------------------- /nfo_scraper/write_ignore.cpp: -------------------------------------------------------------------------------- 1 | #include "write_ignore.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | write_ignore::write_ignore(QWidget* parent) 10 | : window_init_with_data(parent) { 11 | ui.setupUi(this); 12 | connect(ui.Add, SIGNAL(clicked()), this, SLOT(Add_Clicked())); 13 | connect(ui.Remove, SIGNAL(clicked()), this, SLOT(Remove_Clicked())); 14 | connect(ui.Finished, SIGNAL(clicked()), this, SLOT(Finished_Clicked())); 15 | connect(ui.CreateIgnore, SIGNAL(clicked()), this, SLOT(CreateIgnore_Clicked())); 16 | } 17 | 18 | write_ignore::~write_ignore() {} 19 | 20 | void write_ignore::init(void* pointer) { 21 | show(); 22 | QApplication::processEvents(); 23 | for (auto&& it : *(vec_paths*)pointer) ui.folderList->addItem(QString::fromStdWString(it.generic_wstring())); 24 | delete (vec_paths*)pointer; 25 | } 26 | 27 | void write_ignore::CreateIgnore_Clicked() { 28 | ui.Widget1->setEnabled(false); 29 | for (auto&& it : ui.folderList->selectedItems()) { 30 | fs_path p(it->text().toStdWString()); 31 | p /= ".ignore"; 32 | if (std::filesystem::exists(p)) spdlog::info("文件 {} 已存在,跳过", p.generic_u8string()); 33 | else { 34 | std::FILE* f = nullptr; 35 | errno_t error_code = _wfopen_s(&f, p.generic_wstring().c_str(), L"w"); 36 | if (error_code) { 37 | spdlog::error("文件 {} 创建失败 错误信息:{}", p.generic_u8string(), std::strerror(error_code)); 38 | continue; 39 | } 40 | spdlog::info("已创建文件 {} ", p.generic_u8string()); 41 | if (f) fclose(f); // 如果没有 if 会 warning 42 | } 43 | QApplication::processEvents(); 44 | } 45 | ui.Widget1->setEnabled(true); 46 | } 47 | 48 | void write_ignore::Add_Clicked() { 49 | QFileDialog* open = new QFileDialog(ui.Widget1); 50 | open->setAcceptMode(QFileDialog::AcceptOpen); 51 | open->setFileMode(QFileDialog::Directory); 52 | if (open->exec() != QDialog::Accepted) { 53 | spdlog::info("用户取消操作"); 54 | return; 55 | } 56 | for (auto&& it : open->selectedFiles()) { 57 | spdlog::info("添加文件夹:{}", it.toStdString()); 58 | ui.folderList->addItem(it); 59 | } 60 | } 61 | 62 | void write_ignore::Remove_Clicked() { 63 | for (auto&& it : ui.folderList->selectedItems()) { 64 | spdlog::info("移除文件夹:{}", it->text().toStdString()); 65 | delete it; 66 | } 67 | } 68 | 69 | void write_ignore::Finished_Clicked() { 70 | close(); 71 | spdlog::info("处理完毕 您辛苦了~"); 72 | destroy(); 73 | } 74 | -------------------------------------------------------------------------------- /nfo_scraper/write_ignore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "ui_write_ignore.h" 8 | #include "tools.h" 9 | 10 | class write_ignore : public window_init_with_data { 11 | Q_OBJECT 12 | 13 | public: 14 | write_ignore(QWidget* parent = nullptr); 15 | ~write_ignore(); 16 | void init(void* pointer) override; 17 | private: 18 | Ui::write_ignoreClass ui; 19 | 20 | private slots: 21 | void Add_Clicked(); 22 | void Remove_Clicked(); 23 | void Finished_Clicked(); 24 | void CreateIgnore_Clicked(); 25 | }; 26 | --------------------------------------------------------------------------------