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

Side by Side Diff: third_party/WebKit/Source/wtf/text/Collator.h

Issue 1373773002: Fix check-webkit-style errors in Source/wtf/text/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 21 matching lines...) Expand all
32 #include "wtf/FastAllocBase.h" 32 #include "wtf/FastAllocBase.h"
33 #include "wtf/Noncopyable.h" 33 #include "wtf/Noncopyable.h"
34 #include "wtf/PassOwnPtr.h" 34 #include "wtf/PassOwnPtr.h"
35 #include "wtf/WTFExport.h" 35 #include "wtf/WTFExport.h"
36 #include "wtf/text/Unicode.h" 36 #include "wtf/text/Unicode.h"
37 37
38 struct UCollator; 38 struct UCollator;
39 39
40 namespace WTF { 40 namespace WTF {
41 41
42 class WTF_EXPORT Collator { 42 class WTF_EXPORT Collator {
43 WTF_MAKE_NONCOPYABLE(Collator); WTF_MAKE_FAST_ALLOCATED(Collator); 43 WTF_MAKE_NONCOPYABLE(Collator);
44 public: 44 WTF_MAKE_FAST_ALLOCATED(Collator);
45 enum Result { Equal = 0, Greater = 1, Less = -1 }; 45 public:
46 enum Result { Equal = 0, Greater = 1, Less = -1 };
46 47
47 // From ICU's uloc.h (ULOC_FULLNAME_CAPACITY) 48 // From ICU's uloc.h (ULOC_FULLNAME_CAPACITY)
48 static const size_t ulocFullnameCapacity = 157; 49 static const size_t ulocFullnameCapacity = 157;
49 50
50 Collator(const char* locale); // Parsing is lenient; e.g. language ident ifiers (such as "en-US") are accepted, too. 51 Collator(const char* locale); // Parsing is lenient; e.g. language identifie rs (such as "en-US") are accepted, too.
51 ~Collator(); 52 ~Collator();
52 void setOrderLowerFirst(bool); 53 void setOrderLowerFirst(bool);
53 54
54 static PassOwnPtr<Collator> userDefault(); 55 static PassOwnPtr<Collator> userDefault();
55 56
56 Result collate(const ::UChar*, size_t, const ::UChar*, size_t) const; 57 Result collate(const ::UChar*, size_t, const ::UChar*, size_t) const;
57 58
58 private: 59 private:
59 void createCollator() const; 60 void createCollator() const;
60 void releaseCollator(); 61 void releaseCollator();
61 void setEquivalentLocale(const char*, char*); 62 void setEquivalentLocale(const char*, char*);
62 mutable UCollator* m_collator; 63 mutable UCollator* m_collator;
63 64
64 char* m_locale; 65 char* m_locale;
65 char m_equivalentLocale[ulocFullnameCapacity]; 66 char m_equivalentLocale[ulocFullnameCapacity];
66 bool m_lowerFirst; 67 bool m_lowerFirst;
67 }; 68 };
69
68 } 70 }
69 71
70 using WTF::Collator; 72 using WTF::Collator;
71 73
72 #endif 74 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/Base64.cpp ('k') | third_party/WebKit/Source/wtf/text/StringBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698