Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim:set ts=2 sw=2 sts=2 et cindent: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | // IWYU pragma: private, include "nsString.h" |
michael@0 | 7 | |
michael@0 | 8 | #ifndef nsAString_h___ |
michael@0 | 9 | #define nsAString_h___ |
michael@0 | 10 | |
michael@0 | 11 | #include "nsStringFwd.h" |
michael@0 | 12 | #include "nsStringIterator.h" |
michael@0 | 13 | |
michael@0 | 14 | #include <string.h> |
michael@0 | 15 | #include <stdarg.h> |
michael@0 | 16 | |
michael@0 | 17 | #include "mozilla/fallible.h" |
michael@0 | 18 | |
michael@0 | 19 | #define kNotFound -1 |
michael@0 | 20 | |
michael@0 | 21 | // declare nsAString |
michael@0 | 22 | #include "string-template-def-unichar.h" |
michael@0 | 23 | #include "nsTSubstring.h" |
michael@0 | 24 | #include "string-template-undef.h" |
michael@0 | 25 | |
michael@0 | 26 | // declare nsACString |
michael@0 | 27 | #include "string-template-def-char.h" |
michael@0 | 28 | #include "nsTSubstring.h" |
michael@0 | 29 | #include "string-template-undef.h" |
michael@0 | 30 | |
michael@0 | 31 | |
michael@0 | 32 | /** |
michael@0 | 33 | * ASCII case-insensitive comparator. (for Unicode case-insensitive |
michael@0 | 34 | * comparision, see nsUnicharUtils.h) |
michael@0 | 35 | */ |
michael@0 | 36 | class nsCaseInsensitiveCStringComparator |
michael@0 | 37 | : public nsCStringComparator |
michael@0 | 38 | { |
michael@0 | 39 | public: |
michael@0 | 40 | nsCaseInsensitiveCStringComparator() {} |
michael@0 | 41 | typedef char char_type; |
michael@0 | 42 | |
michael@0 | 43 | virtual int operator()( const char_type*, const char_type*, uint32_t, uint32_t ) const; |
michael@0 | 44 | }; |
michael@0 | 45 | |
michael@0 | 46 | class nsCaseInsensitiveCStringArrayComparator |
michael@0 | 47 | { |
michael@0 | 48 | public: |
michael@0 | 49 | template<class A, class B> |
michael@0 | 50 | bool Equals(const A& a, const B& b) const { |
michael@0 | 51 | return a.Equals(b, nsCaseInsensitiveCStringComparator()); |
michael@0 | 52 | } |
michael@0 | 53 | }; |
michael@0 | 54 | |
michael@0 | 55 | // included here for backwards compatibility |
michael@0 | 56 | #ifndef nsSubstringTuple_h___ |
michael@0 | 57 | #include "nsSubstringTuple.h" |
michael@0 | 58 | #endif |
michael@0 | 59 | |
michael@0 | 60 | #endif // !defined(nsAString_h___) |