46 #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ 47 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ 51 #include "gtest/internal/gtest-port.h" 55 void operator<<(
const testing::internal::Secret&,
int);
85 class GTEST_API_ Message {
89 typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
96 Message(
const Message& msg) : ss_(new ::
std::stringstream) {
97 *ss_ << msg.GetString();
101 explicit Message(
const char* str) : ss_(new ::
std::stringstream) {
107 template <
typename T>
108 inline Message& operator <<(
const T& value) {
109 StreamHelper(
typename internal::is_pointer<T>::type(), value);
114 template <
typename T>
115 inline Message& operator <<(
const T& val) {
148 template <
typename T>
149 inline Message& operator <<(
T*
const& pointer) {
150 if (pointer == NULL) {
157 #endif // GTEST_OS_SYMBIAN 165 Message& operator <<(BasicNarrowIoManip val) {
171 Message& operator <<(
bool b) {
172 return *
this << (b ?
"true" :
"false");
177 Message& operator <<(
const wchar_t* wide_c_str);
178 Message& operator <<(
wchar_t* wide_c_str);
180 #if GTEST_HAS_STD_WSTRING 183 Message& operator <<(const ::std::wstring& wstr);
184 #endif // GTEST_HAS_STD_WSTRING 186 #if GTEST_HAS_GLOBAL_WSTRING 189 Message& operator <<(const ::wstring& wstr);
190 #endif // GTEST_HAS_GLOBAL_WSTRING 196 std::string GetString()
const;
205 template <
typename T>
206 inline void StreamHelper(internal::true_type ,
T* pointer) {
207 if (pointer == NULL) {
213 template <
typename T>
214 inline void StreamHelper(internal::false_type ,
221 #endif // GTEST_OS_SYMBIAN 224 const internal::scoped_ptr< ::std::stringstream> ss_;
228 void operator=(
const Message&);
232 inline std::ostream& operator <<(std::ostream& os,
const Message& sb) {
233 return os << sb.GetString();
242 template <
typename T>
243 std::string StreamableToString(
const T& streamable) {
244 return (Message() << streamable).GetString();
250 #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ Definition: gtest-all.cc:113
Definition: TypeSafeIdHash.h:44
std::ostream & operator<<(std::ostream &s, const DenseBase< Derived > &m)
Definition: IO.h:242
A small structure to hold a non zero as a triplet (i,j,value).
Definition: SparseUtil.h:148
Definition: BandTriangularSolver.h:13