#ifndef BASE_CHECK_OP_H_
#define BASE_CHECK_OP_H_
#include <cstddef>
#include <string>
#include <string_view>
#include <type_traits>
#include "base/base_export.h"
#include "base/check.h"
#include "base/dcheck_is_on.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/strings/to_string.h"
#include "base/types/supports_ostream_operator.h"
namespace base {
template <class Char>
class basic_cstring_view;
}
namespace logging {
BASE_EXPORT char* CheckOpValueStr(int v);
BASE_EXPORT char* CheckOpValueStr(unsigned v);
BASE_EXPORT char* CheckOpValueStr(long v);
BASE_EXPORT char* CheckOpValueStr(unsigned long v);
BASE_EXPORT char* CheckOpValueStr(long long v);
BASE_EXPORT char* CheckOpValueStr(unsigned long long v);
BASE_EXPORT char* CheckOpValueStr(const void* v);
BASE_EXPORT char* CheckOpValueStr(std::nullptr_t v);
BASE_EXPORT char* CheckOpValueStr(double v);
BASE_EXPORT char* CheckOpValueStr(const std::string& v);
BASE_EXPORT char* CheckOpValueStr(std::string_view v);
BASE_EXPORT char* CheckOpValueStr(base::basic_cstring_view<char> v);
BASE_EXPORT char* StreamValToStr(const void* v,
void (*stream_func)(std::ostream&,
const void*));
#ifdef __has_builtin
#define SUPPORTS_BUILTIN_ADDRESSOF …
#else
#define SUPPORTS_BUILTIN_ADDRESSOF …
#endif
template <typename T>
requires(base::internal::SupportsOstreamOperator<const T&> &&
!std::is_function_v<std::remove_pointer_t<T>>)
inline char* CheckOpValueStr(const T& v) { … }
#undef SUPPORTS_BUILTIN_ADDRESSOF
template <typename T>
requires(!base::internal::SupportsOstreamOperator<const T&> &&
base::internal::SupportsToString<const T&>)
inline char* CheckOpValueStr(const T& v) { … }
template <typename T>
requires(std::is_function_v<std::remove_pointer_t<T>>)
inline char* CheckOpValueStr(const T& v) { … }
template <typename T>
requires(!base::internal::SupportsOstreamOperator<const T&> &&
std::is_enum_v<T>)
inline char* CheckOpValueStr(const T& v) { … }
BASE_EXPORT char* CreateCheckOpLogMessageString(const char* expr_str,
char* v1_str,
char* v2_str);
#define CHECK_OP_FUNCTION_IMPL(check_failure_function, name, op, val1, val2, \
...) …
#if !CHECK_WILL_STREAM()
#define CHECK_OP …
#else
#define CHECK_OP(name, op, val1, val2, ...) …
#endif
#define DEFINE_CHECK_OP_IMPL …
DEFINE_CHECK_OP_IMPL …
DEFINE_CHECK_OP_IMPL …
DEFINE_CHECK_OP_IMPL …
DEFINE_CHECK_OP_IMPL …
DEFINE_CHECK_OP_IMPL …
DEFINE_CHECK_OP_IMPL …
#undef DEFINE_CHECK_OP_IMPL
#define CHECK_EQ(val1, val2, ...) …
#define CHECK_NE(val1, val2, ...) …
#define CHECK_LE(val1, val2, ...) …
#define CHECK_LT(val1, val2, ...) …
#define CHECK_GE(val1, val2, ...) …
#define CHECK_GT(val1, val2, ...) …
#if DCHECK_IS_ON()
#define DCHECK_OP(name, op, val1, val2) …
#else
#define DCHECK_OP …
#endif
#define DCHECK_EQ(val1, val2) …
#define DCHECK_NE(val1, val2) …
#define DCHECK_LE(val1, val2) …
#define DCHECK_LT(val1, val2) …
#define DCHECK_GE(val1, val2) …
#define DCHECK_GT(val1, val2) …
#define DUMP_WILL_BE_CHECK_OP(name, op, val1, val2) …
#define DUMP_WILL_BE_CHECK_EQ(val1, val2) …
#define DUMP_WILL_BE_CHECK_NE(val1, val2) …
#define DUMP_WILL_BE_CHECK_LE(val1, val2) …
#define DUMP_WILL_BE_CHECK_LT(val1, val2) …
#define DUMP_WILL_BE_CHECK_GE(val1, val2) …
#define DUMP_WILL_BE_CHECK_GT(val1, val2) …
}
#endif