Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Side by Side Diff: base/logging.cc

Issue 9159005: Move operator<< for StringPiece into string_piece.{h,cc} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix license Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/logging.h ('k') | base/string_piece.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <io.h> 8 #include <io.h>
9 #include <windows.h> 9 #include <windows.h>
10 typedef HANDLE FileHandle; 10 typedef HANDLE FileHandle;
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 break; 828 break;
829 } 829 }
830 } while (rv != 1); 830 } while (rv != 1);
831 } 831 }
832 } 832 }
833 833
834 if (level == LOG_FATAL) 834 if (level == LOG_FATAL)
835 base::debug::BreakDebugger(); 835 base::debug::BreakDebugger();
836 } 836 }
837 837
838 // This was defined at the beginning of this file.
839 #undef write
840
838 } // namespace logging 841 } // namespace logging
839 842
840 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { 843 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
841 return out << WideToUTF8(std::wstring(wstr)); 844 return out << WideToUTF8(std::wstring(wstr));
842 } 845 }
843
844 namespace base {
845
846 // This was defined at the beginnig of this file.
847 #undef write
848
849 std::ostream& operator<<(std::ostream& o, const StringPiece& piece) {
850 o.write(piece.data(), static_cast<std::streamsize>(piece.size()));
851 return o;
852 }
853
854 } // namespace base
OLDNEW
« no previous file with comments | « base/logging.h ('k') | base/string_piece.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698