1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00
SqMod/vendor/CPR/include/cpr/timeout.h
Sandu Liviu Catalin 9298065cef Update WIP discord and some vendors.
CPR has features disabled and PCRE is fully disabled until updated to new code.
2023-08-05 21:31:33 +03:00

28 lines
829 B
C++

#ifndef CPR_TIMEOUT_H
#define CPR_TIMEOUT_H
#include <chrono>
#include <cstdint>
namespace cpr {
class Timeout {
public:
// NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
Timeout(const std::chrono::milliseconds& duration) : ms{duration} {}
// NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
Timeout(const std::int32_t& milliseconds) : Timeout{std::chrono::milliseconds(milliseconds)} {}
// NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
Timeout(const std::chrono::seconds& duration) : ms{std::chrono::milliseconds(duration).count()} {}
// No way around since curl uses a long here.
// NOLINTNEXTLINE(google-runtime-int)
long Milliseconds() const;
std::chrono::milliseconds ms;
};
} // namespace cpr
#endif