Xmipp  v3.23.11-Nereus
Public Member Functions | List of all members
testing::Message Class Reference

#include <gtest-message.h>

Public Member Functions

 Message ()
 
 Message (const Message &msg)
 
 Message (const char *str)
 
template<typename T >
Messageoperator<< (const T &val)
 
template<typename T >
Messageoperator<< (T *const &pointer)
 
Messageoperator<< (BasicNarrowIoManip val)
 
Messageoperator<< (bool b)
 
Messageoperator<< (const wchar_t *wide_c_str)
 
Messageoperator<< (wchar_t *wide_c_str)
 
std::string GetString () const
 

Detailed Description

Definition at line 94 of file gtest-message.h.

Constructor & Destructor Documentation

◆ Message() [1/3]

testing::Message::Message ( )

◆ Message() [2/3]

testing::Message::Message ( const Message msg)
inline

Definition at line 105 of file gtest-message.h.

105  : ss_(new ::std::stringstream) { // NOLINT
106  *ss_ << msg.GetString();
107  }

◆ Message() [3/3]

testing::Message::Message ( const char *  str)
inlineexplicit

Definition at line 110 of file gtest-message.h.

110  : ss_(new ::std::stringstream) {
111  *ss_ << str;
112  }

Member Function Documentation

◆ GetString()

std::string testing::Message::GetString ( ) const

◆ operator<<() [1/6]

template<typename T >
Message& testing::Message::operator<< ( const T &  val)
inline

Definition at line 116 of file gtest-message.h.

116  {
117  // Some libraries overload << for STL containers. These
118  // overloads are defined in the global namespace instead of ::std.
119  //
120  // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
121  // overloads are visible in either the std namespace or the global
122  // namespace, but not other namespaces, including the testing
123  // namespace which Google Test's Message class is in.
124  //
125  // To allow STL containers (and other types that has a << operator
126  // defined in the global namespace) to be used in Google Test
127  // assertions, testing::Message must access the custom << operator
128  // from the global namespace. With this using declaration,
129  // overloads of << defined in the global namespace and those
130  // visible via Koenig lookup are both exposed in this function.
131  using ::operator<<;
132  *ss_ << val;
133  return *this;
134  }

◆ operator<<() [2/6]

template<typename T >
Message& testing::Message::operator<< ( T *const &  pointer)
inline

Definition at line 150 of file gtest-message.h.

150  { // NOLINT
151  if (pointer == nullptr) {
152  *ss_ << "(null)";
153  } else {
154  *ss_ << pointer;
155  }
156  return *this;
157  }

◆ operator<<() [3/6]

Message& testing::Message::operator<< ( BasicNarrowIoManip  val)
inline

Definition at line 165 of file gtest-message.h.

165  {
166  *ss_ << val;
167  return *this;
168  }

◆ operator<<() [4/6]

Message& testing::Message::operator<< ( bool  b)
inline

Definition at line 171 of file gtest-message.h.

171 { return *this << (b ? "true" : "false"); }
doublereal * b

◆ operator<<() [5/6]

Message& testing::Message::operator<< ( const wchar_t *  wide_c_str)

◆ operator<<() [6/6]

Message& testing::Message::operator<< ( wchar_t *  wide_c_str)

The documentation for this class was generated from the following file: