ZeroErr
Loading...
Searching...
No Matches
zeroerr::detail Namespace Reference

Classes

class  MessageBuilder
class  XmlEncode
class  XmlWriter
struct  context_helper
struct  context_helper< T, true >
struct  context_helper< T, false >
struct  FunctionDecomposition
 FunctionDecomposition is a meta function to decompose the function type. The ValueType and numOfArgs will be the result of the decomposition. More...
struct  memfun_type
struct  memfun_type< Ret(Class::*)(Args...) const >
struct  ComparisonLhs
class  TextBuffer
class  TextStream
struct  DiagnosticValue
class  Mutex
class  LockGuard
struct  always_false
struct  always_true
struct  seq
struct  gen_seq
struct  gen_seq< 0, Is... >
struct  is_specialization
struct  is_specialization< Ref< Args... >, Ref >
struct  is_streamable
struct  is_streamable< S, T, has_stream_operator< S, T > >
struct  is_container
struct  is_container< T, has_begin_end< T > >
struct  is_associative_container
struct  is_associative_container< T, has_begin_end_find_insert< T > >
struct  is_string_like
struct  is_string_like< T, void_t< typename T::traits_type::char_type, decltype(std::declval< const T & >().data()), decltype(std::declval< const T & >().size())> >
struct  is_string_like< zeroerr::String >
struct  is_string
struct  is_complex
struct  is_complex< T, void_t< decltype(std::declval< const T & >().real()), decltype(std::declval< const T & >().imag())> >
struct  is_pointer_like
struct  is_pointer_like< T, void_t< decltype(std::declval< const T & >().get())> >
struct  is_weak_pointer_like
struct  is_weak_pointer_like< T, void_t< decltype(std::declval< const T & >().lock())> >
struct  has_tuple_get
struct  has_tuple_get< T, seq< I... >, void_t< decltype(tuple_get< I >(std::declval< const T & >()))... > >
struct  is_tuple_like
struct  is_tuple_like< T, void_t< decltype(std::tuple_size< T >::value)> >
struct  is_complete_type
struct  is_complete_type< T, decltype(void(sizeof(T)))>
struct  is_indexable_non_pointer
struct  is_indexable_non_pointer< T, void_t< decltype(std::declval< const T & >()[0])> >
struct  is_array_dispatch
struct  is_array_dispatch< T, true >
struct  is_array
struct  is_modifiable
struct  is_modifiable< T, void_t< decltype(T().begin(), T().end(), T().size(), T().insert(T().end(), std::declval< typename T::value_type >()), T().erase(T().begin()),(void) 0)> >
struct  ele_type_is_pair
struct  ele_type_is_pair< T, has_pair_type< T > >
struct  to_store_type
struct  to_store_type< const char * >
struct  to_store_type< const char(&)[]>
struct  to_store_type< T &, is_not_array< T > >
struct  to_store_type< T && >
struct  visit_impl
struct  visit_impl< 0 >
struct  visit2_impl
struct  visit2_impl< 0 >
struct  has_extension
 has_extension is a type trait to check if user defined PrinterExt for a type More...
struct  has_extension< T, has_printer_ext< T > >
struct  StringLike
struct  regTest
 regTest is a class that is used to register the test case. It will be used as global variables and the constructor will be called to register the test case. More...
struct  regReporter
 regReporter is a class that is used to register the reporter. It will be used as global variables and the constructor will be called to register the reporter. More...

Typedefs

using uchar = unsigned char
template<typename T>
using FunctionDecompositionT = decltype(FunctionDecompositionImpl(std::declval<T>()))
template<typename... Ts>
using void_t = void
template<typename S, typename T>
using has_stream_operator = void_t<decltype(std::declval<S&>() << std::declval<const T&>())>
template<typename T>
using has_begin_end
template<typename T>
using has_begin_end_find_insert
template<typename T>
using has_pair_type
template<typename T>
using is_not_array = typename std::enable_if<!std::is_array<T>::value>::type
template<typename T>
using to_store_type_t = typename to_store_type<T>::type
template<typename T>
using has_printer_ext

Functions

