Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
safe_conversions.h File Reference

(08e24b2ba6847221abd35e9b994206b764d6b322)

#include <stddef.h>
#include <cmath>
#include <limits>
#include <type_traits>
#include "core/fxcrt/numerics/safe_conversions_impl.h"
Include dependency graph for safe_conversions.h:

Go to the source code of this file.

Classes

struct  pdfium::internal::SaturateFastAsmOp< Dst, Src >
struct  pdfium::internal::IsValueInRangeFastOp< Dst, Src, Enable >
struct  pdfium::internal::IsValueInRangeFastOp< Dst, Src, typename std::enable_if< std::is_integral< Dst >::value &&std::is_integral< Src >::value &&std::is_signed< Dst >::value &&std::is_signed< Src >::value &&!IsTypeInRangeForNumericType< Dst, Src >::value >::type >
struct  pdfium::internal::IsValueInRangeFastOp< Dst, Src, typename std::enable_if< std::is_integral< Dst >::value &&std::is_integral< Src >::value &&!std::is_signed< Dst >::value &&std::is_signed< Src >::value &&!IsTypeInRangeForNumericType< Dst, Src >::value >::type >
struct  pdfium::internal::SaturationDefaultLimits< T >
struct  pdfium::internal::SaturateFastOp< Dst, Src, Enable >
struct  pdfium::internal::SaturateFastOp< Dst, Src, typename std::enable_if< std::is_integral< Src >::value &&std::is_integral< Dst >::value &&SaturateFastAsmOp< Dst, Src >::is_supported >::type >
struct  pdfium::internal::SaturateFastOp< Dst, Src, typename std::enable_if< std::is_integral< Src >::value &&std::is_integral< Dst >::value &&!SaturateFastAsmOp< Dst, Src >::is_supported >::type >
struct  pdfium::internal::IsNumericRangeContained< Dst, Src, Enable >
struct  pdfium::internal::IsNumericRangeContained< Dst, Src, typename std::enable_if< ArithmeticOrUnderlyingEnum< Dst >::value &&ArithmeticOrUnderlyingEnum< Src >::value >::type >
class  pdfium::internal::StrictNumeric< T >
struct  pdfium::IsTypeInRangeForNumericType< Dst, Src >
class  pdfium::StrictNumeric< T >

Namespaces

namespace  pdfium
namespace  pdfium::internal

Macros

#define BASE_HAS_OPTIMIZED_SAFE_CONVERSIONS   (0)
#define BASE_NUMERIC_COMPARISON_OPERATORS(CLASS, NAME, OP)

Typedefs

using pdfium::SizeT = StrictNumeric<size_t>

Functions

template<typename Dst, typename Src>
constexpr bool pdfium::internal::IsValueInRangeForNumericType (Src value)
template<typename Dst, class CheckHandler = internal::CheckOnFailure, typename Src>
constexpr Dst pdfium::internal::checked_cast (Src value)
template<typename Dst, template< typename > class S, typename Src>
constexpr Dst pdfium::internal::saturated_cast_impl (Src value, RangeCheck constraint)
template<typename Dst, template< typename > class SaturationHandler = SaturationDefaultLimits, typename Src>
constexpr Dst pdfium::internal::saturated_cast (Src value)
template<typename Dst, typename Src>
constexpr Dst pdfium::internal::strict_cast (Src value)
template<typename T>
constexpr StrictNumeric< typename UnderlyingType< T >::typepdfium::internal::MakeStrictNum (const T value)
template<typename Dst = int, typename Src, typename = std::enable_if_t<std::is_integral<Dst>::value && std::is_floating_point<Src>::value>>
Dst pdfium::ClampFloor (Src value)
template<typename Dst = int, typename Src, typename = std::enable_if_t<std::is_integral<Dst>::value && std::is_floating_point<Src>::value>>
Dst pdfium::ClampCeil (Src value)
template<typename Dst = int, typename Src, typename = std::enable_if_t<std::is_integral<Dst>::value && std::is_floating_point<Src>::value>>
Dst pdfium::ClampRound (Src value)
template<typename Src>
constexpr std::make_signed< typenameinternal::UnderlyingType< Src >::type >::type pdfium::as_signed (const Src value)
template<typename Src>
constexpr std::make_unsigned< typenameinternal::UnderlyingType< Src >::type >::type pdfium::as_unsigned (const Src value)
template<typename Dst, class CheckHandler = internal::CheckOnFailure, typename Src>
constexpr Dst pdfium::checked_cast (Src value)
template<typename Dst, typename Src>
constexpr bool pdfium::IsValueInRangeForNumericType (Src value)
template<typename T, typename std::enable_if< std::is_signed< T >::value >::type * = nullptr>
constexpr bool pdfium::IsValueNegative (T value)
template<typename T>
constexpr StrictNumeric< typename UnderlyingType< T >::typepdfium::MakeStrictNum (const T value)
template<typename T>
constexpr std::make_unsigned< T >::type pdfium::SafeUnsignedAbs (T value)
template<typename Dst, template< typename > class SaturationHandler = SaturationDefaultLimits, typename Src>
constexpr Dst pdfium::saturated_cast (Src value)
template<typename Dst, typename Src>
constexpr Dst pdfium::strict_cast (Src value)

Macro Definition Documentation

◆ BASE_HAS_OPTIMIZED_SAFE_CONVERSIONS

#define BASE_HAS_OPTIMIZED_SAFE_CONVERSIONS   (0)

Definition at line 20 of file safe_conversions.h.

◆ BASE_NUMERIC_COMPARISON_OPERATORS

#define BASE_NUMERIC_COMPARISON_OPERATORS ( CLASS,
NAME,
OP )
Value:
template <typename L, typename R, \
typename std::enable_if< \
internal::Is##CLASS##Op<L, R>::value>::type* = nullptr> \
constexpr bool operator OP(const L lhs, const R rhs) { \
typename UnderlyingType<R>::type>(lhs, rhs); \
}
bool SafeCompare(const float &x, const float &y)
#define OP(a, b)
GLenum type

Definition at line 326 of file safe_conversions.h.