/src/mozilla-central/xpcom/string/nsAString.h
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | // IWYU pragma: private, include "nsString.h" |
7 | | |
8 | | #ifndef nsAString_h___ |
9 | | #define nsAString_h___ |
10 | | |
11 | | #include "nsStringFwd.h" |
12 | | #include "nsStringIterator.h" |
13 | | #include "mozilla/TypedEnumBits.h" |
14 | | |
15 | | #include <string.h> |
16 | | #include <stdarg.h> |
17 | | |
18 | 6.14M | #define kNotFound -1 |
19 | | |
20 | | #include "nsStringFlags.h" |
21 | | #include "nsTStringRepr.h" |
22 | | #include "nsTSubstring.h" |
23 | | #include "nsTSubstringTuple.h" |
24 | | |
25 | | /** |
26 | | * ASCII case-insensitive comparator. (for Unicode case-insensitive |
27 | | * comparision, see nsUnicharUtils.h) |
28 | | */ |
29 | | class nsCaseInsensitiveCStringComparator |
30 | | : public nsCStringComparator |
31 | | { |
32 | | public: |
33 | | nsCaseInsensitiveCStringComparator() |
34 | 7 | { |
35 | 7 | } |
36 | | typedef char char_type; |
37 | | |
38 | | virtual int operator()(const char_type*, const char_type*, |
39 | | uint32_t, uint32_t) const override; |
40 | | }; |
41 | | |
42 | | class nsCaseInsensitiveCStringArrayComparator |
43 | | { |
44 | | public: |
45 | | template<class A, class B> |
46 | | bool Equals(const A& aStrA, const B& aStrB) const |
47 | | { |
48 | | return aStrA.Equals(aStrB, nsCaseInsensitiveCStringComparator()); |
49 | | } |
50 | | }; |
51 | | |
52 | | #endif // !defined(nsAString_h___) |