1#ifndef LIBFILEZILLA_BASIC_TLS_PARAMS_HEADER
2#define LIBFILEZILLA_BASIC_TLS_PARAMS_HEADER
18template <
typename T,
typename Tag,
typename Policy>
21template <
typename T,
typename Tag>
24template <
typename T,
typename Tag,
typename Policy>
27template <
typename T,
typename Tag,
typename Policy>
34 template <
typename U = T, std::enable_if_t<std::is_default_constructible_v<U>>* =
nullptr>
39 template <
typename U, std::enable_if_t<std::is_constructible_v<T, U>>* =
nullptr>
44 template <
typename U,
typename V = std::remove_cv_t<std::remove_reference_t<U>>, std::enable_if_t<
45 !std::is_same_v<V, basic_tls_param> &&
46 is_same_kind_of_basic_tls_param<V, Tag>::value>* =
nullptr>
51 explicit operator bool()
const
53 return Policy::is_valid(value);
58 return Policy::is_valid(value);
61 template <
typename U,
typename P>
67 template <
typename U,
typename P>
73 template <
typename U,
typename P>
79 template <
typename U,
typename P>
85 template <
typename U,
typename P>
91 template <
typename U,
typename P>
102 template <
typename T>
128template <
typename B,
typename F,
typename P>
134template <
typename B,
typename F,
typename P>
137template <
typename B,
typename F,
typename P>
152 return std::get_if<blob_type>(&value);
157 return std::get_if<filepath_type>(&value);
162 return std::get_if<pkcs11url_type>(&value);
167 return std::get_if<blob_type>(&value);
172 return std::get_if<filepath_type>(&value);
177 return std::get_if<pkcs11url_type>(&value);
195 return fzT(
"pkcs11:<invalid>");
204 return fzT(
"blob:<invalid>");
208 return std::visit(
visitor(), value);
217 template <
typename T, std::enable_if_t<std::is_constructible_v<variant_type, T>>* =
nullptr>
222 template <
typename T,
typename U = std::remove_cv_t<std::remove_reference_t<T>>, std::enable_if_t<
223 !std::is_same_v<U, basic_tls_param_variant>
224 && is_basic_tls_param_variant<U>::value>* =
nullptr>
232 template <
typename T, std::enable_if_t<!std::is_same_v<T, basic_tls_param_variant> && is_basic_tls_param_variant<T>::value>* =
nullptr>
239 explicit operator bool()
const
241 return std::visit([](
auto &&
v) {
251 template <
typename F2,
typename P2,
typename B2>
257 template <
typename F2,
typename P2,
typename B2>
263 template <
typename F2,
typename P2,
typename B2>
269 template <
typename F2,
typename P2,
typename B2>
275 template <
typename F2,
typename P2,
typename B2>
281 template <
typename F2,
typename P2,
typename B2>
A function that acts like std::forward, but applies the value category of its first template paramete...
Collection of cryptographic hash and MAC functions.
The namespace used by libfilezilla.
Definition apply.hpp:17
constexpr detail::apply_value_category_t< T, U > forward_like(U &&u) noexcept
applies the value category of T to u, so that u can be perfectly forwarded as-if it were of type T.
Definition forward_like.hpp:31
std::vector< uint8_t > md5(std::string_view const &data)
Standard MD5.
std::wstring native_string
A string in the system's native character type and encoding. Note: This typedef changes depending on...
Definition string.hpp:36
bool dispatch(event_base const &ev, F &&f)
Dispatch for simple_event<> based events to simple functors.
Definition event_handler.hpp:199
bool operator==(symmetric_key const &lhs, symmetric_key const &rhs)
Side-channel safe comparison.
std::string sprintf(std::string_view const &fmt, Args &&... args)
A simple type-safe sprintf replacement.
Definition format.hpp:456
bool starts_with(String const &s, String const &beginning)
Tests whether the first string starts with the second string.
Definition string.hpp:759
native_string to_native(std::string_view const &in)
Converts std::string to native_string.
String types and assorted functions.
#define fzT(x)
Macro for a string literal in system-native character type. Note: Macro definition changes depending...
Definition string.hpp:259