zeroerr::String assertionText (const zeroerr::String &condition, const zeroerr::String &message, const char *file, unsigned line)
zeroerr::String valueText (DiagnosticValue value)
zeroerr::String comparisonText (const zeroerr::String &prefix, DiagnosticValue lhs, const char *op, DiagnosticValue rhs, bool &result)
zeroerr::String formatText (const char *fmt, const DiagnosticValue *values, std::size_t count, std::size_t *ends)
zeroerr::String joinDiagnostic (const zeroerr::String &lhs, const char *op, const zeroerr::String &rhs)
std::set< TestCase > & getTestSet (TestType type)
std::ostream & operator<< (std::ostream &os, const XmlEncode &xmlEncode)
template<typename T>
void doNotOptimizeAway (const T &val)
template<typename T>
void doNotOptimizeAway (T &val)
template<typename... Args>
FunctionDecomposition< typename std::decay< Args >::type... > FunctionDecompositionImpl (void(*)(Args...))
template<typename... Args>
FunctionDecomposition< typename std::decay< Args >::type... > FunctionDecompositionImpl (std::function< void(Args...)>)
template<typename F>
memfun_type< decltype(&F::operator())>::ret_type FunctionDecompositionImpl (F)
template<class L>
ComparisonLhs< L > makeComparisonLhs (const L &lhs, Printer &printer)
template<std::size_t I>
void get ()=delete
template<std::size_t I, typename T>
auto tuple_get (T &&value) -> decltype(get< I >(std::forward< T >(value)))
template<typename F, typename T>
void visit_at (T &tup, size_t idx, F &&fun)
template<typename F, typename T1, typename T2>
void visit2_at (T1 &tup1, T2 &tup2, size_t idx, F &&fun)
template<typename T, unsigned... I>
zeroerr::String gen_str (const char *msg, const T &args, seq< I... >)
template<typename T>
zeroerr::String gen_str (const char *msg, const T &, seq<>)
template<typename T>
void printDiagnosticValue (Printer &printer, const void *value)
template<typename T>
DiagnosticValue makeDiagnosticValue (T &value)
void applyFormat (std::ostream &stream, const StringBuffer::Format &f)
void saveFormat (StringBuffer &buffer, const std::ostream &stream)
template<class T>
StringBuffer & standardInsert (StringBuffer &buffer, const T &value)

Typedef Documentation

◆ FunctionDecompositionT

template<typename T>
using zeroerr::detail::FunctionDecompositionT = decltype(FunctionDecompositionImpl(std::declval<T>()))

◆ has_begin_end

template<typename T>
using zeroerr::detail::has_begin_end
Initial value:
decltype(std::declval<const T&>().end()),
decltype(*std::declval<decltype(std::declval<const T&>().begin())&>()),
decltype(++std::declval<decltype(std::declval<const T&>().begin())&>()),
decltype(std::declval<const T&>().begin() != std::declval<const T&>().end()),
decltype(std::declval<const T&>().begin() == std::declval<const T&>().end())>
void void_t
Definition typetraits.h:55

◆ has_begin_end_find_insert

template<typename T>
using zeroerr::detail::has_begin_end_find_insert
Initial value:
void_t<decltype(std::declval<T>().begin()), decltype(std::declval<T>().end()),
decltype(std::declval<T>().find(std::declval<typename T::key_type>())),
decltype(std::declval<T>().insert(std::declval<typename T::value_type>()))>

◆ has_pair_type

template<typename T>
using zeroerr::detail::has_pair_type
Initial value:
decltype((*std::declval<const T&>().begin()).second)>

◆ has_printer_ext

template<typename T>
using zeroerr::detail::has_printer_ext
Initial value:
rank is a helper class for Printer to define the priority of overloaded functions.
Definition typetraits.h:43

◆ has_stream_operator

template<typename S, typename T>
using zeroerr::detail::has_stream_operator = void_t<decltype(std::declval<S&>() << std::declval<const T&>())>

◆ is_not_array

template<typename T>
using zeroerr::detail::is_not_array = typename std::enable_if<!std::is_array<T>::value>::type

