Electroneum
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
 
 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 85 of file gtest-message.h.

Constructor & Destructor Documentation

◆ Message() [1/6]

testing::Message::Message ( )

◆ Message() [2/6]

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

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

96  : ss_(new ::std::stringstream) { // NOLINT
97  *ss_ << msg.GetString();
98  }
Here is the call graph for this function:

◆ Message() [3/6]

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

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

101  : ss_(new ::std::stringstream) {
102  *ss_ << str;
103  }

◆ Message() [4/6]

testing::Message::Message ( )

◆ Message() [5/6]

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

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

96  : ss_(new ::std::stringstream) { // NOLINT
97  *ss_ << msg.GetString();
98  }
Here is the call graph for this function:

◆ Message() [6/6]

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

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

101  : ss_(new ::std::stringstream) {
102  *ss_ << str;
103  }

Member Function Documentation

◆ GetString() [1/2]

std::string testing::Message::GetString ( ) const
Here is the caller graph for this function:

◆ GetString() [2/2]

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

◆ operator<<() [1/12]

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

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

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

◆ operator<<() [2/12]

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

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

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

◆ operator<<() [3/12]

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

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

149  { // NOLINT
150  if (pointer == NULL) {
151  *ss_ << "(null)";
152  } else {
153  *ss_ << pointer;
154  }
155  return *this;
156  }
const GenericPointer< typename T::ValueType > & pointer
Definition: pointer.h:1124

◆ operator<<() [4/12]

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

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

149  { // NOLINT
150  if (pointer == NULL) {
151  *ss_ << "(null)";
152  } else {
153  *ss_ << pointer;
154  }
155  return *this;
156  }
const GenericPointer< typename T::ValueType > & pointer
Definition: pointer.h:1124

◆ operator<<() [5/12]

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<<() [6/12]

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<<() [7/12]

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

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

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

◆ operator<<() [8/12]

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

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

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

◆ operator<<() [9/12]

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

◆ operator<<() [10/12]

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

◆ operator<<() [11/12]

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

◆ operator<<() [12/12]

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

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