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

Side by Side Diff: Source/wtf/text/WTFString.h

Issue 1257203002: Fix ODR violation that can break WTF::String pretty printing in tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 4 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 | « Source/wtf/text/StringBuilderTest.cpp ('k') | Source/wtf/wtf.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 13 matching lines...) Expand all
24 24
25 // This file would be called String.h, but that conflicts with <string.h> 25 // This file would be called String.h, but that conflicts with <string.h>
26 // on systems without case-sensitive file systems. 26 // on systems without case-sensitive file systems.
27 27
28 #include "wtf/HashTableDeletedValueType.h" 28 #include "wtf/HashTableDeletedValueType.h"
29 #include "wtf/WTFExport.h" 29 #include "wtf/WTFExport.h"
30 #include "wtf/text/ASCIIFastPath.h" 30 #include "wtf/text/ASCIIFastPath.h"
31 #include "wtf/text/StringImpl.h" 31 #include "wtf/text/StringImpl.h"
32 #include "wtf/text/StringView.h" 32 #include "wtf/text/StringView.h"
33 #include <algorithm> 33 #include <algorithm>
34 #include <iosfwd>
34 35
35 #ifdef __OBJC__ 36 #ifdef __OBJC__
36 #include <objc/objc.h> 37 #include <objc/objc.h>
37 #endif 38 #endif
38 39
39 namespace WTF { 40 namespace WTF {
40 41
41 class CString; 42 class CString;
42 struct StringHash; 43 struct StringHash;
43 44
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 template<typename T> struct DefaultHash; 627 template<typename T> struct DefaultHash;
627 template<> struct DefaultHash<String> { 628 template<> struct DefaultHash<String> {
628 typedef StringHash Hash; 629 typedef StringHash Hash;
629 }; 630 };
630 631
631 // Shared global empty string. 632 // Shared global empty string.
632 WTF_EXPORT const String& emptyString(); 633 WTF_EXPORT const String& emptyString();
633 WTF_EXPORT const String& emptyString16Bit(); 634 WTF_EXPORT const String& emptyString16Bit();
634 WTF_EXPORT extern const String& xmlnsWithColon; 635 WTF_EXPORT extern const String& xmlnsWithColon;
635 636
637 // Pretty printer for gtest. Declared here to avoid ODR violations.
638 WTF_EXPORT std::ostream& operator<<(std::ostream&, const String&);
dcheng 2015/07/27 19:59:04 It feels a little sketchy to declare an exported f
639
636 } // namespace WTF 640 } // namespace WTF
637 641
638 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(String); 642 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(String);
639 643
640 using WTF::CString; 644 using WTF::CString;
641 using WTF::KeepTrailingZeros; 645 using WTF::KeepTrailingZeros;
642 using WTF::StrictUTF8Conversion; 646 using WTF::StrictUTF8Conversion;
643 using WTF::StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD; 647 using WTF::StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD;
644 using WTF::String; 648 using WTF::String;
645 using WTF::emptyString; 649 using WTF::emptyString;
(...skipping 12 matching lines...) Expand all
658 using WTF::charactersToFloat; 662 using WTF::charactersToFloat;
659 using WTF::equal; 663 using WTF::equal;
660 using WTF::equalIgnoringCase; 664 using WTF::equalIgnoringCase;
661 using WTF::find; 665 using WTF::find;
662 using WTF::isAllSpecialCharacters; 666 using WTF::isAllSpecialCharacters;
663 using WTF::isSpaceOrNewline; 667 using WTF::isSpaceOrNewline;
664 using WTF::reverseFind; 668 using WTF::reverseFind;
665 669
666 #include "wtf/text/AtomicString.h" 670 #include "wtf/text/AtomicString.h"
667 #endif // WTFString_h 671 #endif // WTFString_h
OLDNEW
« no previous file with comments | « Source/wtf/text/StringBuilderTest.cpp ('k') | Source/wtf/wtf.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698