◆ to_store_type_t

template<typename T>
using zeroerr::detail::to_store_type_t = typename to_store_type<T>::type

◆ uchar

using zeroerr::detail::uchar = unsigned char

◆ void_t

template<typename... Ts>
using zeroerr::detail::void_t = void

Function Documentation

◆ applyFormat()

void zeroerr::detail::applyFormat ( std::ostream & stream,
const StringBuffer::Format & f )
inline

◆ assertionText()

zeroerr::String zeroerr::detail::assertionText ( const zeroerr::String & condition,
const zeroerr::String & message,
const char * file,
unsigned line )

◆ comparisonText()

zeroerr::String zeroerr::detail::comparisonText ( const zeroerr::String & prefix,
DiagnosticValue lhs,
const char * op,
DiagnosticValue rhs,
bool & result )

◆ doNotOptimizeAway() [1/2]

template<typename T>
void zeroerr::detail::doNotOptimizeAway ( const T & val)

◆ doNotOptimizeAway() [2/2]

template<typename T>
void zeroerr::detail::doNotOptimizeAway ( T & val)

◆ formatText()

zeroerr::String zeroerr::detail::formatText ( const char * fmt,
const DiagnosticValue * values,
std::size_t count,
std::size_t * ends )

◆ FunctionDecompositionImpl() [1/3]

template<typename F>
memfun_type< decltype(&F::operator())>::ret_type zeroerr::detail::FunctionDecompositionImpl ( F )

◆ FunctionDecompositionImpl() [2/3]

template<typename... Args>
FunctionDecomposition< typename std::decay< Args >::type... > zeroerr::detail::FunctionDecompositionImpl ( std::function< void(Args...)> )

◆ FunctionDecompositionImpl() [3/3]

template<typename... Args>
FunctionDecomposition< typename std::decay< Args >::type... > zeroerr::detail::FunctionDecompositionImpl ( void(*  )(Args...))

◆ gen_str() [1/2]

template<typename T>
zeroerr::String zeroerr::detail::gen_str ( const char * msg,
const T & ,
seq<>  )

◆ gen_str() [2/2]

template<typename T, unsigned... I>
zeroerr::String zeroerr::detail::gen_str ( const char * msg,
const T & args,
seq< I... >  )

◆ get()

template<std::size_t I>
void zeroerr::detail::get ( )
delete

◆ getTestSet()

std::set< TestCase > & zeroerr::detail::getTestSet ( TestType type)

◆ joinDiagnostic()

zeroerr::String zeroerr::detail::joinDiagnostic ( const zeroerr::String & lhs,
const char * op,
const zeroerr::String & rhs )

◆ makeComparisonLhs()

template<class L>
ComparisonLhs< L > zeroerr::detail::makeComparisonLhs ( const L & lhs,
Printer & printer )

◆ makeDiagnosticValue()

template<typename T>
DiagnosticValue zeroerr::detail::makeDiagnosticValue ( T & value)

◆ operator<<()

std::ostream & zeroerr::detail::operator<< ( std::ostream & os,
const XmlEncode & xmlEncode )

◆ printDiagnosticValue()

template<typename T>
void zeroerr::detail::printDiagnosticValue ( Printer & printer,
const void * value )

◆ saveFormat()

void zeroerr::detail::saveFormat ( StringBuffer & buffer,
const std::ostream & stream )
inline

◆ standardInsert()

template<class T>
StringBuffer & zeroerr::detail::standardInsert ( StringBuffer & buffer,
const T & value )

◆ tuple_get()

template<std::size_t I, typename T>
auto zeroerr::detail::tuple_get ( T && value) ->decltype(get< I >(std::forward< T >(value)))

◆ valueText()

zeroerr::String zeroerr::detail::valueText ( DiagnosticValue value)

◆ visit2_at()

template<typename F, typename T1, typename T2>
void zeroerr::detail::visit2_at ( T1 & tup1,
T2 & tup2,
size_t idx,
F && fun )

◆ visit_at()

template<typename F, typename T>
void zeroerr::detail::visit_at ( T & tup,
size_t idx,
F && fun )