Lines Matching refs:os
136 void UniversalPrint(const T& value, ::std::ostream* os);
164 static void PrintValue(const T& container, std::ostream* os) {
166 *os << '{';
170 *os << ',';
172 *os << " ...";
176 *os << ' ';
177 // We cannot call PrintTo(elem, os) here as PrintTo() doesn't
179 internal::UniversalPrint(elem, os);
184 *os << ' ';
186 *os << '}';
199 static void PrintValue(T* p, ::std::ostream* os) {
201 *os << "NULL";
203 // T is a function type, so '*os << p' doesn't do what we want
206 *os << reinterpret_cast<const void*>(p);
213 static void PrintValue(T* p, ::std::ostream* os) {
215 *os << "NULL";
220 *os << p;
244 static auto PrintValue(const T& value, ::std::ostream* os)
245 -> decltype((void)(*os << value)) {
248 *os << value;
263 static void PrintValue(const T& value, ::std::ostream* os) {
268 *os << ("<" + pretty_str + ">");
280 static void PrintValue(internal::BiggestInt value, ::std::ostream* os) {
281 *os << value;
287 static void PrintValue(internal::StringView value, ::std::ostream* os) {
288 internal::UniversalPrint(value, os);
298 static void PrintValue(const T& value, ::std::ostream* os) {
299 *os << absl::StrCat(value);
307 size_t count, ::std::ostream* os);
311 static void PrintValue(const T& value, ::std::ostream* os) {
316 sizeof(value), os);
322 static void PrintValue(const T&, ::std::ostream* os) {
323 *os << "(incomplete type)";
348 void PrintWithFallback(const T& value, ::std::ostream* os) {
358 Printer::PrintValue(value, os);
486 void PrintTo(const T& value, ::std::ostream* os) {
487 internal::PrintWithFallback(value, os);
495 GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
496 GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
497 inline void PrintTo(char c, ::std::ostream* os) {
501 PrintTo(static_cast<unsigned char>(c), os);
505 inline void PrintTo(bool x, ::std::ostream* os) {
506 *os << (x ? "true" : "false");
516 GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
518 GTEST_API_ void PrintTo(char32_t c, ::std::ostream* os);
519 inline void PrintTo(char16_t c, ::std::ostream* os) {
520 PrintTo(ImplicitCast_<char32_t>(c), os);
523 inline void PrintTo(char8_t c, ::std::ostream* os) {
524 PrintTo(ImplicitCast_<char32_t>(c), os);
530 GTEST_API_ void PrintTo(__uint128_t v, ::std::ostream* os);
531 GTEST_API_ void PrintTo(__int128_t v, ::std::ostream* os);
601 inline void PrintTo(float f, ::std::ostream* os) {
602 auto old_precision = os->precision();
603 os->precision(AppropriateResolution(f));
604 *os << f;
605 os->precision(old_precision);
608 inline void PrintTo(double d, ::std::ostream* os) {
609 auto old_precision = os->precision();
610 os->precision(AppropriateResolution(d));
611 *os << d;
612 os->precision(old_precision);
616 GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
617 inline void PrintTo(char* s, ::std::ostream* os) {
618 PrintTo(ImplicitCast_<const char*>(s), os);
623 inline void PrintTo(const signed char* s, ::std::ostream* os) {
624 PrintTo(ImplicitCast_<const void*>(s), os);
626 inline void PrintTo(signed char* s, ::std::ostream* os) {
627 PrintTo(ImplicitCast_<const void*>(s), os);
629 inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
630 PrintTo(ImplicitCast_<const void*>(s), os);
632 inline void PrintTo(unsigned char* s, ::std::ostream* os) {
633 PrintTo(ImplicitCast_<const void*>(s), os);
637 GTEST_API_ void PrintTo(const char8_t* s, ::std::ostream* os);
638 inline void PrintTo(char8_t* s, ::std::ostream* os) {
639 PrintTo(ImplicitCast_<const char8_t*>(s), os);
643 GTEST_API_ void PrintTo(const char16_t* s, ::std::ostream* os);
644 inline void PrintTo(char16_t* s, ::std::ostream* os) {
645 PrintTo(ImplicitCast_<const char16_t*>(s), os);
648 GTEST_API_ void PrintTo(const char32_t* s, ::std::ostream* os);
649 inline void PrintTo(char32_t* s, ::std::ostream* os) {
650 PrintTo(ImplicitCast_<const char32_t*>(s), os);
660 GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
661 inline void PrintTo(wchar_t* s, ::std::ostream* os) {
662 PrintTo(ImplicitCast_<const wchar_t*>(s), os);
672 void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
673 UniversalPrint(a[0], os);
675 *os << ", ";
676 UniversalPrint(a[i], os);
681 GTEST_API_ void PrintStringTo(const ::std::string& s, ::std::ostream* os);
682 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
683 PrintStringTo(s, os);
688 GTEST_API_ void PrintU8StringTo(const ::std::u8string& s, ::std::ostream* os);
689 inline void PrintTo(const ::std::u8string& s, ::std::ostream* os) {
690 PrintU8StringTo(s, os);
695 GTEST_API_ void PrintU16StringTo(const ::std::u16string& s, ::std::ostream* os);
696 inline void PrintTo(const ::std::u16string& s, ::std::ostream* os) {
697 PrintU16StringTo(s, os);
701 GTEST_API_ void PrintU32StringTo(const ::std::u32string& s, ::std::ostream* os);
702 inline void PrintTo(const ::std::u32string& s, ::std::ostream* os) {
703 PrintU32StringTo(s, os);
708 GTEST_API_ void PrintWideStringTo(const ::std::wstring& s, ::std::ostream* os);
709 inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
710 PrintWideStringTo(s, os);
716 inline void PrintTo(internal::StringView sp, ::std::ostream* os) {
717 PrintTo(::std::string(sp), os);
721 inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
724 inline void PrintTo(const std::type_info& info, std::ostream* os) {
725 *os << internal::GetTypeName(info);
730 void PrintTo(std::reference_wrapper<T> ref, ::std::ostream* os) {
731 UniversalPrinter<T&>::Print(ref.get(), os);
740 void PrintSmartPointer(const Ptr& ptr, std::ostream* os, char) {
742 *os << "(nullptr)";
745 *os << "(" << (VoidifyPointer)(ptr.get()) << ")";
751 void PrintSmartPointer(const Ptr& ptr, std::ostream* os, int) {
753 *os << "(nullptr)";
755 *os << "(ptr = " << (VoidifyPointer)(ptr.get()) << ", value = ";
756 UniversalPrinter<T>::Print(*ptr, os);
757 *os << ")";
762 void PrintTo(const std::unique_ptr<T, D>& ptr, std::ostream* os) {
763 (PrintSmartPointer<T>)(ptr, os, 0);
767 void PrintTo(const std::shared_ptr<T>& ptr, std::ostream* os) {
768 (PrintSmartPointer<T>)(ptr, os, 0);
779 ::std::ostream* os) {
780 PrintTupleTo(t, std::integral_constant<size_t, I - 1>(), os);
784 *os << ", ";
787 std::get<I - 1>(t), os);
791 void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
792 *os << "(";
793 PrintTupleTo(t, std::integral_constant<size_t, sizeof...(Types)>(), os);
794 *os << ")";
799 void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
800 *os << '(';
801 // We cannot use UniversalPrint(value.first, os) here, as T1 may be
803 UniversalPrinter<T1>::Print(value.first, os);
804 *os << ", ";
805 UniversalPrinter<T2>::Print(value.second, os);
806 *os << ')';
821 static void Print(const T& value, ::std::ostream* os) {
830 PrintTo(value, os);
847 static void Print(const Any& value, ::std::ostream* os) {
849 *os << "value of type " << GetTypeName(value);
851 *os << "no value";
875 static void Print(const Optional<T>& value, ::std::ostream* os) {
876 *os << '(';
878 *os << "nullopt";
880 UniversalPrint(*value, os);
882 *os << ')';
889 static void Print(decltype(Nullopt()), ::std::ostream* os) {
890 *os << "(nullopt)";
903 static void Print(const Variant<T...>& value, ::std::ostream* os) {
904 *os << '(';
906 absl::visit(Visitor{os, value.index()}, value);
908 std::visit(Visitor{os, value.index()}, value);
910 *os << ')';
917 *os << "'" << GetTypeName<U>() << "(index = " << index
919 UniversalPrint(u, os);
921 ::std::ostream* os;
928 // UniversalPrintArray(begin, len, os) prints an array of 'len'
931 void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
933 *os << "{}";
935 *os << "{ ";
942 PrintRawArrayTo(begin, len, os);
944 PrintRawArrayTo(begin, kChunkSize, os);
945 *os << ", ..., ";
946 PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
948 *os << " }";
953 ::std::ostream* os);
958 ::std::ostream* os);
963 ::std::ostream* os);
967 ::std::ostream* os);
971 ::std::ostream* os);
979 static void Print(const T (&a)[N], ::std::ostream* os) {
980 UniversalPrintArray(a, N, os);
992 static void Print(const T& value, ::std::ostream* os) {
995 *os << "@" << reinterpret_cast<const void*>(&value) << " ";
998 UniversalPrint(value, os);
1011 static void Print(const T& value, ::std::ostream* os) {
1012 UniversalPrint(value, os);
1018 static void Print(const T& value, ::std::ostream* os) {
1019 UniversalPrint(value, os);
1025 static void Print(std::reference_wrapper<T> value, ::std::ostream* os) {
1026 UniversalTersePrinter<T>::Print(value.get(), os);
1032 static void Print(const T (&value)[N], ::std::ostream* os) {
1033 UniversalPrinter<T[N]>::Print(value, os);
1039 static void Print(const char* str, ::std::ostream* os) {
1041 *os << "NULL";
1043 UniversalPrint(std::string(str), os);
1055 static void Print(const char8_t* str, ::std::ostream* os) {
1057 *os << "NULL";
1059 UniversalPrint(::std::u8string(str), os);
1071 static void Print(const char16_t* str, ::std::ostream* os) {
1073 *os << "NULL";
1075 UniversalPrint(::std::u16string(str), os);
1086 static void Print(const char32_t* str, ::std::ostream* os) {
1088 *os << "NULL";
1090 UniversalPrint(::std::u32string(str), os);
1102 static void Print(const wchar_t* str, ::std::ostream* os) {
1104 *os << "NULL";
1106 UniversalPrint(::std::wstring(str), os);
1115 static void Print(wchar_t* str, ::std::ostream* os) {
1116 UniversalTersePrinter<const wchar_t*>::Print(str, os);
1121 void UniversalTersePrint(const T& value, ::std::ostream* os) {
1122 UniversalTersePrinter<T>::Print(value, os);
1130 void UniversalPrint(const T& value, ::std::ostream* os) {
1134 UniversalPrinter<T1>::Print(value, os);