诸暨麻将添加redis
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

112 rivejä
3.1 KiB

  1. // Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
  2. // Distributed under the MIT License (http://opensource.org/licenses/MIT)
  3. #pragma once
  4. #include <spdlog/common.h>
  5. #include <ctime> // std::time_t
  6. namespace spdlog {
  7. namespace details {
  8. namespace os {
  9. spdlog::log_clock::time_point now() SPDLOG_NOEXCEPT;
  10. std::tm localtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT;
  11. std::tm localtime() SPDLOG_NOEXCEPT;
  12. std::tm gmtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT;
  13. std::tm gmtime() SPDLOG_NOEXCEPT;
  14. // eol definition
  15. #if !defined(SPDLOG_EOL)
  16. #ifdef _WIN32
  17. #define SPDLOG_EOL "\r\n"
  18. #else
  19. #define SPDLOG_EOL "\n"
  20. #endif
  21. #endif
  22. SPDLOG_CONSTEXPR static const char *default_eol = SPDLOG_EOL;
  23. // folder separator
  24. #ifdef _WIN32
  25. static const char folder_sep = '\\';
  26. #else
  27. SPDLOG_CONSTEXPR static const char folder_sep = '/';
  28. #endif
  29. #ifdef SPDLOG_PREVENT_CHILD_FD
  30. void prevent_child_fd(FILE *f);
  31. #endif
  32. // fopen_s on non windows for writing
  33. bool fopen_s(FILE **fp, const filename_t &filename, const filename_t &mode);
  34. // Remove filename. return 0 on success
  35. int remove(const filename_t &filename) SPDLOG_NOEXCEPT;
  36. // Remove file if exists. return 0 on success
  37. // Note: Non atomic (might return failure to delete if concurrently deleted by other process/thread)
  38. int remove_if_exists(const filename_t &filename) SPDLOG_NOEXCEPT;
  39. int rename(const filename_t &filename1, const filename_t &filename2) SPDLOG_NOEXCEPT;
  40. // Return if file exists.
  41. bool path_exists(const filename_t &filename) SPDLOG_NOEXCEPT;
  42. // Return file size according to open FILE* object
  43. size_t filesize(FILE *f);
  44. // Return utc offset in minutes or throw spdlog_ex on failure
  45. int utc_minutes_offset(const std::tm &tm = details::os::localtime());
  46. // Return current thread id as size_t
  47. // It exists because the std::this_thread::get_id() is much slower(especially
  48. // under VS 2013)
  49. size_t _thread_id() SPDLOG_NOEXCEPT;
  50. // Return current thread id as size_t (from thread local storage)
  51. size_t thread_id() SPDLOG_NOEXCEPT;
  52. // This is avoid msvc issue in sleep_for that happens if the clock changes.
  53. // See https://github.com/gabime/spdlog/issues/609
  54. void sleep_for_millis(int milliseconds) SPDLOG_NOEXCEPT;
  55. std::string filename_to_str(const filename_t &filename);
  56. int pid() SPDLOG_NOEXCEPT;
  57. // Determine if the terminal supports colors
  58. // Source: https://github.com/agauniyal/rang/
  59. bool is_color_terminal() SPDLOG_NOEXCEPT;
  60. // Determine if the terminal attached
  61. // Source: https://github.com/agauniyal/rang/
  62. bool in_terminal(FILE *file) SPDLOG_NOEXCEPT;
  63. #if (defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)) && defined(_WIN32)
  64. void wstr_to_utf8buf(wstring_view_t wstr, memory_buf_t &target);
  65. #endif
  66. // Return directory name from given path or empty string
  67. // "abc/file" => "abc"
  68. // "abc/" => "abc"
  69. // "abc" => ""
  70. // "abc///" => "abc//"
  71. filename_t dir_name(filename_t path);
  72. // Create a dir from the given path.
  73. // Return true if succeeded or if this dir already exists.
  74. bool create_dir(filename_t path);
  75. } // namespace os
  76. } // namespace details
  77. } // namespace spdlog
  78. #ifdef SPDLOG_HEADER_ONLY
  79. #include "os-inl.h"
  80. #endif